/* MatDash vendor override — physical left/right in this file only (see UI_CONTRACT). */
@import url("tokens.css");
@import url("fonts.css");
@import url("panel-enhancements.css");
@import url("panel-responsive.css");
@import url("panel-sidebar.css");

:root,
[data-bs-theme="light"],
[data-bs-theme="dark"] {
  --bs-body-font-family: var(--cf-font-family);
  --bs-font-sans-serif: var(--cf-font-family);
}

html,
body,
input,
button,
select,
textarea,
.table,
.card,
.modal,
.toast,
.apexcharts-canvas {
  font-family: var(--cf-font-family) !important;
}

html {
  font-variant-numeric: normal;
  scrollbar-gutter: stable;
}

body {
  font-feature-settings: "ss02" on;
}

/* Bootstrap muted text: meet contrast on light cards (axe ui-check). */
.text-muted,
.text-secondary {
  color: var(--cf-color-muted) !important;
}

.text-success {
  color: var(--bs-success) !important;
}

.badge.bg-success {
  background-color: var(--bs-success) !important;
  color: var(--cf-color-white) !important;
}

.btn-success {
  --bs-btn-color: var(--cf-color-white);
  --bs-btn-bg: var(--bs-success);
  --bs-btn-border-color: var(--bs-success);
  --bs-btn-hover-color: var(--cf-color-white);
  --bs-btn-hover-bg: color-mix(in srgb, var(--bs-success) 88%, var(--cf-color-black));
  --bs-btn-hover-border-color: color-mix(in srgb, var(--bs-success) 88%, var(--cf-color-black));
}

.btn.btn-success {
  background-color: var(--bs-success) !important;
  border-color: var(--bs-success) !important;
  color: var(--cf-color-white) !important;
}

[data-bs-theme="dark"] .text-muted,
[data-bs-theme="dark"] .text-secondary {
  color: var(--cf-color-muted) !important;
}

html[data-bs-theme="dark"] .body-wrapper {
  background-color: var(--cf-color-bg);
}

html[data-bs-theme="dark"] .cf-page-shell .text-muted {
  color: var(--cf-color-muted) !important;
}

[data-bs-theme="dark"] .text-success {
  color: var(--cf-color-success-emphasis) !important;
}

[data-bs-theme="dark"] .btn-outline-primary {
  --bs-btn-color: var(--cf-btn-outline-primary-fg);
  --bs-btn-border-color: var(--cf-btn-outline-primary-fg);
  --bs-btn-hover-bg: color-mix(in srgb, var(--cf-btn-outline-primary-fg) 18%, transparent);
  --bs-btn-hover-color: var(--cf-color-white);
}

[data-bs-theme="dark"] .card {
  background-color: var(--cf-color-surface) !important;
  color: var(--cf-color-text);
}

.cf-dashboard-profile,
.cf-profile-preview,
.cf-stat-card,
.cf-dashboard-panel {
  background-color: var(--bs-card-bg) !important;
  color: var(--bs-card-color);
}

.cf-dashboard-panel {
  border: 0;
  border-radius: 1rem;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--cf-color-accent-purple) 8%, transparent);
}

.cf-dashboard-panel-title {
  font-weight: 700;
  color: var(--bs-body-color);
}

.cf-dashboard-snapshot-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.55rem;
  border-block-end: 1px solid var(--bs-border-color);
}

.cf-dashboard-snapshot-row:last-child {
  border-block-end: 0;
}

.cf-dashboard-snapshot-row dt {
  margin: 0;
  font-weight: 500;
  color: var(--cf-color-muted);
  font-size: 0.875rem;
}

.cf-dashboard-snapshot-row dd {
  margin: 0;
  text-align: end;
}

.cf-dashboard-snapshot-value {
  font-weight: 700;
  font-size: 1.05rem;
}

.cf-dashboard-activity-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding-block: 0.65rem;
  border-block-end: 1px solid var(--bs-border-color);
}

.cf-dashboard-activity-item:last-child {
  border-block-end: 0;
}

.cf-dashboard-activity-icon {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--bs-primary) 12%, transparent);
  color: var(--bs-primary);
}

.cf-dashboard-activity-action {
  font-weight: 600;
  font-size: 0.9rem;
}

.cf-dashboard-activity-sep {
  margin-inline: 0.35rem;
  opacity: 0.65;
}

.cf-dashboard-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.65rem;
  border-radius: 0.75rem;
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.cf-dashboard-link:hover {
  background: color-mix(in srgb, var(--bs-primary) 8%, transparent);
  border-color: color-mix(in srgb, var(--bs-primary) 18%, transparent);
}

.cf-dashboard-link-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--bs-primary) 10%, transparent);
  color: var(--bs-primary);
}

.cf-dashboard-link-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.cf-dashboard-link-label {
  font-weight: 600;
}

.cf-dashboard-link-chevron {
  opacity: 0.45;
  font-size: 0.95rem;
}

.cf-dashboard-lead {
  font-size: 0.925rem;
  line-height: 1.55;
  max-inline-size: 42rem;
}

.cf-dashboard-metrics .cf-stat-card {
  border: 1px solid color-mix(in srgb, var(--bs-border-color) 85%, transparent);
  border-radius: 1rem;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--cf-color-black) 6%, transparent);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cf-dashboard-metrics .cf-stat-card:hover {
  border-color: color-mix(in srgb, var(--bs-primary) 28%, var(--bs-border-color));
  box-shadow: 0 8px 24px color-mix(in srgb, var(--bs-primary) 12%, transparent);
}

