/* ==========================================================================
   Revnexa shared components
   ========================================================================== */

/* Cards */
.rx-card {
  background: var(--rx-surface); border: 1px solid var(--rx-border);
  border-radius: var(--rx-radius); box-shadow: var(--rx-shadow-sm);
}
.rx-card__head {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap;
  padding: .9rem 1.15rem; border-bottom: 1px solid var(--rx-border);
}
.rx-card__head h2, .rx-card__head h3 { font-size: 1rem; margin: 0; }
.rx-card__body { padding: 1.15rem; }
.rx-card__body--flush { padding: 0; }
.rx-card__foot { padding: .75rem 1.15rem; border-top: 1px solid var(--rx-border); }

/* KPI */
.rx-kpi { padding: 1.1rem 1.15rem; height: 100%; }
.rx-kpi__label { font-size: var(--rx-fs-sm); color: var(--rx-text-muted); display: flex; align-items: center; gap: .5rem; }
.rx-kpi__label .bi { color: var(--rx-brand-500); }
.rx-kpi__value { font-size: var(--rx-fs-2xl); font-weight: 700; letter-spacing: -.02em; margin: .25rem 0 .1rem; font-variant-numeric: tabular-nums; }
.rx-kpi__delta { font-size: var(--rx-fs-xs); color: var(--rx-text-muted); }
.rx-delta-up { color: var(--rx-success); font-weight: 600; }
.rx-delta-down { color: var(--rx-danger); font-weight: 600; }

/* Buttons (extend Bootstrap) */
.btn { font-weight: 550; font-size: var(--rx-fs-base); border-radius: var(--rx-radius-sm); }
.btn-primary { --bs-btn-bg: var(--rx-brand-600); --bs-btn-border-color: var(--rx-brand-600); --bs-btn-hover-bg: var(--rx-brand-700); --bs-btn-hover-border-color: var(--rx-brand-700); --bs-btn-active-bg: var(--rx-brand-700); --bs-btn-color: #fff; --bs-btn-hover-color: #fff; }
html[data-theme="dark"] .btn-primary { --bs-btn-bg: #4262e6; --bs-btn-border-color: #4262e6; --bs-btn-hover-bg: #3a57d4; --bs-btn-hover-border-color: #3a57d4; --bs-btn-active-bg: #3a57d4; }
.btn-outline-secondary { --bs-btn-color: var(--rx-text-muted); --bs-btn-border-color: var(--rx-border-strong); --bs-btn-hover-bg: var(--rx-surface-2); --bs-btn-hover-color: var(--rx-text); --bs-btn-hover-border-color: var(--rx-border-strong); --bs-btn-active-bg: var(--rx-surface-2); --bs-btn-active-color: var(--rx-text); }
.btn-sm { font-size: var(--rx-fs-sm); }
.btn .bi { margin-right: .35rem; }
.btn.icon-only .bi { margin: 0; }

/* Forms */
.form-label { font-size: var(--rx-fs-sm); font-weight: 600; color: var(--rx-text); margin-bottom: .3rem; }
.form-control, .form-select {
  background-color: var(--rx-surface); color: var(--rx-text);
  border-color: var(--rx-border-strong); border-radius: var(--rx-radius-sm); font-size: var(--rx-fs-base);
}
.form-control::placeholder { color: var(--rx-text-faint); }
.form-control:focus, .form-select:focus { border-color: var(--rx-focus); box-shadow: 0 0 0 3px rgba(59, 99, 230, .2); background-color: var(--rx-surface); color: var(--rx-text); }
.form-text { color: var(--rx-text-muted); font-size: var(--rx-fs-xs); }
.invalid-feedback { font-size: var(--rx-fs-xs); }
.form-check-input:checked { background-color: var(--rx-brand-600); border-color: var(--rx-brand-600); }
.rx-req::after { content: " *"; color: var(--rx-danger); }
.rx-form-section { padding-bottom: 1.25rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--rx-border); }
.rx-form-section:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.rx-form-section h2, .rx-form-section h3 { font-size: .95rem; margin-bottom: .15rem; }
.rx-form-section > p { color: var(--rx-text-muted); font-size: var(--rx-fs-sm); margin-bottom: 1rem; }

/* Toolbar */
.rx-toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; padding: .85rem 1.15rem; border-bottom: 1px solid var(--rx-border); }
.rx-toolbar .rx-search { position: relative; flex: 1 1 220px; max-width: 340px; }
.rx-toolbar .rx-search .bi { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--rx-text-faint); }
.rx-toolbar .rx-search input { padding-left: 2.2rem; }
.rx-toolbar .form-select { width: auto; min-width: 140px; }
.rx-toolbar .ms-auto { margin-left: auto; }

