/* =========================================================================
   CoreDesk · Design system (single stylesheet, loaded after Bootstrap 5.3)

   Sections
     1. Fonts (Poppins, self-hosted)
     2. Design tokens (--cx-*) and Bootstrap theme mapping (--bs-*)
     3. Base elements
     4. Bootstrap component theming (buttons, forms, dropdowns, cards,
        tables, ...) and date / time pickers (cx-picker)
     5. Application shell: cx-shell, cx-sidebar, cx-nav-item, cx-topbar, cx-ticker,
        cx-icon-link, cx-profile, cx-profile-menu, cx-avatar, cx-page
     6. Page building blocks: cx-card, cx-page-header, cx-toolbar,
        cx-search-group, cx-total-badge, cx-table-card, cx-pager
     7. Status and labels: cx-status-pill, cx-tag, cx-delta, cx-dot
     8. Dashboard: cx-accent-*, cx-kpi, cx-icon-badge, cx-section
     9. Row actions, empty states, details, forms: cx-row-actions,
        cx-row-action, cx-placeholder, cx-loading-inline, cx-detail-list,
        cx-choice-list, cx-choice, cx-form-section-title, cx-tabs,
        cx-period, cx-today, cx-row-muted, cx-stat-grid, cx-stat,
        cx-announcement
    10. Dialogs and toasts: cx-dialog, cx-dialog__icon, cx-secret, cx-toast
    11. Sign-in screen: cx-auth
    12. Utilities (cx-fs-*, cx-tabular-nums, ...)
    13. Blazor framework hooks

   Conventions
     - Prefer plain Bootstrap utilities in markup (d-flex, gap-2, mb-3, ...).
     - Project classes use BEM: block, block__element, block--modifier.
     - Spacing is rem (root 14px); font sizes are px via the type scale.
     - Icons: Bootstrap Icons (<i class="bi bi-people"></i>).
   ========================================================================= */