.cf-dashboard-metrics .cf-stat-value {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

[data-bs-theme="dark"] .cf-dashboard-metrics .cf-stat-card {
  box-shadow: 0 8px 22px color-mix(in srgb, var(--cf-color-black) 28%, transparent);
}

.cf-profile-page {
  border: 0;
  border-radius: 1rem;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--cf-color-accent-purple) 8%, transparent);
}

.cf-profile-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "avatar main"
    "facts facts";
  gap: 1rem 1.25rem;
  align-items: start;
}

.cf-profile-hero-avatar {
  grid-area: avatar;
}

.cf-profile-hero-main {
  grid-area: main;
}

.cf-profile-hero-facts {
  grid-area: facts;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem 1rem;
  margin: 0;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  background: color-mix(in srgb, var(--bs-primary) 6%, var(--bs-body-bg));
  border: 1px solid color-mix(in srgb, var(--bs-primary) 14%, transparent);
}

.cf-profile-hero-facts dt {
  font-size: 0.75rem;
  color: var(--cf-color-muted);
  margin: 0 0 0.2rem;
}

.cf-profile-hero-facts dd {
  margin: 0;
  font-weight: 600;
  font-size: 0.9rem;
}

.cf-profile-hero-name {
  font-weight: 700;
}

.cf-profile-divider {
  margin-block: 1.35rem;
  opacity: 0.35;
}

.cf-profile-section-title {
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--bs-body-color);
}

@media (min-width: 992px) {
  .cf-profile-hero {
    grid-template-columns: auto minmax(0, 1fr) minmax(12rem, 16rem);
    grid-template-areas: "avatar main facts";
    align-items: center;
  }

  .cf-profile-hero-facts {
    grid-template-columns: 1fr;
    padding: 0.75rem 0.85rem;
  }
}

@media (max-width: 575.98px) {
  .cf-profile-hero-facts {
    grid-template-columns: 1fr;
  }
}

[data-bs-theme="dark"] .cf-dashboard-profile .text-muted,
[data-bs-theme="dark"] .cf-profile-preview .text-muted {
  color: var(--cf-color-muted) !important;
}

/* MatDash vertical layout assumes LTR mini-panel (80px + 240px). We use a single RTL sidebar. */
html[dir="rtl"][data-layout="vertical"] .page-wrapper {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

html[dir="rtl"] .left-sidebar.with-vertical {
  position: fixed;
  top: 0;
  z-index: 99;
}

@media (min-width: 992px) {
  html[dir="rtl"][data-layout="vertical"] .page-wrapper {
    margin-inline-end: 0 !important;
  }
}

@media (max-width: 991.98px) {
  html[dir="rtl"][data-layout="vertical"] .page-wrapper {
    margin-inline-start: 0 !important;
  }

  html[dir="rtl"][data-layout="vertical"] .topbar {
    width: 100% !important;
  }
}

html[dir="rtl"] .left-sidebar .sidebar-link {
  justify-content: flex-start;
  gap: 0.65rem;
}

html[dir="rtl"] .left-sidebar .hide-menu {
  white-space: nowrap;
}

html[dir="rtl"] .body-wrapper {
  margin-left: 0;
  margin-right: 0;
  margin-inline: max(0.75rem, env(safe-area-inset-inline-start, 0px))
    max(0.75rem, env(safe-area-inset-inline-end, 0px));
  margin-top: 72px;
  margin-bottom: 1.25rem;
  background: transparent;
  border-radius: 0;
  min-height: auto;
}

html[dir="rtl"][data-layout="vertical"] .page-wrapper {
  background-color: var(--bs-body-bg);
}

html[dir="rtl"] .body-wrapper .container-fluid {
  padding-inline: 0;
}

html[dir="rtl"] .body-wrapper > .container-fluid {
  width: 100%;
  max-width: none;
  margin-inline: 0;
}

html[data-boxed-layout="boxed"] .body-wrapper > .container-fluid,
html[data-boxed-layout="boxed"] .topbar .container-fluid {
  max-width: none;
  margin-inline: 0;
  width: 100%;
}

@media (min-width: 992px) {
  html[dir="rtl"] .body-wrapper {
    margin-inline: 0.35rem;
  }
}

.breadcrumb-item + .breadcrumb-item::before {
  float: inline-start;
  padding-inline-end: 0.5rem;
  padding-inline-start: 0;
}

.cf-page-breadcrumb .breadcrumb-item.active {
  color: var(--cf-color-text);
}

/* Phase 23: the page title already sits next to the trail, so a breadcrumb that
   would only repeat it is hidden instead of printing the same word twice. */
.cf-page-breadcrumb:has(.breadcrumb-item.active:empty) { display: none; }
.cf-page-breadcrumb .breadcrumb-item.active:empty { display: none; }

.card.card-body.py-3.mb-3 {
  background-color: var(--bs-card-bg);
  color: var(--bs-card-color);
}

.table th,
.table td {
  text-align: start;
}

/* Slug column: Persian header stays RTL; value is LTR with min width and gap from neighbors */
.table th.cf-table-col-slug,
.table td.cf-table-col-slug {
  min-inline-size: 11rem;
  padding-inline-end: 1.25rem;
}

.table td.cf-table-col-slug .cf-slug-value {
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
  max-inline-size: 100%;
  text-align: start;
}

.table th.cf-table-col-active,
.table td.cf-table-col-active {
  min-inline-size: 4.5rem;
  padding-inline-start: 0.75rem;
  white-space: nowrap;
}

.cf-theme-toggle .btn-link {
  color: var(--bs-body-color);
  text-decoration: none;
}

.cf-theme-toggle .btn-link:hover {
  color: var(--bs-primary);
}

.cf-brand-lockup {
  color: var(--bs-body-color);
}

/* MatDash mirrors `html[dir="rtl"] .logo-img img`; a wordmark must not be flipped. */
html[dir="rtl"] .cf-brand-lockup img {
  transform: none !important;
}

/* The panel now shows the same wide wordmark as the apps: no chip, no extra text. */
.cf-brand-wordmark {
  width: auto;
  height: 1.85rem;
  max-width: 100%;
  flex-shrink: 0;
}

.cf-brand-lockup-img {
  width: auto;
  height: 3rem;
  flex-shrink: 0;
}





.cf-brand-lockup--auth {
  justify-content: center;
}

.auth-login .cf-brand-lockup-img {
  height: 3.4rem;
}

.cf-auth-page.auth-bg {
  background-image: none;
  background-color: var(--cf-color-bg);
}

.cf-auth-page.auth-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse 85% 55% at 50% -5%,
    color-mix(in srgb, var(--bs-primary) 14%, transparent),
    transparent 68%
  );
  opacity: 0.9;
}