/* Tables */
.rx-table { margin: 0; --bs-table-bg: transparent; --bs-table-color: var(--rx-text); --bs-table-border-color: var(--rx-border); --bs-table-hover-bg: var(--rx-surface-2); --bs-table-hover-color: var(--rx-text); }
.rx-table thead th {
  font-size: var(--rx-fs-xs); text-transform: uppercase; letter-spacing: .05em;
  color: var(--rx-text-muted); font-weight: 600; background: var(--rx-surface-2);
  border-bottom: 1px solid var(--rx-border); white-space: nowrap; padding: .7rem .75rem;
}
.rx-table tbody td { padding: .7rem .75rem; vertical-align: middle; }
.rx-table tr > :first-child { padding-left: 1.15rem; }
.rx-table tr > :last-child { padding-right: 1.15rem; }
.rx-table th[data-sort] { cursor: pointer; user-select: none; }
.rx-table th[data-sort]:hover { color: var(--rx-text); }
.rx-table th[data-sort] .bi { font-size: .7rem; margin-left: .25rem; opacity: .45; }
.rx-table th[aria-sort="ascending"] .bi, .rx-table th[aria-sort="descending"] .bi { opacity: 1; color: var(--rx-brand-500); }
.rx-table .cell-main { font-weight: 600; color: var(--rx-text); }
.rx-table .cell-sub { font-size: var(--rx-fs-xs); color: var(--rx-text-muted); overflow-wrap: anywhere; }
.rx-table td .rx-person .cell-sub { max-width: 190px; }
@media (max-width: 767.98px) { .rx-table td .rx-person .cell-sub { max-width: none; } .rx-table--stack tbody td { min-width: 0; } .rx-table--stack tbody td .rx-person { text-align: left; } }
.rx-table-wrap { overflow-x: auto; position: relative; }
.rx-table-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; padding: .75rem 1.15rem; border-top: 1px solid var(--rx-border); font-size: var(--rx-fs-sm); color: var(--rx-text-muted); }
.pagination { margin: 0; --bs-pagination-bg: var(--rx-surface); --bs-pagination-border-color: var(--rx-border); --bs-pagination-color: var(--rx-text); --bs-pagination-hover-bg: var(--rx-surface-2); --bs-pagination-hover-color: var(--rx-text); --bs-pagination-hover-border-color: var(--rx-border); --bs-pagination-active-bg: var(--rx-brand-600); --bs-pagination-active-border-color: var(--rx-brand-600); --bs-pagination-disabled-bg: var(--rx-surface); --bs-pagination-disabled-color: var(--rx-text-faint); --bs-pagination-disabled-border-color: var(--rx-border); --bs-pagination-font-size: var(--rx-fs-sm); --bs-pagination-focus-color: var(--rx-text); --bs-pagination-focus-bg: var(--rx-surface-2); }

/* Stacked table on small screens: add .rx-table--stack and data-label on td */
@media (max-width: 767.98px) {
  .rx-table--stack thead { display: none; }
  .rx-table--stack tbody tr { display: block; padding: .75rem 1rem; border-bottom: 1px solid var(--rx-border); }
  .rx-table--stack tbody td { display: flex; justify-content: space-between; gap: 1rem; padding: .3rem 0; border: 0; text-align: right; }
  .rx-table--stack tbody td::before { content: attr(data-label); font-size: var(--rx-fs-xs); text-transform: uppercase; letter-spacing: .04em; color: var(--rx-text-muted); font-weight: 600; text-align: left; flex: 0 0 auto; }
  .rx-table--stack tbody td[data-label=""]::before, .rx-table--stack tbody td:not([data-label])::before { content: none; }
  .rx-table--stack tbody td.cell-actions { justify-content: flex-end; }
}