/* =========================================================================
   1. Fonts
   ========================================================================= */
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("lib/poppins/poppins-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("lib/poppins/poppins-latin-500-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("lib/poppins/poppins-latin-600-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("lib/poppins/poppins-latin-700-normal.woff2") format("woff2");
}

/* =========================================================================
   2. Design tokens (light theme)
   ========================================================================= */
:root {
  /* ---------- Brand (Truesys Fintech logo) ---------- */
  --cx-primary: #3634e6;        /* logo blue */
  --cx-primary-600: #2b29c9;    /* button hover */
  --cx-primary-dark: #1f1d9a;   /* active, headings in dialogs */
  --cx-primary-deep: #14126b;   /* sign-in brand panel */
  --cx-primary-soft: #eeeeff;   /* tinted backgrounds */
  --cx-primary-border: #d4d3fb;
  --cx-orange: #f58220;         /* logo orange (accent) */
  --cx-orange-dark: #d96b0c;
  --cx-orange-soft: #fff4ea;
  --cx-ink: #0b0b12;            /* sign-in button */

  /* ---------- Status ---------- */
  --cx-crimson: #e32119;
  --cx-crimson-dark: #c71b14;
  --cx-emerald: #10b981;
  --cx-emerald-dark: #059669;
  --cx-amber: #f59e0b;
  --cx-amber-dark: #92400e;

  /* ---------- Neutrals (slate) ---------- */
  --cx-slate-50: #f8fafc;
  --cx-slate-100: #f1f5f9;
  --cx-slate-200: #e2e8f0;
  --cx-slate-300: #cbd5e1;
  --cx-slate-400: #94a3b8;
  --cx-slate-500: #64748b;
  --cx-slate-600: #475569;
  --cx-slate-700: #334155;
  --cx-slate-800: #1e293b;
  --cx-slate-900: #0f172a;

  /* ---------- Surfaces ---------- */
  --cx-canvas: #f4f6fa;         /* page background */
  --cx-surface: #ffffff;        /* cards */
  --cx-surface-muted: #f8fafc;  /* table headers */
  --cx-border: rgba(226, 232, 240, 0.8);
  --cx-border-strong: #cbd5e1;

  /* ---------- Text ---------- */
  --cx-text-strong: #0f172a;
  --cx-text: #334155;
  --cx-text-muted: #64748b;
  --cx-text-subtle: #94a3b8;
  --cx-text-heading: #0b1c30;

  /* ---------- Typography ---------- */
  --cx-font-sans: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --cx-fs-2xs: 10.5px;  /* micro labels, badges */
  --cx-fs-xs: 11px;     /* table headers, metadata */
  --cx-fs-sm: 12px;     /* secondary text */
  --cx-fs-base: 13px;   /* body, nav */
  --cx-fs-md: 14px;
  --cx-fs-lg: 16px;     /* card and dialog titles */
  --cx-fs-xl: 18px;     /* page titles */
  --cx-fs-2xl: 22px;
  --cx-fs-3xl: 28px;    /* metric figures */
  --cx-fs-4xl: 32px;

  --cx-tracking-tight: -0.01em;
  --cx-tracking-wide: 0.05em;

  /* ---------- Spacing / shape ---------- */
  --cx-space-1: 0.25rem;
  --cx-space-2: 0.5rem;
  --cx-space-3: 0.75rem;
  --cx-space-4: 1rem;
  --cx-space-5: 1.25rem;
  --cx-space-6: 1.5rem;

  --cx-radius-sm: 0.25rem;   /* controls, badges */
  --cx-radius: 0.375rem;     /* nav items, buttons */
  --cx-radius-lg: 0.5rem;    /* cards, panels, dialogs */
  --cx-radius-xl: 0.75rem;   /* large tiles */
  --cx-radius-pill: 50rem;

  /* ---------- Elevation ---------- */
  --cx-shadow-xs: 0 1px 2px rgba(20, 18, 107, 0.04);
  --cx-shadow-sm: 0 1px 3px rgba(20, 18, 107, 0.05), 0 1px 2px rgba(20, 18, 107, 0.03);
  --cx-shadow-md: 0 4px 12px -2px rgba(20, 18, 107, 0.08), 0 2px 6px -1px rgba(20, 18, 107, 0.04);
  --cx-shadow-lg: 0 16px 32px -4px rgba(20, 18, 107, 0.16), 0 6px 12px -2px rgba(20, 18, 107, 0.08);
  --cx-shadow-primary: 0 1px 2px rgba(54, 52, 230, 0.25);
  --cx-focus-ring: 0 0 0 3px rgba(54, 52, 230, 0.15);

  /* ---------- Layout ---------- */
  --cx-sidebar-width: 16rem;
  --cx-topbar-height: 4rem;

  --cx-ease: cubic-bezier(0.16, 1, 0.3, 1);

  /* ---------- Bootstrap 5.3 theme mapping ----------
     Plain Bootstrap classes (text-primary, bg-danger-subtle, border, ...)
     render in brand colours. */
  --bs-font-sans-serif: var(--cx-font-sans);
  --bs-body-font-family: var(--cx-font-sans);
  --bs-body-font-size: var(--cx-fs-base);
  --bs-body-line-height: 1.5;
  --bs-body-color: var(--cx-text);
  --bs-body-color-rgb: 51, 65, 85;
  --bs-body-bg: var(--cx-canvas);
  --bs-body-bg-rgb: 244, 246, 250;

  --bs-emphasis-color: var(--cx-text-strong);
  --bs-emphasis-color-rgb: 15, 23, 42;
  --bs-secondary-color: var(--cx-text-muted);
  --bs-secondary-color-rgb: 100, 116, 139;
  --bs-tertiary-color: var(--cx-text-subtle);
  --bs-tertiary-color-rgb: 148, 163, 184;
  --bs-secondary-bg: var(--cx-slate-100);
  --bs-tertiary-bg: var(--cx-slate-50);
  --bs-heading-color: var(--cx-text-strong);

  --bs-primary: var(--cx-primary);
  --bs-primary-rgb: 54, 52, 230;
  --bs-primary-text-emphasis: var(--cx-primary-dark);
  --bs-primary-bg-subtle: var(--cx-primary-soft);
  --bs-primary-border-subtle: var(--cx-primary-border);

  --bs-danger: var(--cx-crimson);
  --bs-danger-rgb: 227, 33, 25;
  --bs-danger-text-emphasis: var(--cx-crimson-dark);
  --bs-danger-bg-subtle: #fdecea;
  --bs-danger-border-subtle: #f8b4b0;

  --bs-success: var(--cx-emerald-dark);
  --bs-success-rgb: 5, 150, 105;
  --bs-success-text-emphasis: #047857;
  --bs-success-bg-subtle: #ecfdf5;
  --bs-success-border-subtle: #a7f3d0;

  --bs-warning: var(--cx-orange);
  --bs-warning-rgb: 245, 130, 32;
  --bs-warning-text-emphasis: var(--cx-amber-dark);
  --bs-warning-bg-subtle: var(--cx-orange-soft);
  --bs-warning-border-subtle: #fdd3ad;

  --bs-info: #0284c7;
  --bs-info-rgb: 2, 132, 199;
  --bs-info-text-emphasis: #075985;
  --bs-info-bg-subtle: #f0f9ff;
  --bs-info-border-subtle: #bae6fd;

  --bs-link-color: var(--cx-primary);
  --bs-link-color-rgb: 54, 52, 230;
  --bs-link-hover-color: var(--cx-primary-dark);
  --bs-link-hover-color-rgb: 31, 29, 154;

  --bs-border-color: var(--cx-slate-200);
  --bs-border-color-translucent: var(--cx-border);
  --bs-border-radius: var(--cx-radius-sm);
  --bs-border-radius-sm: var(--cx-radius-sm);
  --bs-border-radius-lg: var(--cx-radius-lg);
  --bs-border-radius-xl: var(--cx-radius-xl);
  --bs-border-radius-pill: var(--cx-radius-pill);

  --bs-box-shadow-sm: var(--cx-shadow-sm);
  --bs-box-shadow: var(--cx-shadow-md);
  --bs-box-shadow-lg: var(--cx-shadow-lg);

  --bs-focus-ring-color: rgba(54, 52, 230, 0.15);
}

/* =========================================================================
   3. Base elements
   ========================================================================= */
html {
  font-size: 14px; /* drives all rem spacing */
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--cx-font-sans);
  font-size: var(--cx-fs-base);
  color: var(--cx-text);
  background-color: var(--cx-canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Headings and paragraphs carry no default margins; spacing comes from layout classes. */
h1, h2, h3, h4, h5, h6,
p {
  margin: 0;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--cx-text-strong);
  font-weight: 700;
  letter-spacing: var(--cx-tracking-tight);
  line-height: 1.25;
}

h1:focus {
  outline: none;
}

a {
  color: var(--cx-primary);
}

img {
  max-width: 100%;
}

button,
select,
input,
textarea {
  font-family: inherit;
}

.bi {
  line-height: 1;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-thumb {
  background: var(--cx-slate-300);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--cx-slate-400);
}

::-webkit-scrollbar-track {
  background: transparent;
}

/* =========================================================================
   4. Bootstrap component theming
   ========================================================================= */

/* ---------- Buttons ---------- */
.btn {
  --bs-btn-font-family: var(--cx-font-sans);
  --bs-btn-font-size: var(--cx-fs-base);
  --bs-btn-font-weight: 600;
  --bs-btn-padding-x: 1rem;
  --bs-btn-padding-y: 0.5rem;
  --bs-btn-border-radius: var(--cx-radius);
  --bs-btn-focus-box-shadow: var(--cx-focus-ring);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  line-height: 1.4;
  transition: background-color 0.18s var(--cx-ease), border-color 0.18s var(--cx-ease), color 0.18s var(--cx-ease), box-shadow 0.18s var(--cx-ease);
}

.btn-sm {
  --bs-btn-font-size: var(--cx-fs-sm);
  --bs-btn-padding-x: 0.875rem;
  --bs-btn-padding-y: 0.375rem;
}

.btn-lg {
  --bs-btn-font-size: var(--cx-fs-md);
  --bs-btn-padding-x: 1.5rem;
  --bs-btn-padding-y: 0.75rem;
}

.btn-primary {
  --bs-btn-color: #ffffff;
  --bs-btn-bg: var(--cx-primary);
  --bs-btn-border-color: var(--cx-primary);
  --bs-btn-hover-color: #ffffff;
  --bs-btn-hover-bg: var(--cx-primary-600);
  --bs-btn-hover-border-color: var(--cx-primary-600);
  --bs-btn-active-color: #ffffff;
  --bs-btn-active-bg: var(--cx-primary-dark);
  --bs-btn-active-border-color: var(--cx-primary-dark);
  --bs-btn-disabled-color: #ffffff;
  --bs-btn-disabled-bg: var(--cx-primary);
  --bs-btn-disabled-border-color: var(--cx-primary);
  box-shadow: var(--cx-shadow-primary);
}

.btn-danger {
  --bs-btn-color: #ffffff;
  --bs-btn-bg: var(--cx-crimson);
  --bs-btn-border-color: var(--cx-crimson);
  --bs-btn-hover-color: #ffffff;
  --bs-btn-hover-bg: var(--cx-crimson-dark);
  --bs-btn-hover-border-color: var(--cx-crimson-dark);
  --bs-btn-active-bg: var(--cx-crimson-dark);
  --bs-btn-active-border-color: var(--cx-crimson-dark);
  --bs-btn-disabled-bg: var(--cx-crimson);
  --bs-btn-disabled-border-color: var(--cx-crimson);
}

/* Secondary = white outline button (Cancel, secondary actions) */
.btn-secondary,
.btn-outline-secondary {
  --bs-btn-color: var(--cx-text-strong);
  --bs-btn-bg: #ffffff;
  --bs-btn-border-color: var(--cx-border-strong);
  --bs-btn-hover-color: var(--cx-primary);
  --bs-btn-hover-bg: var(--cx-slate-50);
  --bs-btn-hover-border-color: var(--cx-primary);
  --bs-btn-active-color: var(--cx-primary);
  --bs-btn-active-bg: var(--cx-slate-100);
  --bs-btn-active-border-color: var(--cx-primary);
  --bs-btn-disabled-color: var(--cx-text-muted);
  --bs-btn-disabled-bg: #ffffff;
  --bs-btn-disabled-border-color: var(--cx-border-strong);
  box-shadow: var(--cx-shadow-xs);
}

.btn-outline-primary {
  --bs-btn-color: var(--cx-primary);
  --bs-btn-border-color: var(--cx-primary);
  --bs-btn-hover-color: #ffffff;
  --bs-btn-hover-bg: var(--cx-primary);
  --bs-btn-hover-border-color: var(--cx-primary);
  --bs-btn-active-bg: var(--cx-primary-dark);
  --bs-btn-active-border-color: var(--cx-primary-dark);
}

/* Dark filled button (sign-in) */
.btn-dark {
  --bs-btn-color: #ffffff;
  --bs-btn-bg: var(--cx-ink);
  --bs-btn-border-color: var(--cx-ink);
  --bs-btn-hover-color: #ffffff;
  --bs-btn-hover-bg: var(--cx-primary-deep);
  --bs-btn-hover-border-color: var(--cx-primary-deep);
  --bs-btn-active-bg: var(--cx-primary-dark);
  --bs-btn-active-border-color: var(--cx-primary-dark);
}

/* Neutral filled button (filter reset) */
.btn-light {
  --bs-btn-color: var(--cx-slate-700);
  --bs-btn-bg: var(--cx-slate-100);
  --bs-btn-border-color: var(--cx-slate-200);
  --bs-btn-hover-color: var(--cx-slate-800);
  --bs-btn-hover-bg: var(--cx-slate-200);
  --bs-btn-hover-border-color: var(--cx-slate-200);
  --bs-btn-active-bg: var(--cx-slate-200);
  --bs-btn-active-border-color: var(--cx-slate-300);
  --bs-btn-font-weight: 500;
}

/* Plain icon button (menu toggles) */
.btn-icon {
  --bs-btn-padding-x: 0.5rem;
  --bs-btn-padding-y: 0.5rem;
  --bs-btn-color: var(--cx-slate-600);
  --bs-btn-bg: transparent;
  --bs-btn-hover-bg: var(--cx-slate-100);
  --bs-btn-hover-color: var(--cx-text-strong);
  --bs-btn-active-bg: var(--cx-slate-100);
  --bs-btn-border-color: transparent;
  --bs-btn-hover-border-color: transparent;
  --bs-btn-active-border-color: transparent;
  font-size: 20px;
  line-height: 1;
}

/* ---------- Forms ---------- */
.form-control,
.form-select {
  min-height: 2.6rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--cx-border-strong);
  border-radius: var(--cx-radius-sm);
  background-color: #ffffff;
  color: var(--cx-text-strong);
  font-size: var(--cx-fs-base);
  line-height: 1.5;
}

/* ---------- Dropdowns (select) ----------
   Closed control: custom chevron, hover and open states in every browser.
   Chromium (appearance: base-select) also gets a styled option list. */
.form-select {
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.6' d='m4 6 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.75rem center;
  background-size: 1rem 1rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--cx-shadow-xs);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.form-select:hover:not(:disabled) {
  border-color: var(--cx-slate-400);
  background-color: var(--cx-slate-50);
}

.form-select:disabled {
  background-color: var(--cx-slate-50);
  color: var(--cx-text-muted);
  cursor: not-allowed;
}