.cf-auth-card {
  position: relative;
  z-index: 1;
  max-inline-size: 25rem;
  border: 1px solid var(--bs-border-color);
  border-radius: var(--cf-radius-panel);
  background: var(--cf-color-panel) !important;
  box-shadow: 0 18px 48px color-mix(in srgb, var(--cf-color-black) 22%, transparent);
}

.cf-auth-card-body {
  padding: 1.85rem 1.65rem 1.75rem;
}

.cf-auth-brand {
  margin-bottom: 1.35rem;
}

.cf-auth-title {
  margin: 0 0 1.35rem;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.45;
}

.cf-auth-form {
  display: flex;
  flex-direction: column;
}

.cf-auth-field {
  margin-bottom: 0.95rem;
}

.cf-auth-field .form-label {
  margin-bottom: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--cf-color-muted);
}

.auth-login .form-control {
  min-height: 2.75rem;
  padding-block: 0.62rem;
  padding-inline: 0.85rem;
  border-radius: 0.75rem;
  border-color: var(--bs-border-color);
  background-color: var(--cf-color-surface);
  font-size: 0.9375rem;
}

.auth-login .form-control:focus {
  border-color: color-mix(in srgb, var(--bs-primary) 55%, var(--bs-border-color));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--bs-primary) 16%, transparent);
  background-color: var(--cf-color-surface);
}

.cf-auth-actions {
  margin-top: 0.35rem;
  padding-top: 1.05rem;
  border-block-start: 1px solid var(--bs-border-color);
}

.auth-login .cf-auth-submit {
  min-height: 2.75rem;
  padding-block: 0.62rem;
  padding-inline: 1rem;
  border: 0;
  border-radius: 0.75rem;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.35;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--bs-primary) 28%, transparent);
}

.auth-login .cf-auth-submit:hover,
.auth-login .cf-auth-submit:focus-visible {
  box-shadow: 0 12px 28px color-mix(in srgb, var(--bs-primary) 34%, transparent);
}

.cf-auth-theme .cf-theme-toggle .btn-link {
  border-radius: 0.75rem;
  background: color-mix(in srgb, var(--cf-color-panel) 72%, transparent);
  border: 1px solid var(--bs-border-color);
}

@media (max-width: 575.98px) {
  .cf-auth-card-body {
    padding: 1.45rem 1.2rem 1.35rem;
  }

  .cf-auth-page .cf-auth-theme {
    inset-inline-start: 0.25rem;
    inset-inline-end: auto;
  }
}

/* Report tables: fixed viewport for 10 rows, scroll only when needed */
:root {
  --cf-report-visible-rows: 10;
  --cf-report-row-height: 2.875rem;
  --cf-report-head-height: 2.75rem;
}

.cf-report-scroll {
  max-height: calc(var(--cf-report-head-height) + var(--cf-report-visible-rows) * var(--cf-report-row-height));
  height: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: auto;
  scrollbar-width: thin;
  background: var(--bs-card-bg);
}

/* Flow tables: one page of rows, paginate below */
.cf-report-table-flow {
  background: var(--bs-card-bg);
}

.cf-report-table-flow > .table-responsive {
  /* Phase 16b: wide tables (8-9 nowrap columns) must scroll, not lose their
     last column outside the card. Previously `visible`, which clipped Actions. */
  overflow: auto hidden;
  overscroll-behavior-inline: contain;
}

/* Keep the row actions on screen while the rest of a wide table scrolls. */
.cf-report-table-flow .cf-report-table th:last-child,
.cf-report-table-flow .cf-report-table td:last-child {
  position: sticky;
  inset-inline-end: 0;
  z-index: 1;
  background: var(--bs-card-bg);
  box-shadow: inset 1px 0 0 var(--bs-border-color);
}

/* Paginated lists: keep table block height stable so page changes do not jump the viewport */
.cf-report-card:has([data-cf-pagination]) .cf-report-table-flow,
.cf-report-card:has([data-cf-pagination]) > .table-responsive {
  min-block-size: calc(
    var(--cf-report-head-height) + var(--cf-report-visible-rows) * var(--cf-report-row-height)
  );
}

.cf-pagination {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.85rem;
}

.cf-pagination-summary {
  color: var(--cf-color-muted);
  font-size: 0.875rem;
}

.cf-pagination-summary-strong {
  font-variant-numeric: tabular-nums;
  color: var(--cf-color-text);
  font-weight: 700;
}

.cf-pagination-summary--solo {
  text-align: center;
}

.cf-pagination-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 0.65rem;
}

.cf-pagination-pages {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.25rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bs-border-color) 35%, transparent);
  border: 1px solid color-mix(in srgb, var(--bs-border-color) 55%, transparent);
}