/* Badges */
.rx-badge {
  display: inline-flex; align-items: center; gap: .3rem; padding: .18rem .6rem;
  border-radius: 999px; font-size: var(--rx-fs-xs); font-weight: 600; white-space: nowrap;
  background: var(--rx-neutral-bg); color: var(--rx-neutral);
}
.rx-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.rx-badge--plain::before { content: none; }
.rx-badge--success { background: var(--rx-success-bg); color: var(--rx-success); }
.rx-badge--warning { background: var(--rx-warning-bg); color: var(--rx-warning); }
.rx-badge--danger { background: var(--rx-danger-bg); color: var(--rx-danger); }
.rx-badge--info { background: var(--rx-info-bg); color: var(--rx-info); }
.rx-badge--brand { background: var(--rx-brand-50); color: var(--rx-brand-600); }
html[data-theme="dark"] .rx-badge--brand { color: var(--rx-brand-700); }

/* Score meter */
.rx-score { display: inline-flex; align-items: center; gap: .5rem; font-variant-numeric: tabular-nums; font-weight: 600; }
.rx-score__bar { width: 54px; height: 6px; background: var(--rx-border); border-radius: 99px; overflow: hidden; }
.rx-score__bar > span { display: block; height: 100%; background: var(--rx-brand-500); border-radius: 99px; }