@supports (appearance: base-select) {
  select.form-select,
  select.form-select::picker(select) {
    appearance: base-select;
  }

  select.form-select {
    display: flex;
    align-items: center;
  }

  select.form-select::picker-icon {
    display: none;
  }

  select.form-select:open {
    border-color: var(--cx-primary);
    box-shadow: var(--cx-focus-ring);
    background-color: #ffffff;
  }

  select.form-select::picker(select) {
    max-height: 18rem;
    margin-top: 0.375rem;
    padding: 0.3125rem;
    overflow-y: auto;
    border: 1px solid var(--cx-slate-200);
    border-radius: var(--cx-radius-lg);
    background-color: #ffffff;
    box-shadow: var(--cx-shadow-lg);
  }

  select.form-select option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--cx-radius);
    color: var(--cx-text);
    font-family: var(--cx-font-sans);
    font-size: var(--cx-fs-base);
    font-weight: 500;
    cursor: pointer;
  }

  select.form-select option:hover,
  select.form-select option:focus-visible {
    outline: 0;
    background-color: var(--cx-slate-100);
    color: var(--cx-text-strong);
  }

  select.form-select option:checked {
    background-color: var(--cx-primary-soft);
    color: var(--cx-primary-dark);
    font-weight: 600;
  }

  select.form-select option::checkmark {
    order: 1;
    margin-left: auto;
    color: var(--cx-primary);
  }
}

textarea.form-control {
  min-height: 0;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--cx-primary);
  outline: 0;
  box-shadow: var(--cx-focus-ring);
}

.form-control::placeholder {
  color: var(--cx-text-subtle);
}

.form-control:disabled,
.form-control[readonly] {
  background-color: var(--cx-slate-50);
  color: var(--cx-text-muted);
}

/* ---------- Date and time pickers (Components/Shared/DatePicker, TimePicker) ---------- */
.cx-picker {
  position: relative;
}

.cx-picker__control .cx-picker__input,
.cx-picker__control .cx-picker__input[readonly] {
  background-color: #ffffff;
  color: var(--cx-text-strong);
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}

.cx-picker__control .cx-picker__input:disabled {
  background-color: var(--cx-slate-50);
  color: var(--cx-text-muted);
  cursor: not-allowed;
}

.cx-picker__control .cx-picker__input:focus {
  box-shadow: none;
}

.cx-picker__control .cx-picker__button {
  --bs-btn-padding-x: 0.75rem;
  border: 1px solid var(--cx-border-strong);
  border-left: 0;
  border-radius: 0 var(--cx-radius-sm) var(--cx-radius-sm) 0;
  background-color: #ffffff;
  color: var(--cx-slate-500);
  font-size: 15px;
  box-shadow: none;
}

.cx-picker__control .cx-picker__clear {
  border-radius: 0;
  color: var(--cx-slate-400);
  font-size: 12px;
}

.cx-picker__control .cx-picker__button:hover:not(:disabled) {
  background-color: var(--cx-slate-50);
  color: var(--cx-primary);
}

.cx-picker__control:focus-within {
  border-radius: var(--cx-radius-sm);
  box-shadow: var(--cx-focus-ring);
}

.cx-picker__control:focus-within .cx-picker__input,
.cx-picker__control:focus-within .cx-picker__button {
  border-color: var(--cx-primary);
}

.cx-picker__control .cx-picker__input.invalid,
.cx-picker__control .cx-picker__input.invalid ~ .cx-picker__button {
  border-color: var(--cx-crimson);
}

.cx-picker__backdrop {
  position: fixed;
  inset: 0;
  z-index: 1080;
}

.cx-picker__popover {
  position: absolute;
  top: calc(100% + 0.375rem);
  left: 0;
  z-index: 1085;
  width: 19rem;
  padding: 0.75rem;
  border: 1px solid var(--cx-slate-200);
  border-radius: var(--cx-radius-lg);
  background-color: #ffffff;
  box-shadow: var(--cx-shadow-lg);
  font-family: var(--cx-font-sans);
  animation: cx-pop-in 0.12s ease-out;
}

.cx-picker__popover--end {
  left: auto;
  right: 0;
}

.cx-picker__popover--time {
  width: 21rem;
}

.cx-picker__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.375rem;
  margin-bottom: 0.5rem;
}

.cx-picker__title {
  display: flex;
  gap: 0.375rem;
}

.cx-picker .cx-picker__select {
  width: auto;
  min-height: 2rem;
  padding: 0.25rem 1.9rem 0.25rem 0.625rem;
  background-position: right 0.5rem center;
  font-size: var(--cx-fs-sm);
  font-weight: 600;
  box-shadow: none;
}

.cx-picker__nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: var(--cx-radius);
  background: transparent;
  color: var(--cx-slate-600);
}

.cx-picker__nav:hover:not(:disabled) {
  background-color: var(--cx-slate-100);
  color: var(--cx-primary);
}

.cx-picker__nav:disabled {
  opacity: 0.35;
}

.cx-picker__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.cx-picker__weekday {
  padding: 0.25rem 0;
  font-size: var(--cx-fs-2xs);
  font-weight: 700;
  letter-spacing: var(--cx-tracking-wide);
  text-align: center;
  text-transform: uppercase;
  color: var(--cx-text-subtle);
}

.cx-picker__day {
  height: 2.15rem;
  border: 0;
  border-radius: var(--cx-radius);
  background: transparent;
  color: var(--cx-text-strong);
  font-family: inherit;
  font-size: var(--cx-fs-base);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.cx-picker__day.is-weekend {
  color: var(--cx-slate-500);
}

.cx-picker__day:hover:not(:disabled) {
  background-color: var(--cx-primary-soft);
  color: var(--cx-primary-dark);
}

.cx-picker__day.is-today {
  box-shadow: inset 0 0 0 1px var(--cx-primary-border);
  color: var(--cx-primary);
  font-weight: 700;
}

.cx-picker__day.is-selected,
.cx-picker__day.is-selected:hover {
  background-color: var(--cx-primary);
  box-shadow: var(--cx-shadow-primary);
  color: #ffffff;
  font-weight: 700;
}

.cx-picker__day:disabled {
  color: var(--cx-slate-300);
  cursor: not-allowed;
}

.cx-picker__footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.625rem;
  padding-top: 0.625rem;
  border-top: 1px solid var(--cx-slate-100);
}

.cx-picker__link {
  --bs-btn-color: var(--cx-primary);
  --bs-btn-hover-color: var(--cx-primary-dark);
  font-weight: 600;
  text-decoration: none;
}

.cx-picker__time {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 0.75rem;
}

.cx-picker__time-label {
  margin-bottom: 0.375rem;
  font-size: var(--cx-fs-2xs);
  font-weight: 700;
  letter-spacing: var(--cx-tracking-wide);
  text-transform: uppercase;
  color: var(--cx-text-subtle);
}

.cx-picker__hours {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
}

.cx-picker__minutes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}

/* Uppercase field labels (dialogs, filters) */
.form-label {
  margin-bottom: 0.3125rem;
  font-size: var(--cx-fs-xs);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--cx-slate-600);
}

/* Required-field marker: <span class="cx-required">*</span> */
.cx-required {
  color: var(--cx-crimson);
}

.form-text,
.invalid-feedback {
  font-size: var(--cx-fs-sm);
}

.form-check-input {
  border-color: var(--cx-border-strong);
  cursor: pointer;
}

.form-check-input:checked {
  background-color: var(--cx-primary);
  border-color: var(--cx-primary);
}

.form-check-input:focus {
  border-color: var(--cx-primary);
  box-shadow: var(--cx-focus-ring);
}

.form-check-label {
  font-size: var(--cx-fs-base);
  color: var(--cx-text);
  cursor: pointer;
}

/* ---------- Cards ---------- */
.card {
  --bs-card-bg: var(--cx-surface);
  --bs-card-color: var(--cx-text-strong);
  --bs-card-border-color: var(--cx-slate-200);
  --bs-card-border-radius: var(--cx-radius-lg);
  --bs-card-inner-border-radius: calc(var(--cx-radius-lg) - 1px);
  --bs-card-cap-bg: transparent;
  --bs-card-cap-padding-y: 0.875rem;
  --bs-card-cap-padding-x: 1.25rem;
  --bs-card-spacer-y: 1.25rem;
  --bs-card-spacer-x: 1.25rem;
  box-shadow: var(--cx-shadow-sm);
}

/* ---------- Tables ---------- */
.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--cx-text-strong);
  --bs-table-border-color: var(--cx-slate-100);
  --bs-table-hover-bg: var(--cx-slate-50);
  --bs-table-striped-bg: var(--cx-slate-50);
  margin-bottom: 0;
  font-size: var(--cx-fs-base);
}