.cf-pagination-page,
.cf-pagination-gap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-inline-size: 2.25rem;
  block-size: 2.25rem;
  padding-inline: 0.55rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.cf-pagination-page {
  color: var(--bs-body-color);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.cf-pagination-page:hover {
  background: color-mix(in srgb, var(--bs-primary) 10%, var(--bs-card-bg));
  border-color: color-mix(in srgb, var(--bs-primary) 25%, transparent);
  color: var(--bs-primary);
}

.cf-pagination-page.is-active {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--bs-primary) 92%, var(--cf-color-white)),
    color-mix(in srgb, var(--bs-secondary) 75%, var(--bs-primary))
  );
  color: var(--cf-color-white);
  font-weight: 700;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--bs-primary) 35%, transparent);
  border-color: transparent;
}

.cf-pagination-gap {
  color: var(--bs-secondary-color);
  min-inline-size: 1.5rem;
  padding-inline: 0.15rem;
  user-select: none;
}

.cf-pagination-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--bs-border-color) 70%, transparent);
  background: var(--bs-card-bg);
  color: var(--bs-body-color);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.cf-pagination-btn:hover:not(.is-disabled) {
  border-color: color-mix(in srgb, var(--bs-primary) 40%, var(--bs-border-color));
  color: var(--bs-primary);
  background: color-mix(in srgb, var(--bs-primary) 8%, var(--bs-card-bg));
}

.cf-pagination-btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.cf-pagination-btn .ti {
  font-size: 1rem;
  opacity: 0.85;
}

html[data-bs-theme="dark"] .cf-pagination-pages {
  background: color-mix(in srgb, var(--bs-body-bg) 60%, transparent);
}

html[data-bs-theme="dark"] .cf-pagination-page.is-active {
  color: var(--cf-color-white);
}

@media (max-width: 575.98px) {
  .cf-pagination-controls {
    flex-direction: column;
  }

  .cf-pagination-btn {
    inline-size: 100%;
    justify-content: center;
  }
}

.cf-report-scroll:focus {
  outline: 2px solid color-mix(in srgb, var(--bs-primary) 55%, transparent);
  outline-offset: 2px;
}

.cf-report-scroll > .table-responsive {
  overflow: visible;
}

.cf-report-scroll::-webkit-scrollbar {
  width: 8px;
}

.cf-report-scroll::-webkit-scrollbar-track {
  background: var(--bs-card-bg);
}

.cf-report-scroll::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--cf-color-muted) 45%, transparent);
  border-radius: 999px;
}

.cf-report-table tbody tr {
  height: var(--cf-report-row-height);
}

.cf-report-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background-color: var(--bs-body-bg);
  box-shadow: 0 1px 0 var(--bs-border-color);
}

/* Layout (RTL): MatDash .link-sidebar .topbar width pins header under sidebar — see panel-sidebar.css */
@media (min-width: 992px) {
  html[dir="rtl"][data-layout="vertical"] #main-wrapper.link-sidebar > .page-wrapper {
    margin-right: var(--cf-sidebar-active-width) !important;
    margin-left: 0 !important;
  }

  html[dir="rtl"][data-layout="vertical"] #main-wrapper.link-sidebar > .page-wrapper > .topbar {
    position: fixed !important;
    top: 0 !important;
    z-index: 100 !important;
    width: auto !important;
    max-width: none !important;
    left: 0 !important;
    right: var(--cf-sidebar-active-width) !important;
  }

  html[dir="rtl"][data-layout="vertical"] #main-wrapper.link-sidebar > aside.left-sidebar.with-vertical {
    z-index: 99 !important;
    right: 0 !important;
    left: auto !important;
  }
}

.cf-filter-card .card-body {
  padding: 0.9rem 1rem;
}

.cf-person-name {
  font-weight: 700;
  line-height: 1.35;
}

.cf-person-meta {
  color: var(--cf-color-muted);
  font-size: 0.8125rem;
  line-height: 1.35;
}

.cf-role-filter {
  --cf-role-filter-accent: var(--cf-color-accent-teal);
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: inherit;
  font: inherit;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.cf-role-filter:focus {
  outline: none;
}

.cf-role-filter .cf-stat-card {
  border: 2px solid transparent;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.cf-role-filter.is-active .cf-stat-card {
  border-color: var(--cf-role-filter-accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--cf-role-filter-accent) 25%, transparent);
}

.cf-role-filter-badge {
  position: absolute;
  top: -0.4rem;
  inset-inline-end: -0.15rem;
  z-index: 4;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 999px;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  line-height: 1;
  color: var(--cf-color-white);
  background: var(--cf-role-filter-accent);
  box-shadow: 0 0 0 2px var(--bs-body-bg);
  pointer-events: none;
}

.cf-role-filter.is-active .cf-role-filter-badge {
  display: inline-flex;
}

.cf-role-filter.is-active .cf-stat-icon {
  color: var(--cf-color-white);
  background: var(--cf-role-filter-accent);
  box-shadow: none;
}

.cf-role-filter:focus-visible .cf-stat-card {
  outline: 2px solid color-mix(in srgb, var(--cf-role-filter-accent) 65%, transparent);
  outline-offset: 2px;
}

.cf-stat-compact .cf-stat-card:hover {
  transform: none;
}

.cf-stat-compact .cf-stat-card .card-body {
  padding: 0.85rem 1rem;
}

.cf-stat-compact .cf-stat-value {
  font-size: 1.45rem;
}

.cf-stat-compact .cf-stat-icon {
  width: 2.6rem;
  height: 2.6rem;
  font-size: 1.15rem;
}

.cf-stat-card--rose {
  --cf-stat-accent: var(--bs-danger);
}

.cf-notif-trigger {
  color: var(--bs-body-color);
  text-decoration: none;
  min-width: 2.75rem;
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
}

.cf-notif-trigger:hover,
.cf-notif-trigger.show {
  color: var(--bs-body-color);
  background-color: color-mix(in srgb, var(--bs-primary) 10%, transparent);
}

.cf-notif-trigger::after {
  display: none !important;
  content: none !important;
}

.cf-notif-badge {
  position: absolute;
  inset-block-start: 0.28rem;
  inset-inline-start: 0.2rem;
  min-width: 1.05rem;
  padding-inline: 0.22rem;
  border-radius: 999px;
  background-color: var(--cf-notif-badge-bg);
  color: var(--cf-color-white);
  font-size: max(0.75rem, 12px);
  font-weight: 700;
  line-height: 1.25rem;
  text-align: center;
  box-shadow: 0 0 0 2px var(--bs-body-bg);
}

.navbar-nav .cf-notif-dropdown {
  inline-size: min(24rem, calc(100vw - 1.5rem));
  min-inline-size: 0;
  max-inline-size: calc(100vw - 1.5rem);
  padding: 0.35rem;
  border: 1px solid var(--bs-border-color) !important;
  border-radius: 1rem;
  overflow: hidden;
  background: var(--cf-color-panel);
  color: var(--bs-body-color);
  box-shadow: 0 16px 40px color-mix(in srgb, var(--cf-color-black) 28%, transparent);
}

.cf-notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem 0.65rem;
  font-weight: 700;
}