/* Avatars */
.rx-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: 0 0 auto; display: inline-grid; place-items: center;
  font-size: .75rem; font-weight: 700; color: #fff; letter-spacing: .02em; user-select: none;
}
.rx-avatar--sm { width: 28px; height: 28px; font-size: .65rem; }
.rx-avatar--lg { width: 72px; height: 72px; font-size: 1.4rem; }
.rx-avatar--xl { width: 96px; height: 96px; font-size: 1.9rem; }
.rx-person { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.rx-person > div { min-width: 0; }

/* Lists / timeline */
.rx-list { list-style: none; margin: 0; padding: 0; }
.rx-list > li { display: flex; gap: .75rem; padding: .8rem 1.15rem; border-bottom: 1px solid var(--rx-border); align-items: flex-start; }
.rx-list > li:last-child { border-bottom: 0; }
.rx-timeline { list-style: none; margin: 0; padding: 0 0 0 .25rem; position: relative; }
.rx-timeline::before { content: ""; position: absolute; left: 17px; top: 8px; bottom: 8px; width: 2px; background: var(--rx-border); }
.rx-timeline > li { position: relative; display: flex; gap: .85rem; padding: .55rem 0; }
.rx-timeline__icon { width: 28px; height: 28px; flex: 0 0 auto; border-radius: 50%; background: var(--rx-brand-50); color: var(--rx-brand-600); display: grid; place-items: center; font-size: .8rem; z-index: 1; border: 2px solid var(--rx-surface); }
html[data-theme="dark"] .rx-timeline__icon { color: var(--rx-brand-700); }
.rx-timeline__title { font-weight: 600; font-size: var(--rx-fs-base); }
.rx-timeline__meta { font-size: var(--rx-fs-xs); color: var(--rx-text-muted); }

/* Detail definition list */
.rx-dl { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: .6rem 1rem; margin: 0; font-size: var(--rx-fs-base); }
.rx-dl dt { color: var(--rx-text-muted); font-weight: 500; }
.rx-dl dd { margin: 0; word-break: break-word; }

/* Tabs */
.nav-tabs { --bs-nav-tabs-border-color: var(--rx-border); --bs-nav-link-color: var(--rx-text-muted); --bs-nav-link-hover-color: var(--rx-text); --bs-nav-tabs-link-active-color: var(--rx-brand-600); --bs-nav-tabs-link-active-bg: transparent; --bs-nav-tabs-link-active-border-color: transparent transparent var(--rx-brand-500); --bs-nav-tabs-link-hover-border-color: transparent; }
.nav-tabs .nav-link { font-weight: 550; font-size: var(--rx-fs-base); border-width: 0 0 2px; }
.nav-tabs .nav-link.active { border-bottom-color: var(--rx-brand-500); }

/* Dropdowns / modals */
.dropdown-menu { border-radius: var(--rx-radius); box-shadow: var(--rx-shadow-lg); font-size: var(--rx-fs-base); padding: .4rem; }
.dropdown-item { border-radius: var(--rx-radius-sm); padding: .45rem .75rem; }
.dropdown-item .bi { margin-right: .5rem; color: var(--rx-text-muted); }
.dropdown-item.text-danger .bi { color: inherit; }
.dropdown-divider { border-color: var(--rx-border); }
.rx-dropdown-wide { width: 360px; max-width: calc(100vw - 2rem); padding: 0; }
.modal-content { border-radius: var(--rx-radius-lg); box-shadow: var(--rx-shadow-lg); background: var(--rx-surface); color: var(--rx-text); }
.modal-header, .modal-footer { border-color: var(--rx-border); }
.modal-title { font-size: 1.05rem; }
.btn-close { filter: none; }
html[data-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
.offcanvas { color: var(--rx-text); }

/* Alerts */
.alert { border-radius: var(--rx-radius-sm); font-size: var(--rx-fs-base); }

/* Empty / loading states */
.rx-empty { text-align: center; padding: 2.5rem 1rem; color: var(--rx-text-muted); }
.rx-empty .bi { font-size: 2rem; color: var(--rx-text-faint); display: block; margin-bottom: .5rem; }
.rx-empty h3 { font-size: 1rem; margin-bottom: .25rem; }
.rx-skeleton { background: linear-gradient(90deg, var(--rx-surface-2) 25%, var(--rx-border) 37%, var(--rx-surface-2) 63%); background-size: 400% 100%; animation: rx-shimmer 1.4s ease infinite; border-radius: var(--rx-radius-sm); min-height: 1rem; }
@keyframes rx-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@media (prefers-reduced-motion: reduce) { .rx-skeleton { animation: none; } * { scroll-behavior: auto !important; } }

/* Toasts */
.rx-toast-host { position: fixed; right: 1rem; bottom: 1rem; z-index: 2100; display: flex; flex-direction: column; gap: .5rem; max-width: calc(100vw - 2rem); }
.rx-toast { display: flex; align-items: flex-start; gap: .65rem; min-width: 260px; max-width: 380px; padding: .75rem 1rem; background: var(--rx-surface); color: var(--rx-text); border: 1px solid var(--rx-border); border-left: 4px solid var(--rx-brand-500); border-radius: var(--rx-radius-sm); box-shadow: var(--rx-shadow-lg); font-size: var(--rx-fs-base); }
.rx-toast--success { border-left-color: var(--rx-success); }
.rx-toast--danger { border-left-color: var(--rx-danger); }
.rx-toast--warning { border-left-color: var(--rx-warning); }
.rx-toast .bi { margin-top: .1rem; }
.rx-toast--success .bi { color: var(--rx-success); }
.rx-toast--danger .bi { color: var(--rx-danger); }

/* Chart containers */
.rx-chart { position: relative; height: 300px; }
.rx-chart--sm { height: 220px; }
.rx-chart--lg { height: 360px; }

/* Funnel */
.rx-funnel__row { display: grid; grid-template-columns: 120px 1fr 90px; gap: .75rem; align-items: center; margin-bottom: .6rem; font-size: var(--rx-fs-sm); }
.rx-funnel__bar { height: 28px; background: var(--rx-surface-2); border-radius: var(--rx-radius-sm); overflow: hidden; }
.rx-funnel__bar > span { display: block; height: 100%; background: var(--rx-brand-500); border-radius: var(--rx-radius-sm); }
@media (max-width: 575.98px) { .rx-funnel__row { grid-template-columns: 90px 1fr 70px; } }

/* Progress */
.progress { background: var(--rx-border); height: 8px; border-radius: 99px; }
.progress-bar { background: var(--rx-brand-500); }

/* Kanban */
.rx-kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 1fr); gap: 1rem; overflow-x: auto; padding-bottom: 1rem; align-items: start; scroll-snap-type: x proximity; }
.rx-kanban__col { background: var(--rx-surface-2); border: 1px solid var(--rx-border); border-radius: var(--rx-radius); display: flex; flex-direction: column; max-height: calc(100vh - 230px); min-height: 220px; scroll-snap-align: start; }
.rx-kanban__head { padding: .8rem .9rem .6rem; display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.rx-kanban__title { font-weight: 650; font-size: .9rem; display: flex; align-items: center; gap: .45rem; }
.rx-kanban__total { font-size: var(--rx-fs-xs); color: var(--rx-text-muted); font-variant-numeric: tabular-nums; }
.rx-kanban__dot { width: 9px; height: 9px; border-radius: 50%; }
.rx-kanban__list { padding: .25rem .65rem .75rem; overflow-y: auto; flex: 1 1 auto; display: flex; flex-direction: column; gap: .6rem; min-height: 80px; border-radius: 0 0 var(--rx-radius) var(--rx-radius); }
.rx-kanban__list.is-over { background: var(--rx-brand-50); outline: 2px dashed var(--rx-brand-200); outline-offset: -4px; }
.rx-deal-card { background: var(--rx-surface); border: 1px solid var(--rx-border); border-radius: var(--rx-radius-sm); padding: .75rem .8rem; box-shadow: var(--rx-shadow-sm); cursor: grab; }
.rx-deal-card:hover { border-color: var(--rx-border-strong); }
.rx-deal-card.is-dragging { opacity: .45; }
.rx-deal-card__title { font-weight: 600; font-size: .875rem; color: var(--rx-text); display: block; margin-bottom: .1rem; }
.rx-deal-card__meta { display: flex; justify-content: space-between; align-items: center; font-size: var(--rx-fs-xs); color: var(--rx-text-muted); margin-top: .5rem; }
.rx-deal-card__value { font-weight: 700; color: var(--rx-text); font-size: .95rem; font-variant-numeric: tabular-nums; }

/* Calendar */
.rx-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--rx-border); border-left: 1px solid var(--rx-border); }
.rx-cal__dow { padding: .5rem; font-size: var(--rx-fs-xs); text-transform: uppercase; letter-spacing: .05em; color: var(--rx-text-muted); font-weight: 600; background: var(--rx-surface-2); border-right: 1px solid var(--rx-border); border-bottom: 1px solid var(--rx-border); text-align: center; }
.rx-cal__cell { min-height: 108px; padding: .35rem; border-right: 1px solid var(--rx-border); border-bottom: 1px solid var(--rx-border); display: flex; flex-direction: column; gap: 2px; cursor: pointer; background: var(--rx-surface); min-width: 0; }
.rx-cal__cell:hover { background: var(--rx-surface-2); }
.rx-cal__cell.is-other { background: var(--rx-surface-2); color: var(--rx-text-faint); }
.rx-cal__cell.is-today .rx-cal__num { background: var(--rx-brand-600); color: #fff; }
.rx-cal__num { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; font-size: var(--rx-fs-sm); font-weight: 600; border: 0; background: transparent; padding: 0; color: inherit; }
.rx-cal__num:hover { background: var(--rx-border); }
.rx-cal__cell.is-today .rx-cal__num:hover { background: var(--rx-brand-700); }
.rx-event { display: block; width: 100%; text-align: left; border: 0; font-size: .7rem; padding: 2px 6px; border-radius: 4px; background: var(--rx-brand-50); color: var(--rx-brand-600); white-space: normal;word-break: break-word; font-weight: 600; }
html[data-theme="dark"] .rx-event { color: var(--rx-brand-700); }
.rx-event--meeting { background: var(--rx-info-bg); color: var(--rx-info); }
.rx-event--call { background: var(--rx-success-bg); color: var(--rx-success); }
.rx-event--task { background: var(--rx-warning-bg); color: var(--rx-warning); }
.rx-event--reminder { background: var(--rx-neutral-bg); color: var(--rx-neutral); }
@media (max-width: 767.98px) { .rx-cal__cell { min-height: 64px; } .rx-event { font-size: 0; padding: 0; height: 6px; width: 6px; border-radius: 50%; display: inline-block; } .rx-cal__events { display: flex; flex-wrap: wrap; gap: 3px; } }

/* Settings rows */
.rx-setting { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: .9rem 0; border-bottom: 1px solid var(--rx-border); }
.rx-setting:last-child { border-bottom: 0; }
.rx-setting__title { font-weight: 600; }
.rx-setting__desc { font-size: var(--rx-fs-sm); color: var(--rx-text-muted); }
.rx-scope { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: .1rem .45rem; border-radius: 4px; margin-left: .5rem; vertical-align: middle; }
.rx-scope--local { background: var(--rx-success-bg); color: var(--rx-success); }
.rx-scope--backend { background: var(--rx-warning-bg); color: var(--rx-warning); }

/* Notifications */
.rx-notice { display: flex; gap: .85rem; padding: .95rem 1.15rem; border-bottom: 1px solid var(--rx-border); align-items: flex-start; }
.rx-notice:last-child { border-bottom: 0; }
.rx-notice.is-unread { background: var(--rx-brand-50); }
.rx-notice__icon { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--rx-surface-2); color: var(--rx-brand-600); flex: 0 0 auto; }
.rx-notice__body { flex: 1 1 auto; min-width: 0; }
.rx-notice__title { font-weight: 600; }
.rx-notice__time { font-size: var(--rx-fs-xs); color: var(--rx-text-muted); }