.table > thead > tr > th {
  padding: 0.6875rem 1rem;
  border-bottom: 2px solid var(--cx-slate-200);
  background-color: var(--cx-surface-muted);
  color: var(--cx-text-muted);
  font-size: var(--cx-fs-2xs);
  font-weight: 700;
  letter-spacing: var(--cx-tracking-wide);
  text-transform: uppercase;
  white-space: nowrap;
}

.table > tbody > tr > td {
  padding: 0.6875rem 1rem;
  vertical-align: middle;
}

.table td.text-end,
.table th.text-end {
  font-variant-numeric: tabular-nums;
}

/* ---------- Badges / alerts ---------- */
.badge {
  font-weight: 600;
  letter-spacing: 0.01em;
}

.alert {
  --bs-alert-padding-y: 0.625rem;
  --bs-alert-padding-x: 0.875rem;
  --bs-alert-border-radius: var(--cx-radius);
  font-size: var(--cx-fs-base);
}

/* ---------- Modals ---------- */
.modal {
  --bs-modal-bg: var(--cx-surface);
  --bs-modal-color: var(--cx-text-strong);
  --bs-modal-border-color: var(--cx-slate-200);
  --bs-modal-border-radius: var(--cx-radius-lg);
  --bs-modal-box-shadow: var(--cx-shadow-lg);
  --bs-modal-header-padding: 1.125rem 1.5rem;
  --bs-modal-header-border-color: var(--cx-slate-100);
  --bs-modal-padding: 1.5rem;
  --bs-modal-footer-border-color: var(--cx-slate-100);
  --bs-modal-title-line-height: 1.3;
}

.modal-content {
  box-shadow: var(--cx-shadow-lg);
}

.modal-title {
  font-size: var(--cx-fs-xl);
  font-weight: 700;
  color: var(--cx-primary-dark);
}

/* Footer sits inside the body padding with a divider, as in the design */
.modal-footer {
  gap: var(--cx-space-2);
  margin: 0 1.5rem;
  padding: 1rem 0 1.25rem;
}

.modal-footer > * {
  margin: 0;
}

/* ---------- Pagination ---------- */
.pagination {
  --bs-pagination-font-size: var(--cx-fs-sm);
  --bs-pagination-color: var(--cx-text);
  --bs-pagination-border-color: var(--cx-slate-200);
  --bs-pagination-hover-color: var(--cx-primary);
  --bs-pagination-hover-bg: var(--cx-slate-50);
  --bs-pagination-focus-box-shadow: var(--cx-focus-ring);
  --bs-pagination-active-bg: var(--cx-primary);
  --bs-pagination-active-border-color: var(--cx-primary);
  --bs-pagination-disabled-color: var(--cx-text-subtle);
  --bs-pagination-disabled-bg: #ffffff;
}

/* ---------- Toasts / dropdowns ---------- */
.toast {
  --bs-toast-bg: var(--cx-surface);
  --bs-toast-color: var(--cx-text-strong);
  --bs-toast-border-radius: var(--cx-radius-lg);
  --bs-toast-box-shadow: var(--cx-shadow-lg);
  --bs-toast-font-size: var(--cx-fs-base);
}

.dropdown-menu {
  --bs-dropdown-font-size: var(--cx-fs-base);
  --bs-dropdown-border-color: var(--cx-slate-200);
  --bs-dropdown-border-radius: var(--cx-radius-lg);
  --bs-dropdown-box-shadow: var(--cx-shadow-md);
  --bs-dropdown-link-color: var(--cx-text);
  --bs-dropdown-link-hover-color: var(--cx-primary);
  --bs-dropdown-link-hover-bg: var(--cx-slate-50);
  --bs-dropdown-link-active-bg: var(--cx-primary);
}

/* =========================================================================
   5. Application shell (MainLayout)
   ========================================================================= */
.cx-shell {
  position: relative;
  min-height: 100vh;
  background-color: var(--cx-canvas);
}

/* Dims the page behind the open sidebar on small screens */
.cx-shell__backdrop {
  position: fixed;
  inset: 0;
  z-index: 1040;
  background-color: rgba(15, 23, 42, 0.3);
  backdrop-filter: blur(2px);
}

.cx-shell__viewport {
  padding-left: 0;
}

.cx-shell__content {
  width: 100%;
  min-height: 100vh;
  padding-top: var(--cx-topbar-height);
}

@media (min-width: 768px) {
  .cx-shell__backdrop {
    display: none;
  }

  .cx-shell__viewport {
    padding-left: var(--cx-sidebar-width);
  }
}

/* ---------- Sidebar ---------- */
.cx-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1050;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: var(--cx-sidebar-width);
  height: 100%;
  overflow-y: auto;
  border-right: 1px solid var(--cx-border);
  background-color: var(--cx-surface);
  box-shadow: var(--cx-shadow-sm);
  transform: translateX(-100%);
  transition: transform 0.2s ease;
}

.cx-sidebar--open {
  transform: translateX(0);
}

@media (min-width: 768px) {
  .cx-sidebar {
    transform: translateX(0);
  }
}

.cx-sidebar__brand {
  display: flex;
  align-items: center;
  height: var(--cx-topbar-height);
  padding: 0 var(--cx-space-4);
  border-bottom: 1px solid var(--cx-border);
}

.cx-sidebar__brand-link {
  display: flex;
  align-items: center;
  width: 100%;
}

.cx-sidebar__logo {
  width: auto;
  max-width: 170px;
  max-height: 2.75rem;
  object-fit: contain;
}

.cx-sidebar__section-title {
  display: block;
  padding: var(--cx-space-4) var(--cx-space-4) 0.375rem;
  font-size: var(--cx-fs-2xs);
  font-weight: 700;
  letter-spacing: var(--cx-tracking-wide);
  text-transform: uppercase;
  color: var(--cx-text-subtle);
}

.cx-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: var(--cx-space-1);
  padding: 0 var(--cx-space-3);
}

.cx-sidebar__footer {
  padding: var(--cx-space-3) var(--cx-space-4);
  border-top: 1px solid var(--cx-border);
  font-size: var(--cx-fs-xs);
  color: var(--cx-text-subtle);
}

/* ---------- Sidebar nav item ---------- */
.cx-nav-item {
  display: flex;
  align-items: center;
  gap: var(--cx-space-3);
  padding: 0.625rem 0.875rem;
  border-radius: var(--cx-radius);
  color: var(--cx-slate-600);
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.cx-nav-item:hover {
  background-color: var(--cx-slate-100);
  color: var(--cx-text-strong);
}

.cx-nav-item__icon {
  font-size: 18px;
  color: var(--cx-slate-500);
}

.cx-nav-item__text {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
}

.cx-nav-item__title {
  font-size: var(--cx-fs-base);
  font-weight: 600;
  line-height: 1.25;
  color: var(--cx-slate-800);
}

.cx-nav-item__subtitle {
  margin-top: 0.125rem;
  font-size: var(--cx-fs-2xs);
  line-height: 1.25;
  color: var(--cx-text-subtle);
}

/* "active" is set by Blazor's NavLink */
.cx-nav-item.active,
.cx-nav-item.active:hover {
  background-color: var(--cx-primary);
  color: #ffffff;
  box-shadow: var(--cx-shadow-primary);
}

.cx-nav-item.active .cx-nav-item__icon,
.cx-nav-item.active .cx-nav-item__title {
  color: #ffffff;
}

.cx-nav-item.active .cx-nav-item__subtitle {
  color: rgba(255, 255, 255, 0.75);
}

/* Subtitle row (optional badge + subtitle on one line) */
.cx-nav-item__meta {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  min-width: 0;
  margin-top: 0.125rem;
}

.cx-nav-item__meta .cx-nav-item__subtitle {
  min-width: 0;
  margin-top: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* "Soon" marker for modules not built yet */
.cx-nav-item__badge {
  flex-shrink: 0;
  padding: 0 0.3125rem;
  border: 1px solid var(--cx-slate-200);
  border-radius: var(--cx-radius-sm);
  background-color: var(--cx-slate-100);
  color: var(--cx-text-muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: var(--cx-tracking-wide);
  text-transform: uppercase;
}

.cx-nav-item.active .cx-nav-item__badge {
  border-color: transparent;
  background-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

/* ---------- Top bar ---------- */
.cx-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--cx-space-3);
  height: var(--cx-topbar-height);
  padding: 0 var(--cx-space-4);
  border-bottom: 1px solid var(--cx-border);
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  box-shadow: var(--cx-shadow-sm);
}

@media (min-width: 768px) {
  .cx-topbar {
    left: var(--cx-sidebar-width);
    padding: 0 var(--cx-space-6);
  }
}

.cx-topbar__start,
.cx-topbar__end {
  display: flex;
  align-items: center;
  gap: var(--cx-space-2);
  min-width: 0;
}

.cx-topbar__start {
  flex: 1 1 auto;
}

.cx-topbar__end {
  flex-shrink: 0;
  gap: var(--cx-space-3);
}

.cx-topbar__title {
  font-size: var(--cx-fs-md);
  font-weight: 700;
  color: var(--cx-text-strong);
  white-space: nowrap;
}

.cx-topbar__subtitle {
  font-size: var(--cx-fs-xs);
  color: var(--cx-text-subtle);
  white-space: nowrap;
}

/* ---------- Announcement ticker (top bar) ----------
   Active announcements in one line; scrolls in place only when wider than the strip
   (app.js adds cx-ticker--scroll). Pauses on hover / focus; no motion when reduced. */
.cx-ticker {
  display: flex;
  align-items: center;
  gap: var(--cx-space-2);
  flex: 1 1 auto;
  min-width: 0;
  max-width: 64rem;
  height: 2.5rem;
  padding: 0 var(--cx-space-1);
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius-lg);
  background-color: var(--cx-surface);
}

.cx-ticker__icon {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--cx-radius);
  background-color: var(--cx-primary);
  color: #ffffff;
  font-size: 14px;
  text-decoration: none;
}