.cf-notif-head-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.cf-notif-mark-all {
  border: 0;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bs-primary) 12%, transparent);
  color: var(--bs-primary);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35;
}

.cf-notif-mark-all:hover {
  background: color-mix(in srgb, var(--bs-primary) 18%, transparent);
  color: var(--bs-primary);
}

.cf-notif-head-count {
  min-width: 1.35rem;
  padding-inline: 0.4rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bs-danger) 16%, transparent);
  color: var(--bs-danger);
  font-size: 0.75rem;
  line-height: 1.35rem;
  text-align: center;
}

.cf-notif-all {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.25rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.75rem;
  font-weight: 700;
  color: var(--bs-primary);
  text-decoration: none;
}

.cf-notif-all:hover {
  background: color-mix(in srgb, var(--bs-primary) 10%, transparent);
  color: var(--bs-primary);
}

.cf-notif-list {
  max-block-size: 19.5rem;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--cf-color-muted) 55%, transparent) transparent;
}

.cf-notif-list::-webkit-scrollbar {
  width: 6px;
}

.cf-notif-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: color-mix(in srgb, var(--cf-color-muted) 45%, transparent);
}

.cf-notif-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.6rem;
  border-radius: 0.8rem;
  text-decoration: none;
  color: var(--bs-body-color);
}

.cf-notif-item:hover {
  background: color-mix(in srgb, var(--bs-primary) 10%, var(--cf-color-surface));
  color: var(--bs-body-color);
}

.cf-notif-item.is-unread {
  background: color-mix(in srgb, var(--bs-primary) 7%, transparent);
}

.cf-notif-icon {
  position: relative;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.1rem;
  background: color-mix(in srgb, var(--cf-notif-accent, var(--bs-primary)) 16%, transparent);
  color: var(--cf-notif-accent, var(--bs-primary));
}

.cf-notif-icon--teal {
  --cf-notif-accent: var(--cf-color-accent-teal);
}

.cf-notif-icon--amber {
  --cf-notif-accent: var(--cf-color-accent-yellow);
}

.cf-notif-icon--rose {
  --cf-notif-accent: var(--bs-danger);
}

.cf-notif-icon--muted {
  --cf-notif-accent: var(--cf-color-muted);
}

.cf-notif-item.is-unread .cf-notif-icon::after {
  content: "";
  position: absolute;
  inset-block-start: -0.12rem;
  inset-inline-end: -0.12rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--bs-danger);
  box-shadow: 0 0 0 2px var(--cf-color-panel);
}

.cf-notif-copy {
  flex: 1 1 auto;
  min-inline-size: 0;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.cf-notif-title {
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cf-notif-body,
.cf-notif-time,
.cf-notif-empty {
  color: var(--cf-color-muted);
  font-size: 0.78rem;
}

.cf-notif-body {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-inline-size: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cf-notif-day::before {
  content: "·";
  margin-inline-end: 0.35rem;
}

.cf-notif-day--solo::before {
  content: none;
}

.cf-notif-time {
  flex-shrink: 0;
  font-weight: 700;
  color: var(--bs-body-color);
  font-size: 0.78rem;
}

.cf-notif-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 1.25rem 1rem;
}

.cf-notif-empty .ti {
  font-size: 1.35rem;
}

.cf-form-modal .modal-content {
  border: 0;
  border-radius: 1rem;
  box-shadow: 0 18px 50px color-mix(in srgb, var(--cf-color-black) 18%, transparent);
}

.cf-form-modal .modal-header,
.cf-form-modal .modal-footer {
  border-color: var(--bs-border-color);
}

.cf-form-modal .form-text,
.cf-form-modal .text-muted {
  color: var(--cf-color-muted) !important;
}

.cf-vehicle-catalog-sections {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.cf-brand-section {
  border: 1px solid var(--bs-border-color);
  border-radius: 0.85rem;
  overflow: hidden;
  background: color-mix(in srgb, var(--bs-body-bg) 92%, var(--bs-primary) 8%);
}

.cf-brand-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  font-weight: 700;
  border-bottom: 1px solid var(--bs-border-color);
  background: var(--cf-color-panel);
}

.cf-brand-section-title {
  font-size: 0.95rem;
}

.cf-brand-section-models {
  padding: 0.35rem 0;
}

.cf-brand-section-model {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 1rem;
  border-bottom: 1px solid color-mix(in srgb, var(--bs-border-color) 65%, transparent);
}

.cf-brand-section-model:last-child {
  border-bottom: 0;
}

.cf-brand-section-model-name {
  font-weight: 500;
  font-size: 0.9rem;
}

.cf-brand-index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr));
  gap: 0.65rem;
}