/* Auth layout */
.rx-auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--rx-bg); }
.rx-auth__panel { background: var(--rx-sidebar-bg); color: #d5dcec; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; }
.rx-auth__panel h2 { color: #fff; font-size: 1.9rem; max-width: 24ch; }
.rx-auth__panel p { color: #aeb8cc; max-width: 46ch; }
.rx-auth__facts { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .75rem; }
.rx-auth__facts li { display: flex; gap: .65rem; align-items: flex-start; color: #cdd5e6; }
.rx-auth__facts .bi { color: #7f9bff; margin-top: .15rem; }
.rx-auth__form { display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; }
.rx-auth__box { width: 100%; max-width: 420px; }
.rx-auth__box h1 { font-size: 1.6rem; }
@media (max-width: 991.98px) { .rx-auth { grid-template-columns: 1fr; } .rx-auth__panel { display: none; } }

/* Error page */
.rx-404 { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 2rem 1rem; }
.rx-404__code { font-size: clamp(4rem, 14vw, 7.5rem); font-weight: 800; letter-spacing: -.04em; color: var(--rx-brand-500); line-height: 1; }

/* Utilities */
.rx-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rx-gap-sm { gap: .5rem; }
.rx-link-card { color: inherit; display: block; }
.rx-link-card:hover { text-decoration: none; border-color: var(--rx-border-strong); }
.rx-priority-high { color: var(--rx-danger); }
.rx-priority-medium { color: var(--rx-warning); }
.rx-priority-low { color: var(--rx-text-faint); }
.rx-overdue { color: var(--rx-danger); font-weight: 600; }
.rx-task-done .rx-task-title { text-decoration: line-through; color: var(--rx-text-muted); }

@media print { .rx-sidebar, .rx-topbar, .rx-footer, .btn { display: none !important; } .rx-main { margin: 0; } }

/* Compact density (Settings > Appearance) */
html[data-density="compact"] .rx-table tbody td { padding-top: .35rem; padding-bottom: .35rem; }
html[data-density="compact"] .rx-table thead th { padding-top: .45rem; padding-bottom: .45rem; }
html[data-density="compact"] .rx-card__body { padding: .85rem; }
html[data-density="compact"] .rx-kpi { padding: .8rem .9rem; }
html[data-density="compact"] .rx-list > li { padding-top: .55rem; padding-bottom: .55rem; }

/* Flex children must be allowed to shrink so long emails/titles wrap instead of overflowing */
.min-w-0 { min-width: 0; }
.rx-list > li > div { min-width: 0; overflow-wrap: anywhere; }
.rx-list > li > .rx-badge, .rx-list > li > .dropdown { flex: 0 0 auto; }

html[data-theme="dark"] .nav-tabs { --bs-nav-tabs-link-active-color: var(--rx-brand-700); }
html[data-theme="dark"] .nav-pills { --bs-nav-pills-link-active-bg: var(--rx-brand-600); }

/* Theme-aware danger colour (Bootstrap's fixed red fails contrast on dark surfaces) */
.btn-outline-danger { --bs-btn-color: var(--rx-danger); --bs-btn-border-color: var(--rx-danger); --bs-btn-hover-bg: var(--rx-danger); --bs-btn-hover-border-color: var(--rx-danger); --bs-btn-hover-color: #fff; --bs-btn-active-bg: var(--rx-danger); --bs-btn-active-border-color: var(--rx-danger); --bs-btn-active-color: #fff; }
html[data-theme="dark"] .btn-outline-danger { --bs-btn-hover-color: #1b0a09; --bs-btn-active-color: #1b0a09; }
.text-danger { color: var(--rx-danger) !important; }

/* One consistent, high-contrast keyboard focus indicator for every control (replaces Bootstrap's faint rings) */
.btn:focus-visible, .btn-check:focus-visible + .btn, .form-check-input:focus-visible, .page-link:focus-visible, .nav-link:focus-visible,
.accordion-button:focus-visible, .dropdown-item:focus-visible, .btn-close:focus-visible, .form-control:focus-visible, .form-select:focus-visible {
  outline: 2px solid var(--rx-focus); outline-offset: 2px; box-shadow: none;
}
.form-control:focus-visible, .form-select:focus-visible { outline-offset: 0; }
.btn-check:focus-visible + .btn { border-color: var(--rx-focus); }
.rx-sidebar :focus-visible, .rx-auth__panel :focus-visible { outline-color: #a9bbff; }