.cx-ticker__icon:hover {
  color: #ffffff;
  filter: brightness(1.08);
}

.cx-ticker__viewport {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.cx-ticker--scroll .cx-ticker__viewport {
  mask-image: linear-gradient(to right, transparent, #000 1.25rem, #000 calc(100% - 1.25rem), transparent);
}

.cx-ticker__track {
  display: flex;
  width: max-content;
}

.cx-ticker__group {
  display: flex;
  align-items: center;
  gap: var(--cx-space-6);
  padding-right: var(--cx-space-6);
  white-space: nowrap;
}

.cx-ticker__group--clone {
  display: none;
}

.cx-ticker--scroll .cx-ticker__group--clone {
  display: flex;
}

.cx-ticker--scroll .cx-ticker__track {
  animation: cx-ticker var(--cx-ticker-duration, 30s) linear infinite;
}

.cx-ticker:hover .cx-ticker__track,
.cx-ticker:focus-within .cx-ticker__track {
  animation-play-state: paused;
}

@keyframes cx-ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .cx-ticker--scroll .cx-ticker__track {
    animation: none;
  }

  .cx-ticker__viewport {
    overflow-x: auto;
  }
}

.cx-ticker__item {
  display: inline-flex;
  align-items: center;
  gap: var(--cx-space-2);
  color: var(--cx-text);
  font-size: var(--cx-fs-sm);
  text-decoration: none;
}

.cx-ticker__item:hover .cx-ticker__title {
  color: var(--cx-primary);
}

.cx-ticker__item::before {
  content: "";
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background-color: var(--cx-primary);
}

.cx-ticker__badge {
  padding: 0.0625rem 0.5rem;
  border-radius: var(--cx-radius-pill);
  border: 1px solid var(--bs-warning-border-subtle);
  background-color: var(--bs-warning-bg-subtle);
  color: var(--bs-warning-text-emphasis);
  font-size: var(--cx-fs-2xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.cx-ticker__title {
  color: var(--cx-text-strong);
  font-weight: 600;
}

.cx-ticker__text {
  color: var(--cx-text-subtle);
}

.cx-ticker__empty {
  color: var(--cx-text-subtle);
  font-size: var(--cx-fs-sm);
  white-space: nowrap;
}

/* ---------- Icon link with optional count badge (notification bell) ---------- */
.cx-icon-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--cx-radius);
  color: var(--cx-slate-600);
  font-size: 18px;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.cx-icon-link:hover,
.cx-icon-link.active {
  background-color: var(--cx-slate-100);
  color: var(--cx-primary);
}

.cx-icon-link__badge {
  position: absolute;
  top: 0.25rem;
  right: 0.125rem;
  min-width: 1.125rem;
  padding: 0 0.25rem;
  border: 2px solid #ffffff;
  border-radius: var(--cx-radius-pill);
  background-color: var(--cx-crimson);
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1rem;
  text-align: center;
}

/* ---------- Avatar (initials) ---------- */
.cx-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background-color: var(--cx-primary);
  color: #ffffff;
  font-size: var(--cx-fs-sm);
  font-weight: 700;
  box-shadow: var(--cx-shadow-xs);
}

.cx-avatar--sm {
  width: 1.75rem;
  height: 1.75rem;
  font-size: var(--cx-fs-2xs);
}

/* ---------- Profile pill + menu ---------- */
.cx-profile {
  position: relative;
}

.cx-profile__trigger {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: var(--cx-space-1);
  border: 0;
  border-radius: var(--cx-radius);
  background: transparent;
  cursor: pointer;
}

.cx-profile__trigger:hover {
  background-color: var(--cx-slate-50);
}

.cx-profile__info {
  display: none;
  flex-direction: column;
  text-align: right;
}

@media (min-width: 576px) {
  .cx-profile__info {
    display: flex;
  }
}

.cx-profile__name {
  font-size: var(--cx-fs-base);
  font-weight: 600;
  line-height: 1.25;
  color: var(--cx-text-strong);
  white-space: nowrap;
}

.cx-profile__meta {
  font-size: var(--cx-fs-xs);
  line-height: 1.25;
  color: var(--cx-text-subtle);
}

.cx-profile-menu {
  position: absolute;
  right: 0;
  z-index: 1050;
  width: 14rem;
  margin-top: var(--cx-space-2);
  padding: 0.375rem 0;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: var(--cx-radius-lg);
  background-color: var(--cx-surface);
  box-shadow: var(--cx-shadow-lg);
  animation: cx-pop-in 0.1s ease-out;
}

.cx-profile-menu__header {
  padding: 0.625rem var(--cx-space-4);
}

.cx-profile-menu__name {
  font-size: var(--cx-fs-base);
  font-weight: 700;
  color: var(--cx-text-strong);
}

.cx-profile-menu__meta {
  margin-top: 0.125rem;
  font-size: var(--cx-fs-xs);
  color: var(--cx-text-subtle);
}

.cx-profile-menu__section {
  padding: var(--cx-space-1) 0;
  border-top: 1px solid var(--cx-slate-100);
}

.cx-profile-menu__item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  padding: var(--cx-space-2) var(--cx-space-4);
  border: 0;
  background: transparent;
  color: var(--cx-slate-700);
  font-size: var(--cx-fs-sm);
  text-align: left;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.cx-profile-menu__item:hover {
  background-color: var(--cx-slate-50);
}

.cx-profile-menu__item--danger {
  color: var(--cx-crimson);
  font-weight: 500;
}

.cx-profile-menu__item--danger:hover {
  background-color: #fef2f2;
}

/* Full-viewport transparent layer that closes popovers when clicked */
.cx-click-away {
  position: fixed;
  inset: 0;
  z-index: 1045;
}

/* ---------- Page container ---------- */
/* Full width with the same spacing on every side (owner request 2026-11-15). */
.cx-page {
  display: flex;
  flex-direction: column;
  gap: var(--cx-space-4);
  padding: var(--cx-space-4);
}

@media (min-width: 768px) {
  .cx-page {
    gap: var(--cx-space-5);
    padding: 2rem;
  }
}

/* =========================================================================
   6. Page building blocks
   ========================================================================= */

/* ---------- Card (lighter than Bootstrap .card) ---------- */
.cx-card {
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius-lg);
  background-color: var(--cx-surface);
  box-shadow: var(--cx-shadow-xs);
}

.cx-card--padded {
  padding: var(--cx-space-4);
}

/* ---------- Page header (title, subtitle, primary action) ---------- */
.cx-page-header {
  display: flex;
  flex-direction: column;
  gap: var(--cx-space-3);
}

@media (min-width: 576px) {
  .cx-page-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.cx-page-header__title {
  font-size: var(--cx-fs-xl);
  font-weight: 700;
  letter-spacing: var(--cx-tracking-tight);
  color: var(--cx-text-strong);
}

.cx-page-header__subtitle {
  margin-top: 0.125rem;
  font-size: var(--cx-fs-base);
  color: var(--cx-text-muted);
}

.cx-page-header__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--cx-space-2);
}

/* ---------- Filter toolbar ---------- */
.cx-toolbar {
  padding: var(--cx-space-4);
}

/* Search box: icon + input in one bordered control */
.cx-search-group .input-group-text {
  padding-left: 0.75rem;
  padding-right: 0.5rem;
  border-color: var(--cx-border-strong);
  border-right: 0;
  background-color: #ffffff;
  color: var(--cx-text-subtle);
}