.badge.text-bg-light.text-body {
  color: var(--cf-color-text) !important;
  background-color: color-mix(in srgb, var(--cf-color-muted) 22%, var(--cf-color-panel)) !important;
}

.badge.text-bg-light.text-body.border {
  border-color: var(--bs-border-color) !important;
}

.cf-brand-index-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  min-height: 3.35rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 0.75rem;
  text-decoration: none;
  color: inherit;
  background: var(--cf-color-panel);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.cf-brand-index-leading {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.cf-brand-index-mark {
  flex-shrink: 0;
  inline-size: 2.35rem;
  block-size: 2.35rem;
  border-radius: 0.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  color: hsl(var(--cf-brand-mark-h, 220), 42%, 22%);
  background: color-mix(
    in srgb,
    hsl(var(--cf-brand-mark-h, 220), 55%, 48%) 28%,
    var(--cf-color-panel)
  );
  border: 1px solid color-mix(in srgb, hsl(var(--cf-brand-mark-h, 220), 45%, 40%) 35%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--cf-color-white) 12%, transparent);
}

.cf-brand-index-mark--logo {
  padding: 0.15rem;
  background: color-mix(in srgb, var(--cf-color-white) 88%, var(--bs-body-bg));
  border-color: color-mix(in srgb, var(--bs-border-color) 55%, transparent);
}

.cf-brand-index-mark--logo img {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  object-fit: contain;
}

.cf-brand-logo-preview {
  object-fit: contain;
  border-radius: 0.65rem;
  padding: 0.35rem;
  background: color-mix(in srgb, var(--cf-color-white) 88%, var(--bs-body-bg));
  border: 1px solid var(--bs-border-color);
}

[data-bs-theme="dark"] .cf-brand-logo-preview {
  background: var(--cf-color-white);
  border-color: color-mix(in srgb, var(--cf-color-border) 65%, transparent);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--cf-color-black) 18%, transparent);
}

[data-bs-theme="dark"] .cf-brand-index-mark {
  color: hsl(var(--cf-brand-mark-h, 220), 75%, 88%);
  background: color-mix(
    in srgb,
    hsl(var(--cf-brand-mark-h, 220), 50%, 38%) 38%,
    var(--cf-color-panel)
  );
}

/* Must follow generic dark .cf-brand-index-mark (same specificity, later in file). */
html[data-bs-theme="dark"] .cf-brand-index-mark.cf-brand-index-mark--logo {
  color: inherit;
  background: var(--cf-color-white);
  border-color: color-mix(in srgb, var(--cf-color-border) 72%, transparent);
  box-shadow:
    0 1px 4px color-mix(in srgb, var(--cf-color-black) 32%, transparent),
    inset 0 0 0 1px color-mix(in srgb, var(--cf-color-black) 8%, transparent);
}

html[data-bs-theme="dark"] .cf-brand-index-mark--logo img {
  filter: saturate(1.12) contrast(1.04);
}

.cf-brand-index-card:hover {
  border-color: color-mix(in srgb, var(--bs-primary) 45%, var(--bs-border-color));
  box-shadow: 0 6px 16px color-mix(in srgb, var(--bs-primary) 12%, transparent);
  transform: translateY(-1px);
  color: inherit;
}

.cf-brand-index-name {
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.35;
}

/* Main sheet: one rounded surface from the title to the bottom of the viewport. */
html[dir="rtl"] .body-wrapper {
  min-height: calc(100vh - 72px - 1.25rem);
  display: flex;
  flex-direction: column;
}

html[dir="rtl"] .body-wrapper > .container-fluid {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-block-size: 0;
}

.cf-page-shell {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-block-size: 0;
  border-radius: var(--cf-radius-panel);
  background: var(--cf-color-panel);
  border: 1px solid var(--bs-border-color);
  box-shadow: 0 12px 32px color-mix(in srgb, var(--cf-color-black) 14%, transparent);
  padding: 1.15rem 1.2rem 1.35rem;
}

.cf-page-head {
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  background: transparent;
  border-block-end: 1px solid var(--bs-border-color);
  box-shadow: none;
}

/* Templates put a .btn in the breadcrumb's current item; strip its chrome so both
   crumbs share one line instead of one text link + one raised pill. */
.cf-page-breadcrumb .breadcrumb-item > .btn {
  --bs-btn-padding-y: 0; --bs-btn-padding-x: 0;
  --bs-btn-font-size: inherit; --bs-btn-line-height: inherit;
  --bs-btn-border-width: 0; --bs-btn-bg: transparent;
  --bs-btn-color: var(--bs-secondary-color);
  --bs-btn-hover-bg: transparent; --bs-btn-active-bg: transparent;
  --bs-btn-focus-box-shadow: none;
}

.cf-page-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

@media (max-width: 767.98px) {
  .cf-page-shell {
    padding: 0.85rem;
  }
}

/* Matdash primary on dark: ensure btn text meets WCAG AA on purple fill */
[data-bs-theme="dark"] .btn-primary {
  --bs-btn-color: var(--cf-color-white);
  color: var(--cf-color-white);
}

.btn-outline-secondary {
  --bs-btn-color: var(--cf-color-text);
  --bs-btn-border-color: color-mix(in srgb, var(--cf-color-text) 32%, transparent);
  --bs-btn-hover-color: var(--cf-color-text);
  --bs-btn-hover-bg: color-mix(in srgb, var(--cf-color-text) 6%, transparent);
  --bs-btn-hover-border-color: color-mix(in srgb, var(--cf-color-text) 45%, transparent);
}

.form-check:not(.form-switch) {
  min-height: var(--cf-touch-target-min);
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.badge.text-bg-success {
  color: var(--cf-color-ink) !important;
  background-color: color-mix(in srgb, var(--bs-success) 88%, var(--cf-color-white)) !important;
  border: 1px solid color-mix(in srgb, var(--bs-success) 55%, transparent);
}

[data-bs-theme="dark"] .badge.text-bg-success {
  color: var(--cf-color-success-badge-ink) !important;
  background-color: var(--cf-color-success-emphasis) !important;
  border: 1px solid color-mix(in srgb, var(--cf-color-success-emphasis) 70%, var(--cf-color-white));
  box-shadow: 0 0 12px color-mix(in srgb, var(--cf-color-success-emphasis) 35%, transparent);
}

.badge.text-bg-danger {
  color: var(--cf-color-white) !important;
  background-color: color-mix(in srgb, var(--bs-danger) 92%, var(--cf-color-black)) !important;
}

[data-bs-theme="dark"] .badge.text-bg-danger {
  color: var(--cf-color-ink) !important;
  background-color: var(--cf-color-danger-emphasis) !important;
}

.btn.btn-danger,
.btn.btn-danger.btn-sm {
  --bs-btn-bg: var(--bs-danger);
  --bs-btn-border-color: var(--bs-danger);
  --bs-btn-hover-bg: color-mix(in srgb, var(--bs-danger) 86%, var(--cf-color-black));
  --bs-btn-hover-border-color: var(--bs-btn-hover-bg);
  --bs-btn-active-bg: color-mix(in srgb, var(--bs-danger) 78%, var(--cf-color-black));
  --bs-btn-active-border-color: var(--bs-btn-active-bg);
  --bs-btn-color: var(--cf-color-white);
  --bs-btn-hover-color: var(--cf-color-white);
}

[data-bs-theme="dark"] .btn.btn-danger,
[data-bs-theme="dark"] .btn.btn-danger.btn-sm {
  --bs-btn-bg: var(--cf-btn-danger-solid-bg);
  --bs-btn-border-color: var(--cf-btn-danger-solid-bg);
  --bs-btn-hover-bg: var(--cf-btn-danger-solid-hover);
  --bs-btn-hover-border-color: var(--cf-btn-danger-solid-hover);
  --bs-btn-active-bg: var(--cf-btn-danger-solid-active);
  --bs-btn-active-border-color: var(--cf-btn-danger-solid-active);
}

.btn.btn-outline-danger,
.btn.btn-outline-danger.btn-sm {
  --bs-btn-color: color-mix(in srgb, var(--cf-color-danger) 55%, var(--cf-color-black));
  --bs-btn-border-color: color-mix(in srgb, var(--cf-color-danger) 55%, var(--cf-color-black));
  --bs-btn-hover-color: var(--cf-color-white);
  --bs-btn-hover-bg: color-mix(in srgb, var(--cf-color-danger) 48%, var(--cf-color-black));
  --bs-btn-hover-border-color: var(--bs-btn-hover-bg);
}

[data-bs-theme="dark"] .btn.btn-outline-danger,
[data-bs-theme="dark"] .btn.btn-outline-danger.btn-sm {
  --bs-btn-color: color-mix(in srgb, var(--cf-color-danger) 45%, var(--cf-color-white));
  --bs-btn-border-color: color-mix(in srgb, var(--cf-color-danger) 55%, var(--cf-color-white));
  --bs-btn-hover-color: var(--cf-color-white);
  --bs-btn-hover-bg: color-mix(in srgb, var(--cf-color-danger) 42%, var(--cf-color-black));
  --bs-btn-hover-border-color: var(--bs-btn-hover-bg);
}

/* Phase 9b2 — notification-policy table: the preview text wraps instead of
   forcing the report table to scroll horizontally. Layout only, no tokens. */
.cf-policy-preview {
  white-space: normal;
  max-inline-size: 22rem;
}


/* A tall form modal (12 mechanic fields): anchor it to the top, scroll only the body,
   so the title and the submit/cancel row are always on screen. */
.cf-form-modal .modal-dialog {
  align-items: flex-start;
  margin-block: 1.5rem;
  /* the centred variant stretches the dialog to the viewport, which pushes a tall
     form above the top edge; a capped body makes the dialog size itself instead. */
  min-block-size: auto;
}


/* The form wraps body+footer, so IT must be the flex column that shrinks. */
.cf-form-modal .modal-dialog .modal-content > form {
  display: flex;
  flex-direction: column;
  min-block-size: 0;
}

.cf-form-modal .modal-dialog .modal-body {
  min-block-size: 0;
  max-block-size: calc(100dvh - 14rem);
  overflow-y: auto;
}


/* Chart tooltips must stay legible in both themes (phase 68).
   ApexCharts picks its own theme when it mounts, which can disagree with the theme the
   page actually renders, so the surface and the text are pinned to tokens instead. */
.apexcharts-tooltip,
.apexcharts-tooltip.apexcharts-theme-light,
.apexcharts-tooltip.apexcharts-theme-dark {
  background: var(--bs-body-bg) !important;
  border: 1px solid var(--bs-border-color) !important;
  color: var(--bs-body-color) !important;
  box-shadow: var(--bs-box-shadow) !important;
}

.apexcharts-tooltip-title {
  background: var(--bs-secondary-bg) !important;
  border-color: var(--bs-border-color) !important;
  color: var(--bs-emphasis-color) !important;
  font-weight: 700;
}

.apexcharts-tooltip-text,
.apexcharts-tooltip-text-y-label,
.apexcharts-tooltip-text-y-value,
.apexcharts-tooltip-text-z-label,
.apexcharts-tooltip-text-z-value,
.apexcharts-tooltip-series-group {
  color: var(--bs-body-color) !important;
  fill: var(--bs-body-color) !important;
}

/* Phase 75 — MatDash's caret-down.svg is missing from vendor, so selects had no arrow at all.
   The chevron is drawn here as a background image (no color literals, no vendor edits). */
.form-select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%236c757d' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.6' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 1rem;
  background-position: left .75rem center;
  padding-inline-start: 2rem;
}
[data-bs-theme="dark"] .form-select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23adb5bd' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.6' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");
}
/* The picker draws its own Tabler calendar glyph; a background-image icon drew a second one. */