.cx-search-group .form-control {
  padding-left: 0.25rem;
  border-left: 0;
}

.cx-search-group .form-control:focus {
  box-shadow: none;
}

.cx-search-group:focus-within {
  border-radius: var(--cx-radius-sm);
  box-shadow: var(--cx-focus-ring);
}

.cx-search-group:focus-within .input-group-text,
.cx-search-group:focus-within .form-control {
  border-color: var(--cx-primary);
}

/* Record count, e.g. "Total: 12" */
.cx-total-badge {
  display: inline-flex;
  align-items: center;
  min-height: 2.6rem;
  padding: 0 1rem;
  border: 1px solid var(--cx-slate-200);
  border-radius: var(--cx-radius);
  background-color: var(--cx-slate-50);
  color: var(--cx-text-muted);
  font-size: var(--cx-fs-sm);
  font-weight: 500;
  white-space: nowrap;
}

.cx-total-badge strong {
  margin-left: 0.25rem;
  color: var(--cx-text-strong);
}

/* ---------- Table card ---------- */
.cx-table-card {
  overflow: hidden;
}

.cx-table-card .table > :not(caption) > * > *:first-child {
  padding-left: var(--cx-space-4);
}

.cx-table-card .table > :not(caption) > * > *:last-child {
  padding-right: var(--cx-space-4);
}

/* Loading / empty row */
.cx-table-card__state {
  padding: 2.5rem var(--cx-space-4) !important;
  text-align: center;
  color: var(--cx-text-muted) !important;
}

.cx-table__primary {
  font-weight: 600;
  color: var(--cx-text-strong);
}

.cx-table__secondary {
  font-size: var(--cx-fs-xs);
  color: var(--cx-text-subtle);
}

.cx-table__muted {
  font-size: var(--cx-fs-sm);
  color: var(--cx-text-muted);
  white-space: nowrap;
}

/* ---------- Pager (table footer) ---------- */
.cx-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--cx-space-2);
  padding: 0.75rem var(--cx-space-4);
  border-top: 1px solid var(--cx-slate-100);
  font-size: var(--cx-fs-sm);
  color: var(--cx-text-muted);
}

/* =========================================================================
   7. Status and labels
   ========================================================================= */

/* ---------- Status pill (Active / Inactive) ---------- */
.cx-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border: 1px solid var(--cx-slate-200);
  border-radius: var(--cx-radius-pill);
  background-color: var(--cx-slate-100);
  color: var(--cx-text-muted);
  font-size: var(--cx-fs-xs);
  font-weight: 600;
  white-space: nowrap;
}

.cx-status-pill::before {
  content: "";
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background-color: currentColor;
}

.cx-status-pill--active {
  border-color: var(--bs-success-border-subtle);
  background-color: var(--bs-success-bg-subtle);
  color: var(--bs-success-text-emphasis);
}

.cx-status-pill--warning {
  border-color: var(--bs-warning-border-subtle);
  background-color: var(--bs-warning-bg-subtle);
  color: var(--bs-warning-text-emphasis);
}

.cx-status-pill--danger {
  border-color: var(--bs-danger-border-subtle);
  background-color: var(--bs-danger-bg-subtle);
  color: var(--bs-danger-text-emphasis);
}

.cx-status-pill--info {
  border-color: var(--cx-primary-border);
  background-color: var(--cx-primary-soft);
  color: var(--cx-primary-dark);
}

/* ---------- Tag (small inline label) ---------- */
.cx-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.125rem 0.5rem;
  border: 1px solid var(--cx-slate-200);
  border-radius: var(--cx-radius-pill);
  background-color: var(--cx-slate-100);
  color: var(--cx-slate-600);
  font-size: var(--cx-fs-2xs);
  font-weight: 700;
  white-space: nowrap;
}

.cx-tag--accent {
  border-color: var(--cx-accent-border, var(--cx-primary-border));
  background-color: var(--cx-accent-soft, var(--cx-primary-soft));
  color: var(--cx-accent, var(--cx-primary));
}

.cx-tag--success {
  border-color: #a7f3d0;
  background-color: #ecfdf5;
  color: #047857;
}

.cx-tag--warning {
  border-color: #fdd3ad;
  background-color: var(--cx-orange-soft);
  color: var(--cx-orange-dark);
}

/* ---------- Delta / trend chip ---------- */
.cx-delta {
  display: inline-flex;
  align-items: center;
  gap: 0.125rem;
  padding: 0.125rem 0.375rem;
  border-radius: var(--cx-radius-sm);
  background-color: var(--cx-slate-100);
  color: var(--cx-slate-600);
  font-size: var(--cx-fs-xs);
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.cx-delta--up { background-color: #ecfdf5; color: #047857; }
.cx-delta--down { background-color: #fef2f2; color: var(--cx-crimson); }
.cx-delta--warning { background-color: var(--cx-orange-soft); color: var(--cx-orange-dark); }

/* ---------- Status dot ---------- */
.cx-dot {
  display: inline-block;
  flex-shrink: 0;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background-color: var(--cx-slate-400);
}

.cx-dot--success { background-color: var(--cx-emerald); }
.cx-dot--warning { background-color: var(--cx-orange); }
.cx-dot--danger { background-color: var(--cx-crimson); }

/* =========================================================================
   8. Dashboard
   ========================================================================= */

/* ---------- Accent palette ----------
   Put on a component (or ancestor). Components read --cx-accent,
   --cx-accent-soft and --cx-accent-border. */
.cx-accent-primary { --cx-accent: var(--cx-primary); --cx-accent-soft: var(--cx-primary-soft); --cx-accent-border: var(--cx-primary-border); }
.cx-accent-orange { --cx-accent: var(--cx-orange); --cx-accent-soft: var(--cx-orange-soft); --cx-accent-border: #fdd3ad; }
.cx-accent-emerald { --cx-accent: #059669; --cx-accent-soft: #ecfdf5; --cx-accent-border: #a7f3d0; }
.cx-accent-crimson { --cx-accent: #e32119; --cx-accent-soft: #fef2f2; --cx-accent-border: #fecaca; }
.cx-accent-sky { --cx-accent: #0284c7; --cx-accent-soft: #f0f9ff; --cx-accent-border: #bae6fd; }
.cx-accent-violet { --cx-accent: #7c3aed; --cx-accent-soft: #faf5ff; --cx-accent-border: #e9d5ff; }
.cx-accent-amber { --cx-accent: #f59e0b; --cx-accent-soft: #fffbeb; --cx-accent-border: #fde68a; }
.cx-accent-rose { --cx-accent: #f43f5e; --cx-accent-soft: #fff1f2; --cx-accent-border: #fecdd3; }

/* ---------- KPI card (coloured top bar, label, icon, value, footer) ---------- */
.cx-kpi {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  padding: 1rem 1rem 0.875rem;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cx-kpi::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 0.25rem;
  background-color: var(--cx-accent, var(--cx-primary));
}

.cx-kpi__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--cx-space-2);
  margin-bottom: var(--cx-space-2);
}

.cx-kpi__label {
  font-size: var(--cx-fs-xs);
  font-weight: 700;
  letter-spacing: var(--cx-tracking-wide);
  text-transform: uppercase;
  color: var(--cx-text-muted);
}

.cx-kpi__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--cx-radius);
  background-color: var(--cx-accent-soft, var(--cx-primary-soft));
  color: var(--cx-accent, var(--cx-primary));
  font-size: 16px;
}

.cx-kpi__value {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--cx-text-strong);
  font-variant-numeric: tabular-nums;
}

@media (min-width: 768px) {
  .cx-kpi__value {
    font-size: var(--cx-fs-3xl);
  }
}

.cx-kpi__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  margin-top: var(--cx-space-2);
}

.cx-kpi__note {
  font-size: var(--cx-fs-sm);
  font-weight: 500;
  color: var(--cx-text-subtle);
}

/* Clickable card (wrap in <a> or add to a button) */
.cx-kpi--interactive {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.cx-kpi--interactive:hover {
  border-color: color-mix(in srgb, var(--cx-accent, var(--cx-primary)) 50%, transparent);
  box-shadow: var(--cx-shadow-md);
}

/* ---------- Icon badge (solid accent tile with white icon) ---------- */
.cx-icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--cx-radius-lg);
  background-color: var(--cx-accent, var(--cx-primary));
  color: #ffffff;
  font-size: 18px;
  box-shadow: var(--cx-shadow-xs);
}

.cx-icon-badge--sm {
  width: 2rem;
  height: 2rem;
  border-radius: var(--cx-radius);
  font-size: 15px;
}

/* ---------- Section card (titled dashboard panel) ---------- */
.cx-section {
  display: flex;
  flex-direction: column;
  gap: var(--cx-space-3);
  height: 100%;
  padding: 1rem;
}

.cx-section__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--cx-space-3);
  padding-bottom: var(--cx-space-3);
  border-bottom: 1px solid var(--cx-slate-100);
}

.cx-section__heading {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
}

.cx-section__title {
  font-size: var(--cx-fs-lg);
  font-weight: 700;
  line-height: 1.25;
  color: var(--cx-text-strong);
}

.cx-section__subtitle {
  margin-top: 0.125rem;
  font-size: var(--cx-fs-sm);
  color: var(--cx-text-subtle);
}

/* =========================================================================
   9. Row actions and empty states
   ========================================================================= */
.cx-row-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--cx-space-1);
}

/* Small square icon button inside table rows */
.cx-row-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--cx-slate-200);
  border-radius: var(--cx-radius-sm);
  background-color: var(--cx-slate-50);
  color: var(--cx-primary);
  font-size: 14px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.cx-row-action:hover {
  border-color: var(--cx-slate-300);
  background-color: var(--cx-slate-100);
}

.cx-row-action:focus-visible {
  outline: 0;
  box-shadow: var(--cx-focus-ring);
}

.cx-row-action--warning { color: var(--cx-orange-dark); }
.cx-row-action--danger { color: var(--cx-crimson); }

/* ---------- Placeholder panel (empty state, access denied) ---------- */
.cx-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--cx-space-4);
  padding: 2.5rem;
  text-align: center;
}

@media (min-width: 768px) {
  .cx-placeholder {
    padding: 3.5rem;
  }
}

.cx-placeholder__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  border: 1px solid var(--cx-accent-border, var(--cx-primary-border));
  border-radius: var(--cx-radius-xl);
  background-color: var(--cx-accent-soft, var(--cx-primary-soft));
  color: var(--cx-accent, var(--cx-primary));
  font-size: 28px;
}

.cx-placeholder__title {
  font-size: var(--cx-fs-xl);
  font-weight: 700;
  color: var(--cx-text-strong);
}

.cx-placeholder__text {
  max-width: 28rem;
  font-size: var(--cx-fs-base);
  line-height: 1.625;
  color: var(--cx-text-muted);
}

/* ---------- Inline loading indicator ---------- */
.cx-loading-inline {
  display: inline-flex;
  align-items: center;
  gap: var(--cx-space-2);
  color: var(--cx-text-muted);
  font-size: var(--cx-fs-base);
}

.cx-loading-inline .spinner-border {
  color: var(--cx-primary);
}

/* ---------- Detail list (label / value pairs, e.g. profile) ---------- */
.cx-detail-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--cx-space-4) var(--cx-space-6);
  margin: 0;
}

@media (min-width: 768px) {
  .cx-detail-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.cx-detail-list dt {
  margin-bottom: 0.125rem;
  font-size: var(--cx-fs-2xs);
  font-weight: 700;
  letter-spacing: var(--cx-tracking-wide);
  text-transform: uppercase;
  color: var(--cx-text-subtle);
}

.cx-detail-list__wide {
  grid-column: 1 / -1;
}

/* Always one column (narrow side panels) */
.cx-detail-list--single {
  grid-template-columns: 1fr !important;
}

/* Keep line breaks of multi-line text (addresses) */
.cx-pre-line {
  white-space: pre-line;
}

.cx-detail-list dd {
  margin: 0;
  font-size: var(--cx-fs-md);
  color: var(--cx-text-strong);
  word-break: break-word;
}

/* ---------- Choice list (checkbox options, e.g. module assignment) ---------- */
.cx-choice-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--cx-space-2);
}

@media (min-width: 576px) {
  .cx-choice-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.cx-choice {
  display: flex;
  align-items: flex-start;
  gap: var(--cx-space-2);
  margin: 0;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--cx-slate-200);
  border-radius: var(--cx-radius);
  background-color: #ffffff;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.cx-choice:hover {
  border-color: var(--cx-slate-300);
}

.cx-choice:has(.form-check-input:checked) {
  border-color: var(--cx-primary-border);
  background-color: var(--cx-primary-soft);
}

.cx-choice .form-check-input {
  flex-shrink: 0;
  margin: 0.125rem 0 0;
}

.cx-choice__title {
  font-size: var(--cx-fs-base);
  font-weight: 600;
  color: var(--cx-text-strong);
}

.cx-choice__text {
  font-size: var(--cx-fs-xs);
  color: var(--cx-text-muted);
}

/* Section heading inside a form or dialog */
.cx-form-section-title {
  margin: var(--cx-space-2) 0 var(--cx-space-1);
  padding-top: var(--cx-space-3);
  border-top: 1px solid var(--cx-slate-100);
  font-size: var(--cx-fs-md);
  font-weight: 700;
  color: var(--cx-text-strong);
}

/* ---------- Tabs (section sub-navigation, uses NavLink "active") ---------- */
.cx-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  padding: 0.375rem;
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius-lg);
  background-color: var(--cx-surface);
  box-shadow: var(--cx-shadow-xs);
}

.cx-tabs__item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4375rem 0.875rem;
  border-radius: var(--cx-radius);
  color: var(--cx-slate-600);
  font-size: var(--cx-fs-base);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.cx-tabs__item:hover {
  background-color: var(--cx-slate-100);
  color: var(--cx-text-strong);
}

.cx-tabs__item.active,
.cx-tabs__item.active:hover {
  background-color: var(--cx-primary);
  color: #ffffff;
  box-shadow: var(--cx-shadow-primary);
}

.cx-tabs__badge {
  min-width: 1.25rem;
  padding: 0 0.375rem;
  border-radius: var(--cx-radius-pill);
  background-color: var(--cx-crimson);
  color: #ffffff;
  font-size: var(--cx-fs-2xs);
  font-weight: 700;
  line-height: 1.25rem;
  text-align: center;
}

/* ---------- Period picker (previous / label / next) ---------- */
.cx-period {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.cx-period__label {
  min-width: 9rem;
  font-weight: 600;
  text-align: center;
  color: var(--cx-text-strong);
}

.cx-period__label--sm {
  min-width: 4.5rem;
}

/* ---------- Today's attendance card ---------- */
.cx-today {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--cx-space-4);
  padding: var(--cx-space-4) var(--cx-space-5);
}

.cx-today__times {
  display: flex;
  flex-wrap: wrap;
  gap: var(--cx-space-6);
}

.cx-today__time-label {
  font-size: var(--cx-fs-2xs);
  font-weight: 700;
  letter-spacing: var(--cx-tracking-wide);
  text-transform: uppercase;
  color: var(--cx-text-subtle);
}

.cx-today__time-value {
  font-size: var(--cx-fs-xl);
  font-weight: 700;
  color: var(--cx-text-strong);
  font-variant-numeric: tabular-nums;
}

/* Muted table row (weekly off / holiday / not applicable) */
.cx-row-muted > td {
  background-color: var(--cx-slate-50) !important;
  color: var(--cx-text-muted);
}

/* Small KPI tiles in a row (summary counts) */
.cx-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: var(--cx-space-3);
}

.cx-stat-grid--wide {
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
}

.cx-stat {
  position: relative;
  overflow: hidden;
  padding: 0.75rem 0.875rem;
}

.cx-stat::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
  background-color: var(--cx-accent, var(--cx-primary));
}

.cx-stat__label {
  font-size: var(--cx-fs-2xs);
  font-weight: 700;
  letter-spacing: var(--cx-tracking-wide);
  text-transform: uppercase;
  color: var(--cx-text-muted);
}

.cx-stat__value {
  font-size: var(--cx-fs-2xl);
  font-weight: 700;
  color: var(--cx-text-strong);
  font-variant-numeric: tabular-nums;
}

button.cx-stat {
  width: 100%;
  border: 1px solid var(--cx-border);
  text-align: left;
  cursor: pointer;
}

button.cx-stat:hover,
.cx-stat--selected {
  border-color: var(--cx-accent, var(--cx-primary)) !important;
  box-shadow: var(--cx-shadow-md);
}

/* Scrollable choice list (long lists of people) */
.cx-choice-list--scroll {
  max-height: 16rem;
  overflow-y: auto;
  padding-right: 0.25rem;
}

/* ---------- Announcement ---------- */
.cx-announcement {
  display: flex;
  flex-direction: column;
  gap: var(--cx-space-2);
  padding: var(--cx-space-4) var(--cx-space-5);
  border-left: 4px solid var(--cx-primary-border);
}

.cx-announcement--important {
  border-left-color: var(--cx-orange);
  background-color: #fffdf9;
}

.cx-announcement__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--cx-space-2);
}

.cx-announcement__title {
  font-size: var(--cx-fs-lg);
  font-weight: 700;
  color: var(--cx-text-strong);
}