/* Users directory — club-level filter strip. One quiet chip per level, coloured by its tier;
   clicking it drives the form's `tier` select, so both entry points agree. */
.cf-tier-strip { display: flex; flex-wrap: wrap; gap: .5rem; }
.cf-tier-chip {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .45rem .8rem;
  border: 1px solid color-mix(in srgb, var(--cf-color-border) 80%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--cf-color-panel) 55%, transparent);
  color: var(--cf-color-text);
  font-size: .8rem; font-weight: 600;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}
.cf-tier-chip:hover { border-color: color-mix(in srgb, var(--cf-color-primary) 45%, var(--cf-color-border)); }
.cf-tier-chip:focus-visible { outline: 2px solid var(--cf-color-primary); outline-offset: 2px; }
.cf-tier-chip.is-active {
  border-color: color-mix(in srgb, var(--cf-color-primary) 60%, transparent);
  background: color-mix(in srgb, var(--cf-color-primary) 14%, transparent);
}
.cf-tier-dot { inline-size: .5rem; block-size: .5rem; border-radius: 50%; background: currentColor; }
.cf-tier-count {
  font-variant-numeric: tabular-nums; font-weight: 700;
  color: var(--cf-color-muted);
}
.cf-tier-chip.is-active .cf-tier-count { color: var(--cf-color-text); }

.cf-tier-chip.tier-bronze { color: var(--cf-color-tier-bronze); }
.cf-tier-chip.tier-silver { color: var(--cf-color-tier-silver); }
.cf-tier-chip.tier-gold { color: var(--cf-color-tier-gold); }
.cf-tier-chip.tier-diamond { color: var(--cf-color-accent-teal); }
.cf-tier-chip.tier-none { color: var(--cf-color-muted); }

/* Every sidebar click is a real page load in this panel. A cross-document view transition swaps
   the white flash for a fade (Chromium 126+); other engines simply keep the plain navigation. */
@view-transition { navigation: auto; }

/* A sidebar click swaps the content column in place; until the HTML lands, say so. */
html.cf-nav-busy { cursor: progress; }

/* Persian file picker (panel-file-input.js) — replaces «Choose File / No file chosen». */
.cf-file-picker { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.cf-file-picker-name { overflow-wrap: anywhere; }
.cf-file-picker-input {
  position: absolute !important; inline-size: 1px; block-size: 1px; opacity: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

/* The pagination partial renders nothing for a single page; its footer bar must not stay
   behind as a thin empty strip under the table (empty-state pages). */
.card-body.border-top:not(:has(*)) { display: none; }

/* Overhaul: table action buttons had their label stuck to the top edge. */
.table .btn { display: inline-flex; align-items: center; justify-content: center; }

/* Overhaul: matdash hard-codes its violet (#635bff) inside component vars, so the brand
   token alone did not reach buttons/pills/checkboxes. #b85a1c on white text = 4.65:1 (WCAG AA). */
.btn-primary { --bs-btn-bg: var(--cf-color-primary); --bs-btn-border-color: var(--cf-color-primary); --bs-btn-color: #fff;
  --bs-btn-hover-bg: var(--cf-color-primary-hover); --bs-btn-hover-border-color: var(--cf-color-primary-hover); --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: var(--cf-color-primary-hover); --bs-btn-active-border-color: var(--cf-color-primary-hover); --bs-btn-active-color: #fff;
  --bs-btn-disabled-bg: var(--cf-color-primary); --bs-btn-disabled-border-color: var(--cf-color-primary); }
.btn-outline-primary { --bs-btn-color: #f0a060; --bs-btn-border-color: #f0a060; --bs-btn-hover-bg: var(--cf-color-primary); --bs-btn-hover-border-color: var(--cf-color-primary); --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: var(--cf-color-primary-hover); --bs-btn-active-border-color: var(--cf-color-primary-hover); }
.form-check-input:checked { background-color: var(--cf-color-primary); border-color: var(--cf-color-primary); }
.nav-pills { --bs-nav-pills-link-active-bg: var(--cf-color-primary); }
.form-control:focus, .form-select:focus { border-color: #f0a060; box-shadow: 0 0 0 .2rem rgba(240,160,96,.25); }
.text-primary { color: #f0a060 !important; }
.bg-primary { background-color: var(--cf-color-primary) !important; }
.page-link.active, .active > .page-link { background-color: var(--cf-color-primary); border-color: var(--cf-color-primary); }

/* Overhaul polish: role stat cards were forced full-width on phones (5 tall cards before the list). */
@media (max-width: 767.98px) {
  [data-cf-role-stats] > .col-6 { flex: 0 0 50% !important; max-width: 50% !important; width: 50% !important; }
  [data-cf-role-stats] .card, [data-cf-role-stats] .card-body { margin-bottom: 0 !important; }
  [data-cf-role-stats] .card-body { padding: .85rem !important; }
}