.cx-announcement__body {
  font-size: var(--cx-fs-md);
  line-height: 1.6;
  color: var(--cx-text);
  overflow-wrap: anywhere;
}

/* Dashboard: show the first lines only */
.cx-announcement__body--compact {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cx-announcement__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--cx-space-1) var(--cx-space-4);
  font-size: var(--cx-fs-xs);
  color: var(--cx-text-subtle);
}

/* =========================================================================
   10. Dialogs and toasts
   ========================================================================= */

/* Blazor-rendered modal: the .modal element is its own blurred backdrop */
.cx-dialog {
  display: block;
  z-index: 1055;
  background: rgba(7, 10, 19, 0.55);
  backdrop-filter: blur(4px);
  animation: cx-fade-in 0.15s ease-out;
}

.cx-dialog .modal-dialog {
  animation: cx-slide-up 0.22s var(--cx-ease);
}

/* Round icon at the top of confirmation dialogs */
.cx-dialog__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background-color: var(--cx-primary-soft);
  color: var(--cx-primary);
  font-size: 18px;
}

.cx-dialog__icon--danger {
  background-color: var(--bs-danger-bg-subtle);
  color: var(--cx-crimson);
}

.cx-dialog__icon--success {
  background-color: var(--bs-success-bg-subtle);
  color: var(--bs-success);
}

.cx-dialog__message {
  font-size: var(--cx-fs-base);
  line-height: 1.6;
  color: var(--cx-text-muted);
}

/* One-time secret (generated password) */
.cx-secret {
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--cx-slate-200);
  border-radius: var(--cx-radius);
  background-color: var(--cx-slate-50);
  color: var(--cx-text-strong);
  font-family: var(--bs-font-monospace);
  font-size: var(--cx-fs-md);
  font-weight: 700;
  user-select: all;
  word-break: break-all;
}

/* ---------- Toasts ---------- */
.cx-toast-stack {
  z-index: 2100;
}

.cx-toast {
  position: relative;
  min-width: 280px;
  margin-bottom: var(--cx-space-2);
  overflow: hidden;
  border: 1px solid var(--cx-slate-200);
  border-left: 4px solid var(--cx-accent, var(--cx-primary));
}

.cx-toast__body {
  display: flex;
  align-items: flex-start;
  gap: var(--cx-space-3);
  padding: 0.75rem 0.875rem;
}

.cx-toast__icon {
  font-size: 18px;
  color: var(--cx-accent, var(--cx-primary));
}

.cx-toast__text {
  flex: 1;
  padding-top: 0.0625rem;
  color: var(--cx-text-strong);
}

.cx-toast__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background-color: var(--cx-accent, var(--cx-primary));
  animation: cx-progress-shrink 5s linear forwards;
}

/* =========================================================================
   11. Sign-in screen (AuthLayout / Login)
   ========================================================================= */
.cx-auth {
  display: flex;
  min-height: 100vh;
  background-color: var(--cx-surface);
}

/* Left: brand panel (hidden on small screens) */
.cx-auth__brand {
  position: relative;
  display: none;
  flex: 0 0 60%;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: 4rem 4.5rem;
  background:
    radial-gradient(80% 70% at 100% 15%, rgba(255, 255, 255, 0.16), transparent 60%),
    radial-gradient(60% 50% at 0% 100%, rgba(245, 130, 32, 0.12), transparent 70%),
    linear-gradient(150deg, var(--cx-primary-deep) 0%, #1c1a86 45%, #262a8a 75%, #3b4596 100%);
  color: #ffffff;
}

/* Decorative curved sweep on the right edge */
.cx-auth__brand::after {
  content: "";
  position: absolute;
  top: -20%;
  right: -38%;
  width: 70%;
  height: 140%;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.02));
  pointer-events: none;
}

@media (min-width: 992px) {
  .cx-auth__brand {
    display: flex;
  }
}

.cx-auth__brand > * {
  position: relative;
  z-index: 1;
}

.cx-auth__brand-name {
  font-size: 4.25rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  color: rgba(255, 255, 255, 0.92);
}

.cx-auth__brand-name span {
  color: var(--cx-orange);
}

.cx-auth__brand-tagline {
  margin-top: 0.5rem;
  font-size: var(--cx-fs-sm);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.6);
}

.cx-auth__headline {
  max-width: 34rem;
  margin-top: 2.5rem;
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.85);
}

.cx-auth__features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 9.5rem));
  gap: 2rem 2.5rem;
  margin-top: 2.75rem;
}

.cx-auth__feature {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cx-auth__feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: var(--cx-radius-xl);
  background-color: var(--cx-accent, var(--cx-primary));
  color: #ffffff;
  font-size: 24px;
  box-shadow: 0 8px 18px -6px rgba(0, 0, 0, 0.45);
}

.cx-auth__feature-label {
  font-size: var(--cx-fs-md);
  font-weight: 500;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.7);
}

/* Right: form panel */
.cx-auth__panel {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
}

.cx-auth__form {
  width: 100%;
  max-width: 32rem;
}

.cx-auth__logo {
  display: block;
  width: auto;
  max-width: 260px;
  height: 4.5rem;
  margin: 0 auto 2.25rem;
  object-fit: contain;
}

.cx-auth__title {
  margin-bottom: 0.25rem;
  font-size: var(--cx-fs-2xl);
  font-weight: 700;
  color: var(--cx-text-heading);
}

.cx-auth__subtitle {
  margin-bottom: 1.5rem;
  font-size: var(--cx-fs-base);
  color: var(--cx-text-muted);
}

/* Sign-in labels are sentence case, inputs taller */
.cx-auth .form-label {
  font-size: var(--cx-fs-sm);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--cx-text-strong);
}

.cx-auth .form-control {
  min-height: 3rem;
  font-size: var(--cx-fs-md);
}

.cx-auth__submit {
  width: 100%;
  min-height: 3rem;
  margin-top: var(--cx-space-3);
  border-radius: var(--cx-radius-sm);
  font-size: var(--cx-fs-md);
}

.cx-auth__footer {
  margin-top: 2rem;
  font-size: var(--cx-fs-xs);
  text-align: center;
  color: var(--cx-text-subtle);
}

/* Simple centred card for static pages (error) */
.cx-auth-card {
  width: 100%;
  max-width: 28rem;
  margin: auto;
}

/* =========================================================================
   12. Utilities (cx- prefix, Bootstrap-style naming)
   ========================================================================= */
.cx-fs-2xs { font-size: var(--cx-fs-2xs) !important; }
.cx-fs-xs { font-size: var(--cx-fs-xs) !important; }
.cx-fs-sm { font-size: var(--cx-fs-sm) !important; }
.cx-fs-base { font-size: var(--cx-fs-base) !important; }
.cx-fs-md { font-size: var(--cx-fs-md) !important; }
.cx-fs-lg { font-size: var(--cx-fs-lg) !important; }
.cx-fs-xl { font-size: var(--cx-fs-xl) !important; }
.cx-fs-2xl { font-size: var(--cx-fs-2xl) !important; }
.cx-fs-3xl { font-size: var(--cx-fs-3xl) !important; }

.cx-tracking-tight { letter-spacing: var(--cx-tracking-tight) !important; }
.cx-tracking-wide { letter-spacing: var(--cx-tracking-wide) !important; }

.cx-tabular-nums {
  font-variant-numeric: tabular-nums;
}

.cx-text-primary { color: var(--cx-primary) !important; }
.cx-text-orange { color: var(--cx-orange) !important; }

.cx-cursor-pointer { cursor: pointer !important; }
.cx-whitespace-nowrap { white-space: nowrap !important; }

/* ---------- Shared animations ---------- */
@keyframes cx-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes cx-slide-up {
  from { transform: translateY(12px) scale(0.97); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes cx-pop-in {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes cx-progress-shrink {
  from { width: 100%; }
  to { width: 0%; }
}

@media (prefers-reduced-motion: reduce) {
  .cx-dialog,
  .cx-dialog .modal-dialog,
  .cx-profile-menu {
    animation: none;
  }
}

/* =========================================================================
   13. Blazor framework hooks
   ========================================================================= */

/* Blazor marks fields "invalid" after validation; show Bootstrap's invalid border */
.form-control.invalid,
.form-select.invalid {
  border-color: var(--cx-crimson);
}

.form-control.invalid:focus,
.form-select.invalid:focus {
  box-shadow: 0 0 0 3px rgba(227, 33, 25, 0.12);
}

.validation-message {
  margin-top: 0.25rem;
  font-size: var(--cx-fs-sm);
  color: var(--cx-crimson);
}

#blazor-error-ui {
  display: none;
}

.blazor-error-boundary {
  padding: 1rem;
  background: #b32121;
  color: #ffffff;
}

.blazor-error-boundary::after {
  content: "An error has occurred.";
}
