/*--------------------------------------------------------------
# General
--------------------------------------------------------------*/
.font8 {
  font-size: 0.5rem;
}

.font9 {
  font-size: 0.5625rem;
}

.font10 {
  font-size: 0.625rem;
}

.font12 {
  font-size: 0.75rem;
}

.font14 {
  font-size: 0.875rem;
}

.font15 {
  font-size: 0.9375rem;
}

.font16 {
  font-size: 1rem;
}

.font18 {
  font-size: 1.125rem;
}

.font20 {
  font-size: 1.25rem;
}

.font22 {
  font-size: 1.375rem;
}

.font24 {
  font-size: 1.5rem;
}

.font26 {
  font-size: 1.625rem;
}

.colorGray1 {
    color: #CCCCCC;
}

.colorGray2 {
    color: #555555;
}

.colorGray3 {
    color: #333333;
}

.colorRed1 {
  color: #ed3c0d;
}

.colorRed2 {
  color: #CC0000;
}

.colorGreen1 {
  color: #009933;
}

.colorOrange1 {
  color: #FF9933;
}

.colorOrange2 {
  color: #FF6600;
}

.colorYellow1 {
  color: #FEBF41;
}

.colorBlackTrue {
  color: #000000;
}

.colorBlack1 {
  color: #777777;
}

.colorBlue1 {
  color: #6699FF;
}

.colorBlue2 {
  color: #025be2;
}

.colorPurple1 { 
  color: #9966cc; 

}

.backgroundBlue1 { 
    background-color: #7eb4ea; 
}

.backgroundOrange1 { 
    background-color: #ffb770; 
}

.backgroundRow1 { 
    background-color: #f2f2f2; 
}

.backgroundTransparent {
    background-color: transparent !important; 
}

.fontBold {
    font-weight: bold;
}

.fontNormal {
    font-weight: normal;
}

.table1 {
    border-collapse: collapse;
    width: 100%;
}

.column1 {
    border: 1px solid #dddddd; 
    padding: 12px; 
    text-align: left;
}

.alignLeft {
    text-align: left;
}

.alignRight {
    text-align: right;
}

.lineHeight105 {
    line-height: 105%;
}

.lineHeight110 {
    line-height: 110%;
}

.lineHeight125 {
    line-height: 125%;
}

.lineHeight150 {
    line-height: 150%;
}

.lineHeight175 {
    line-height: 175%;
}

.borderNone {
    border: none;
}

.transitionNone {
    transition: none !important;
}

.resizeNone {
    resize: none !important;
}

.padding-20 {
  padding: 20px;
}

.padding-1 {
  padding: 1px;
}

.padding-bottom-10 {
  padding-bottom: 10px;
}

.padding-bottom-15 {
  padding-bottom: 15px;
}

.padding-bottom-20 {
  padding-bottom: 20px;
}

.padding-top-10 {
  padding-top: 10px;
}

.padding-top-15 {
  padding-top: 15px;
}

.padding-top-20 {
  padding-top: 20px;
}

.padding-left-5 {
  padding-left: 5px;
}

.padding-left-10 {
  padding-left: 10px;
}

.padding-left-15 {
  padding-left: 15px;
}

.padding-custom-1 {
  padding: 0.375rem 0.25rem;
}

.margin-bottom-10 {
  margin-bottom: 10px;
}

.height1 { height: 1px; }
.height10 { height: 10px; }
.height30 { height: 30px; }
.height50 { height: 50px; }

.width99P { width: 99%; }
.width95P { width: 95%; }
.width90P { width: 90%; }

/* Badge styling for roles, statuses, categories */
.table-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
}

.table-badge.badge-primary {
    background-color: #e7f3ff;
    --badge-color: #0d6efd;    color: var(--badge-color);
}

.table-badge.badge-warning {
    background-color: #fff3cd;
    --badge-color: #856404;    color: var(--badge-color);
}

.table-badge.badge-secondary {
    background-color: #e2e3e5;
    --badge-color: #383d41;    color: var(--badge-color);
}

.table-badge.badge-success {
    background-color: #d4edda;
    --badge-color: #155724;    color: var(--badge-color);
}

.table-badge.badge-danger {
    background-color: #f8d7da;
    --badge-color: #721c24;    color: var(--badge-color);
}

.table-badge.badge-info {
    background-color: #d1ecf1;
    --badge-color: #0c5460;    color: var(--badge-color);
}

/* Status indicators with dots */
.table-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
}

.table-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.table-status.active .table-status-dot {
    background-color: #28a745;
}

.table-status.inactive .table-status-dot {
    background-color: #dc3545;
}

.table-status.pending .table-status-dot {
    background-color: #ffc107;
}

.table-status.suspended .table-status-dot {
    background-color: #6c757d;
}

/* Status badges (with background like roles) */
.table-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
}

.table-status-badge.active {
    background-color: #f7fef9;
    --badge-color: #4ade80;    color: var(--badge-color);
    border: 1px solid #bbf7d0;
}

.table-status-badge.inactive {
    background-color: #fffafa;
    --badge-color: #f87171;    color: var(--badge-color);
    border: 1px solid #fecaca;
}

.table-status-badge.pending {
    background-color: #fffef5;
    --badge-color: #facc15;    color: var(--badge-color);
    border: 1px solid #fde68a;
}

.table-status-badge.suspended {
    background-color: #fafbfc;
    --badge-color: #9ca3af;    color: var(--badge-color);
    border: 1px solid #e5e7eb;
}

/* Prospect status badges - unique color for each status */
/* Status 1 - New Lead: Orange (KEEP ORIGINAL) */
.table-badge.new-lead {
    background-color: #ffe9cb;
    --badge-color: #fe8a17;    color: var(--badge-color);
    border: 1px solid #feb971;
}

/* Status 2 - Qualified Prospect: Light Blue */
.table-badge.qualified-prospect {
    background-color: #e0f2fe;
    --badge-color: #0284c7;    color: var(--badge-color);
    border: 1px solid #71bbe2;
}

/* Status 3 - Needs Assessed: Purple */
.table-badge.needs-assessed {
    background-color: #f3e5f5;
    --badge-color: #8e24aa;    color: var(--badge-color);
    border: 1px solid #c084cf;
}

/* Status 4 - Info Sent: Brown/Tan */
.table-badge.info-sent {
    background-color: #efebe9;
    --badge-color: #6d4c41;    color: var(--badge-color);
    border: 1px solid #ae9b95;
}

/* Status 5 - Follow Up: Navy */
.table-badge.follow-up {
    background-color: #E0F7FA;
    --badge-color: #00B8D4;    color: var(--badge-color);
    border: 1px solid #80DEEA;
}

/* Status 6 - Pricing Completed: Deep Blue */
.table-badge.pricing-completed {
    background-color: #FFE5EE;
    --badge-color: #FF6B9D;    color: var(--badge-color);
    border: 1px solid #FFB3C8;
}

/* Status 7 - Agreement Reached: Lime */
.table-badge.agreement-reached {
    background-color: #EDE7F6;
    --badge-color: #7C4DFF;    color: var(--badge-color);
    border: 1px solid #B39DDB;
}

/* Status 8 - Payment Received: Green (KEEP ORIGINAL) */
.table-badge.payment-received {
    background-color: #e6f7ec;
    --badge-color: #009933;    color: var(--badge-color);
    border: 1px solid #73cb8f;
}

/* Status 9 - Go Live Date Set: Charcoal background with white text */
.table-badge.go-live-date-set {
    background-color: #FFF8E1;
    --badge-color: #FFB300;    color: var(--badge-color);
    border: 1px solid #FFD54F;
}

/* Status badges - ultra light backgrounds */
.table-status-badge.active {
    background-color: #fcfeff;
    --badge-color: #4ade80;    color: var(--badge-color);
    border: 1px solid #bbf7d0;
}

.table-status-badge.inactive {
    background-color: #fffdfd;
    --badge-color: #f87171;    color: var(--badge-color);
    border: 1px solid #fecaca;
}

.table-status-badge.pending {
    background-color: #fffffd;
    --badge-color: #facc15;    color: var(--badge-color);
    border: 1px solid #fde68a;
}

.table-status-badge.suspended {
    background-color: #fdfdfd;
    --badge-color: #9ca3af;    color: var(--badge-color);
    border: 1px solid #e5e7eb;
}

/* ===== TABLE CARD STYLES (Avatar + User Info Display) ===== */
.table-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.table-card-media-wrap {
  position: relative;
  flex-shrink: 0;
}

.table-card-status {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--card-bg, #fff);
}

.table-card-status.online {
  background-color: #28a745;
}

.table-card-status.offline {
  background-color: #6c757d;
}

.table-card-info {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}

.table-card-title {
  font-weight: 500;
  color: var(--heading-color, #212529);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-card-title:hover {
  color: var(--accent-color, #0d6efd);
}

.table-card-subtitle {
  font-size: 0.8125rem;
  color: var(--muted-color, #6c757d);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-card-title-text {
  font-weight: 500;
  color: var(--heading-color, #212529);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* AVATAR ACCENT COLORS - Ultra Light & Muted with darker text */
.table-card-avatar.accent-primary {
    background-color: #bfdbfe;
    color: #1e40af;
}

.table-card-avatar.accent-success {
    background-color: #bbf7d0;
    color: #15803d;
}

.table-card-avatar.accent-danger {
    background-color: #fecaca;
    color: #b91c1c;
}

.table-card-avatar.accent-warning {
    background-color: #fde68a;
    color: #b45309;
}

.table-card-avatar.accent-info {
    background-color: #bae6fd;
    color: #0369a1;
}

.table-card-avatar.accent-purple {
    background-color: #e9d5ff;
    color: #7c3aed;
}

.table-card-avatar.accent-pink {
    background-color: #fbcfe8;
    color: #be185d;
}

.table-card-avatar.accent-teal {
    background-color: #ccfbf1;
    color: #0f766e;
}

.table-card-avatar.accent-orange {
    background-color: #fed7aa;
    color: #c2410c;
}

/* Compact avatar - Ultra Light & Muted with darker text */
.table-card-compact .table-card-avatar.accent-primary {
    background-color: #bfdbfe;
    color: #1e40af;
}

.table-card-compact .table-card-avatar.accent-success {
    background-color: #bbf7d0;
    color: #15803d;
}

.table-card-compact .table-card-avatar.accent-danger {
    background-color: #fecaca;
    color: #b91c1c;
}

.table-card-compact .table-card-avatar.accent-warning {
    background-color: #fde68a;
    color: #b45309;
}

.table-card-compact .table-card-avatar.accent-info {
    background-color: #bae6fd;
    color: #0369a1;
}

.table-card-compact .table-card-avatar.accent-purple {
    background-color: #e9d5ff;
    color: #7c3aed;
}

.table-card-compact .table-card-avatar.accent-pink {
    background-color: #fbcfe8;
    color: #be185d;
}

.table-card-compact .table-card-avatar.accent-teal {
    background-color: #ccfbf1;
    color: #0f766e;
}

.table-card-compact .table-card-avatar.accent-orange {
    background-color: #fed7aa;
    color: #c2410c;
}

/* Role badges - ORIGINAL COLORS */
.table-badge.master-admin {
  background-color: #f3e8ff;
  --badge-color: #7c3aed;  color: var(--badge-color);
}

.table-badge.admin {
  background-color: #dbeafe;
  --badge-color: #2563eb;  color: var(--badge-color);
}

.table-badge.manager {
  background-color: #d1fae5;
  --badge-color: #059669;  color: var(--badge-color);
}

.table-badge.sales {
  background-color: #fed7aa;
  --badge-color: #ea580c;  color: var(--badge-color);
}

.table-badge.basic-user {
  background-color: #f3f4f6;
  --badge-color: #4b5563;  color: var(--badge-color);
}

/* Fallback for every status vocabulary as well as for roles, so it is bordered like the
   status family rather than left flat like the role chips around it. */
.table-badge.unknown {
  background-color: #fee2e2;
  --badge-color: #dc2626;  color: var(--badge-color);
  border: 1px solid #ed8484;
}

/* Project status badges - ORIGINAL COLORS */
.table-badge.cancelled {
    background-color: #fdd;
    --badge-color: #ed3c0d;    color: var(--badge-color);
    border: 1px solid #f49b88;
}

.table-badge.blocked {
    background-color: #fdd;
    --badge-color: #ed3c0d;    color: var(--badge-color);
    border: 1px solid #f49b88;
}

.table-badge.planning {
    background-color: #f3e6ff;
    --badge-color: #9966cc;    color: var(--badge-color);
    border: 1px solid #c6a6e5;
}

.table-badge.in-progress {
    background-color: #fff0db;
    --badge-color: #FF9933;    color: var(--badge-color);
    border: 1px solid #ffc487;
}

.table-badge.submitted {
    background-color: #e3f2fd;
    --badge-color: #025be2;    color: var(--badge-color);
    border: 1px solid #72a8ef;
}

/* Event status 3. Teal, because Approved sits between Submitted (blue) and In Progress
   (orange) and must not be mistaken for Completed (green) on the Events board. */
.table-badge.approved {
    background-color: #e0f7f5;
    --badge-color: #0f9b8e;    color: var(--badge-color);
    border: 1px solid #7fd3ca;
}

.table-badge.review {
    background-color: #e3f2fd;
    --badge-color: #025be2;    color: var(--badge-color);
    border: 1px solid #72a8ef;
}

.table-badge.completed {
    background-color: #e6f7ec;
    --badge-color: #009933;    color: var(--badge-color);
    border: 1px solid #73cb8f;
}

.table-badge.done {
    background-color: #e6f7ec;
    --badge-color: #009933;    color: var(--badge-color);
    border: 1px solid #73cb8f;
}

.table-badge.future {
    background-color: #e8e8e8;
    --badge-color: #777777;    color: var(--badge-color);
    border: 1px solid #afafaf;
}

.table-badge.closed {
    background-color: #e8e8e8;
    --badge-color: #777777;    color: var(--badge-color);
    border: 1px solid #afafaf;
}

.table-badge.event-future {
    background-color: #f3e6ff;
    --badge-color: #9966cc;    color: var(--badge-color);
}

/* Client status badges - ORIGINAL COLORS */
.table-badge.deactivated {
    background-color: #fdd;
    --badge-color: #ed3c0d;    color: var(--badge-color);
    border: 1px solid #f49b88;
}

.table-badge.new-client {
    background-color: #f3e6ff;
    --badge-color: #9966cc;    color: var(--badge-color);
    border: 1px solid #c6a6e5;
}

.table-badge.active-client {
    background-color: #e6f7ec;
    --badge-color: #009933;    color: var(--badge-color);
    border: 1px solid #73cb8f;
}

.table-badge.at-risk {
    background-color: #fff0db;
    --badge-color: #FF9933;    color: var(--badge-color);
    border: 1px solid #ffc487;
}

.table-badge.dormant {
    background-color: #e8e8e8;
    --badge-color: #777777;    color: var(--badge-color);
    border: 1px solid #afafaf;
}

/* Active flag, .table-badge family. The dotted .table-status-badge.active / .inactive pair
   further up is the one list tables use; these are for the breadcrumb badge in _Layout,
   which renders .table-badge. Colours are borrowed unchanged from .active-client and
   .dormant so the two families agree. */
.table-badge.active {
    background-color: #e6f7ec;
    --badge-color: #009933;    color: var(--badge-color);
    border: 1px solid #73cb8f;
}

.table-badge.inactive {
    background-color: #e8e8e8;
    --badge-color: #777777;    color: var(--badge-color);
    border: 1px solid #afafaf;
}

.table-badge.deleted {
    background-color: #efd9d9;
    --badge-color: #5c1a1a;    color: var(--badge-color);
    border: 1px solid #c98b8b;
}

.table-badge-sm {
    display: inline-flex;
    align-items: center;
    padding: 0.1875rem 0.5rem;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.table-badge-sm.planning {
    background-color: #f3e6ff;
    --badge-color: #9966cc;    color: var(--badge-color);
    border: 1px solid #c6a6e5;
}

.table-badge-sm.in-progress {
    background-color: #fff0db;
    --badge-color: #FF9933;    color: var(--badge-color);
    border: 1px solid #ffc487;
}

.table-badge-sm.blocked {
    background-color: #fdd;
    --badge-color: #ed3c0d;    color: var(--badge-color);
    border: 1px solid #f49b88;
}

.table-badge-sm.review {
    background-color: #e3f2fd;
    --badge-color: #025be2;    color: var(--badge-color);
    border: 1px solid #72a8ef;
}

.table-badge-sm.completed {
    background-color: #e6f7ec;
    --badge-color: #009933;    color: var(--badge-color);
    border: 1px solid #73cb8f;
}

.table-badge-sm.closed {
    background-color: #e8e8e8;
    --badge-color: #777777;    color: var(--badge-color);
    border: 1px solid #afafaf;
}

/* Status badges - ORIGINAL COLORS */
.table-status-badge.active {
    background-color: #d4edda;
    --badge-color: #155724;    color: var(--badge-color);
}

.table-status-badge.inactive {
    background-color: #f8d7da;
    --badge-color: #721c24;    color: var(--badge-color);
}

/* Deleted. Deliberately darker than .inactive: a deleted record is only ever shown to an
   admin, and it must not be mistaken for one that is merely switched off. */
.table-status-badge.deleted {
    background-color: #efd9d9;
    --badge-color: #5c1a1a;    color: var(--badge-color);
}

.table-status-badge.pending {
    background-color: #fff3cd;
    --badge-color: #856404;    color: var(--badge-color);
}

.table-status-badge.suspended {
    background-color: #e2e3e5;
    --badge-color: #383d41;    color: var(--badge-color);
}

.table-status-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.table-status-badge.active .table-status-badge-dot {
    background-color: #28a745;
}

.table-status-badge.inactive .table-status-badge-dot {
    background-color: #dc3545;
}

.table-status-badge.deleted .table-status-badge-dot {
    background-color: #8b1a1a;
}

.table-status-badge.pending .table-status-badge-dot {
    background-color: #ffc107;
}

.table-status-badge.suspended .table-status-badge-dot {
    background-color: #6c757d;
}

/* ===== TABLE INSIGHT CARDS (Generic for filtering) ===== */
.table-insight-row {
    display: flex;
    gap: 12px;
    flex-wrap: nowrap;
}

.table-insight {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 6px;
    background-color: #f8f9fa;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    height: 31px;
}

.table-insight:hover {
    background-color: #e9ecef;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.table-insight.active {
    border-color: #0d6efd;
    background-color: #e7f3ff;
}

.table-insight-icon {
    font-size: 1.125rem;
    color: #6c757d;
    line-height: 1;
    display: flex;
    align-items: center;
}

.table-insight.active .table-insight-icon {
    color: #0d6efd;
}

.table-insight-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    line-height: 1;
}

.table-insight-label {
    font-size: 0.75rem;
    color: #6c757d;
    font-weight: 500;
}

.table-insight-value {
    font-size: 1rem;
    font-weight: 700;
    color: #212529;
}

.table-insight-meta {
    font-size: 0.625rem;
    color: #6c757d;
    display: none;
}

/* Specific insight card colors */
.table-insight-total .table-insight-icon {
    color: #0d6efd;
}

.table-insight-active .table-insight-icon {
    color: #198754;
}

.table-insight-pending .table-insight-icon {
    color: #ffc107;
}

.table-insight-inactive .table-insight-icon {
    color: #dc3545;
}

.table-insight-total.active {
    border-color: #0d6efd;
    background-color: #e7f3ff;
}

.table-insight-active.active {
    border-color: #198754;
    background-color: #d4edda;
}

.table-insight-pending.active {
    border-color: #ffc107;
    background-color: #fff3cd;
}

.table-insight-inactive.active {
    border-color: #dc3545;
    background-color: #f8d7da;
}

/* Deleted filter chip. Only ever rendered for an admin - see Helpers/RecordState.cs. */
.table-insight-deleted .table-insight-icon {
    color: #8b1a1a;
}

.table-insight-deleted.active {
    border-color: #8b1a1a;
    background-color: #efd9d9;
}

.table-insight-urgent .table-insight-icon {
    color: #ed3c0d;
}

.table-insight-high .table-insight-icon {
    color: #ff9933;
}

.table-insight-medium .table-insight-icon {
    color: #6699ff;
}

.table-insight-low .table-insight-icon {
    color: #009933;
}

.table-insight-urgent.active {
    border-color: #ed3c0d;
    background-color: #fdd;
}

.table-insight-high.active {
    border-color: #ff9933;
    background-color: #fff0db;
}

.table-insight-medium.active {
    border-color: #6699ff;
    background-color: #e3f2fd;
}

.table-insight-low.active {
    border-color: #009933;
    background-color: #e6f7ec;
}

/* The filter chips in dark mode (2026-10-05) - every rule above is a light-only colour, so on every board (the
   detail pages, By Status) they were bright white boxes. The theme's surfaces and text instead; the selected chip
   keeps its coloured border - which already reads on dark - over a faint lift rather than its pastel fill. */
[data-theme=dark] .table-insight {
    background-color: var(--table-stripe-bg);
    border-color: var(--border-color-light);
}
[data-theme=dark] .table-insight:hover {
    background-color: var(--border-color-light);
    box-shadow: none;
}
[data-theme=dark] .table-insight.active,
[data-theme=dark] :is(.table-insight-total, .table-insight-active, .table-insight-pending, .table-insight-inactive,
                      .table-insight-deleted, .table-insight-urgent, .table-insight-high, .table-insight-medium,
                      .table-insight-low).active {
    background-color: rgba(255, 255, 255, 0.07);
}
[data-theme=dark] .table-insight-label,
[data-theme=dark] .table-insight-meta {
    color: var(--muted-color);
}
[data-theme=dark] .table-insight-value {
    color: var(--heading-color);
}
[data-theme=dark] .table-insight-deleted .table-insight-icon {
    color: #e4a0a0;                     /* #8b1a1a is invisible on dark */
}
[data-theme=dark] .table-insight-deleted.active {
    border-color: #e4a0a0;
}

/* ===== TABLE SCROLL WRAPPER ===== */
/* Scroll container for a detail tab whose content is fields rather than a table.
   .table-scroll-wrapper cannot do this job: it fixes tbody to calc(100vh - 440px), which is right
   for a pane that is nothing but a table and wrong for one with headings and fields above it,
   where the fixed block pushes the page below the fold. Do not nest the two. */
/* Sign Out, pinned in the sidebar footer above the support card rather than placed last in the
   nav list - expanding the Admin or Master Admin groups would otherwise push it down or out of
   view. Shaped to sit with .sidebar-help-card below it: same padding, radius and gap, a solid
   border against that card's dashed one so the two read as separate things. */
.sidebar-signout {
  display: flex;
  align-items: center;
  justify-content: center; /* centred, unlike the left-aligned help card below it */
  gap: 6px;
  padding: 8px 10px;
  border-radius: var(--radius-lg, 0.75rem);
  border: 1px solid var(--sidebar-border, var(--border-color));
  color: var(--sidebar-muted-color);
  font-size: 0.66rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-fast, 0.15s);
}

.sidebar-signout:hover {
  color: #ed3c0d;
  border-color: #f49b88;
  background-color: #fdd;
}

.sidebar-signout-icon {
  display: inline-flex;
  align-items: center;
  font-size: 0.9rem;
}

/* Chrome above a detail tab's content: header 64, page padding 32, page header and breadcrumb ~78,
   card padding 24, tab row ~62, plus the card and page bottom padding. Tune this one number if a
   detail pane ends short of the fold (raise it) or runs past it (lower it); everything below
   follows from it. Anything added above the tabs eats into the same budget - a full-width banner
   on BelmarkCustomerDetail cost about 80px and pushed the panes below the fold. */
:root {
  --detail-pane-offset: 390px;
}

/* For a pane whose content is fields: the whole pane scrolls. */
.detail-pane-scroll {
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(100vh - var(--detail-pane-offset));
  padding-right: 4px; /* keeps the scrollbar off the field borders */
}

/* For a pane that has fixed content above a list, where only the list should scroll. The extra
   allowance covers what sits above and below it inside the pane - on the customer overview that
   is a row of fields, a heading and a footnote. */
.detail-list-scroll {
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(100vh - var(--detail-pane-offset) - 170px);
}

.table-scroll-wrapper {
  position: relative;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md, 0.5rem);
  overflow: hidden; /* Prevents scrollbar on wrapper itself */
}

.table-scroll-wrapper table {
  margin-bottom: 0;
  display: block;
  width: 100%;
}

.table-scroll-wrapper thead {
  display: table;
  width: 100%;
  table-layout: fixed;
}

.table-scroll-wrapper thead th {
  position: sticky;
  top: 0;
  background-color: var(--table-header-bg);
  z-index: 10;
  box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1);
  border-bottom: 2px solid var(--border-color);
}

/* CRITICAL: Fixed height on tbody prevents fluctuation, scrollbar only here */
.table-scroll-wrapper tbody {
  display: block;
  overflow-y: auto; /* Scrollbar appears here only */
  overflow-x: hidden;
  width: 100%;
  height: calc(100vh - 440px); /* Changed from max-height to height */
  min-height: calc(100vh - 440px); /* Ensures minimum height */
}

.table-scroll-wrapper tbody tr {
  display: table;
  width: 100%;
  table-layout: fixed;
}

/* Custom scrollbar styling for tbody only */
.table-scroll-wrapper tbody::-webkit-scrollbar {
  width: 8px;
}

.table-scroll-wrapper tbody::-webkit-scrollbar-track {
  background: var(--background-color, #f8f9fa);
  border-radius: 4px;
}

.table-scroll-wrapper tbody::-webkit-scrollbar-thumb {
  background: var(--border-color-dark, #cbd5e0);
  border-radius: 4px;
}

.table-scroll-wrapper tbody::-webkit-scrollbar-thumb:hover {
  background: var(--muted-color, #94a3b8);
}

/* Firefox scrollbar for tbody only */
.table-scroll-wrapper tbody {
  scrollbar-width: thin;
  scrollbar-color: var(--border-color-dark, #cbd5e0) var(--background-color, #f8f9fa);
}

/* Dark mode support for sticky header */
[data-theme=dark] .table-scroll-wrapper thead th {
  background-color: var(--table-header-bg);
}

/* Striped and hovered rows keep the theme's text colour (2026-10-01). main.css sets the table's colour and the
   stripe and hover BACKGROUNDS, but not Bootstrap's striped/hover/active TEXT colours, which default to its
   light-theme emphasis colour, #000 - the app themes with data-theme, never data-bs-theme, so Bootstrap never
   switches. In dark mode every odd row's plain text was near-black on near-black (Clients, Reminders' dates ...). */
.table {
  --bs-table-striped-color: var(--default-color);
  --bs-table-hover-color: var(--default-color);
  --bs-table-active-color: var(--default-color);
}

/* Maintain table striped appearance within scroll wrapper */
.table-scroll-wrapper .table-striped tbody tr:nth-of-type(odd) {
  background-color: var(--table-stripe-bg);
}

/* Maintain table hover appearance within scroll wrapper */
.table-scroll-wrapper .table-hover tbody tr:hover {
  background-color: var(--table-hover-bg);
  cursor: pointer;
}

/* Optional: size variants */
.table-scroll-wrapper-sm tbody {
  max-height: 300px;
}

.table-scroll-wrapper-lg tbody {
  max-height: 700px;
}

/* Custom Assignee Dropdown */
.custom-assignee-dropdown {
  position: relative;
  width: 100%;
}

/* Custom Assignee Dropdown Trigger - Borderless until interaction */
.custom-assignee-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  background-color: var(--input-bg, #fff);
  border: 1px solid transparent;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 38px;
}

.custom-assignee-trigger .bi-chevron-down {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.custom-assignee-trigger:hover,
.custom-assignee-trigger:focus,
.custom-assignee-trigger.active {
  border-color: var(--input-border, #ced4da);
  background-color: var(--input-bg, #fff);
}

.custom-assignee-trigger:hover .bi-chevron-down,
.custom-assignee-trigger:focus .bi-chevron-down,
.custom-assignee-trigger.active .bi-chevron-down {
  opacity: 1;
}

.custom-assignee-trigger:focus {
  outline: none;
  border-color: var(--accent-color, #0d6efd);
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.custom-assignee-trigger.active {
  border-color: var(--accent-color, #0d6efd);
}

.assignee-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.assignee-placeholder {
  color: var(--muted-color, #6c757d);
  font-size: 0.875rem;
}

.custom-assignee-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 0.25rem;
  background-color: var(--card-bg, #fff);
  border: 1px solid var(--input-border, #ced4da);
  border-radius: 0.25rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  z-index: 1050;
  max-height: 300px;
  display: none;
}

.custom-assignee-menu.show {
  display: block;
}

.assignee-search {
  margin: 0.5rem;
  width: calc(100% - 1rem);
  border-radius: 0.25rem;
}

.assignee-options {
  max-height: 240px;
  overflow-y: auto;
  padding: 0.25rem 0;
}

.assignee-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.assignee-option:hover {
  background-color: var(--light-color, #f8f9fa);
}

.assignee-option.selected {
  background-color: rgba(13, 110, 253, 0.1);
}

.assignee-option .assignee-name {
  color: var(--heading-color, #212529);
  font-weight: 500;
  font-size: 0.875rem;
}

/* Status badge in dropdown - match form field font size */
.assignee-option .table-badge,
.assignee-display .table-badge {
  font-size: 1rem !important;
  padding: 0.375rem 0.75rem;
  font-weight: 500;
}

/* Priority badge in dropdown - match form field font size */
.assignee-option .badge,
.assignee-display .badge {
  font-size: 1rem !important;
  padding: 0.25rem 0.75rem;
  font-weight: 500;
}

/* ===== USER AVATAR INITIALS STYLES =====
   Circular avatars with pastel backgrounds and darker text for user initials.
   Provides 30 distinct color variations for diverse name combinations. */

/* Base avatar styles */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 600;
    text-transform: uppercase;
    flex-shrink: 0;
}

/* Avatar size variants */
.avatar-sm {
    width: 28px;
    height: 28px;
    font-size: 0.625rem;
}

.avatar-md {
    width: 36px;
    height: 36px;
    font-size: 0.75rem;
}

.avatar-lg {
    width: 48px;
    height: 48px;
    font-size: 1rem;
}

.avatar-xl {
    width: 64px;
    height: 64px;
    font-size: 1.25rem;
}

/* Avatar color variants - 30 distinct pastel colors with darker text */

/* Blues Family (5 shades) */
.avatar.avatar-blue {
    background-color: #dbeafe;
    --avatar-color: #1e3a8a;    color: var(--avatar-color);
}

.avatar.avatar-sky {
    background-color: #e0f2fe;
    --avatar-color: #0c4a6e;    color: var(--avatar-color);
}

.avatar.avatar-cyan {
    background-color: #cffafe;
    --avatar-color: #155e75;    color: var(--avatar-color);
}

.avatar.avatar-indigo {
    background-color: #e0e7ff;
    --avatar-color: #3730a3;    color: var(--avatar-color);
}

.avatar.avatar-teal {
    background-color: #ccfbf1;
    --avatar-color: #115e59;    color: var(--avatar-color);
}

/* Greens Family (5 shades) */
.avatar.avatar-green {
    background-color: #d1fae5;
    --avatar-color: #065f46;    color: var(--avatar-color);
}

.avatar.avatar-emerald {
    background-color: #d1fae5;
    --avatar-color: #047857;    color: var(--avatar-color);
}

.avatar.avatar-mint {
    background-color: #d1f4e0;
    --avatar-color: #064e3b;    color: var(--avatar-color);
}

.avatar.avatar-lime {
    background-color: #ecfccb;
    --avatar-color: #3f6212;    color: var(--avatar-color);
}

.avatar.avatar-sage {
    background-color: #d4e9d7;
    --avatar-color: #14532d;    color: var(--avatar-color);
}

/* Purples & Violets Family (5 shades) */
.avatar.avatar-purple {
    background-color: #e9d5ff;
    --avatar-color: #6b21a8;    color: var(--avatar-color);
}

.avatar.avatar-violet {
    background-color: #ede9fe;
    --avatar-color: #5b21b6;    color: var(--avatar-color);
}

.avatar.avatar-lavender {
    background-color: #f3e8ff;
    --avatar-color: #581c87;    color: var(--avatar-color);
}

.avatar.avatar-fuchsia {
    background-color: #fae8ff;
    --avatar-color: #86198f;    color: var(--avatar-color);
}

.avatar.avatar-plum {
    background-color: #f5e7fa;
    --avatar-color: #701a75;    color: var(--avatar-color);
}

/* Pinks & Roses Family (5 shades) */
.avatar.avatar-pink {
    background-color: #fce7f3;
    --avatar-color: #9f1239;    color: var(--avatar-color);
}

.avatar.avatar-rose {
    background-color: #ffe4e6;
    --avatar-color: #881337;    color: var(--avatar-color);
}

.avatar.avatar-coral {
    background-color: #fed7d7;
    --avatar-color: #7f1d1d;    color: var(--avatar-color);
}

.avatar.avatar-blush {
    background-color: #ffe4e8;
    --avatar-color: #9f1239;    color: var(--avatar-color);
}

.avatar.avatar-mauve {
    background-color: #f8e4f0;
    --avatar-color: #831843;    color: var(--avatar-color);
}

/* Oranges & Yellows Family (5 shades) */
.avatar.avatar-orange {
    background-color: #fed7aa;
    --avatar-color: #9a3412;    color: var(--avatar-color);
}

.avatar.avatar-amber {
    background-color: #fef3c7;
    --avatar-color: #78350f;    color: var(--avatar-color);
}

.avatar.avatar-yellow {
    background-color: #fef3c7;
    --avatar-color: #92400e;    color: var(--avatar-color);
}

.avatar.avatar-peach {
    background-color: #ffedd5;
    --avatar-color: #7c2d12;    color: var(--avatar-color);
}

.avatar.avatar-gold {
    background-color: #fef9c3;
    --avatar-color: #713f12;    color: var(--avatar-color);
}

/* Reds & Neutrals Family (5 shades) */
.avatar.avatar-red {
    background-color: #fee2e2;
    --avatar-color: #991b1b;    color: var(--avatar-color);
}

.avatar.avatar-slate {
    background-color: #e2e8f0;
    --avatar-color: #334155;    color: var(--avatar-color);
}

.avatar.avatar-gray {
    background-color: #e5e7eb;
    --avatar-color: #374151;    color: var(--avatar-color);
}

.avatar.avatar-stone {
    background-color: #e7e5e4;
    --avatar-color: #44403c;    color: var(--avatar-color);
}

.avatar.avatar-zinc {
    background-color: #e4e4e7;
    --avatar-color: #3f3f46;    color: var(--avatar-color);
}

/* Legacy support - Map old accent classes to new avatar classes */
.avatar.accent-primary {
    background-color: #dbeafe;
    color: #1e3a8a;
}

.avatar.accent-success {
    background-color: #d1fae5;
    color: #065f46;
}

.avatar.accent-purple {
    background-color: #e9d5ff;
    color: #6b21a8;
}

.avatar.accent-pink {
    background-color: #fce7f3;
    color: #9f1239;
}

.avatar.accent-orange {
    background-color: #fed7aa;
    color: #9a3412;
}

.avatar.accent-teal {
    background-color: #ccfbf1;
    color: #115e59;
}

.avatar.accent-info {
    background-color: #e0e7ff;
    color: #3730a3;
}

/* Borderless form fields - show border only on hover/focus */
/* Apply this class to any container where you want borderless fields */
.borderless-fields .form-control,
.borderless-fields .form-select {
  border-color: transparent;
  transition: border-color 0.2s ease;
}

.borderless-fields .form-control:hover,
.borderless-fields .form-select:hover {
  border-color: var(--input-border, #ced4da);
}

.borderless-fields .form-control:focus,
.borderless-fields .form-select:focus {
  border-color: var(--accent-color, #0d6efd);
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.label-tight {
  margin-bottom: 0.25rem !important;
}

.label-tight2 {
  margin-bottom: 0.10rem !important;
}

/* Priority badges inline with kanban card "Ticket" label — compact vertical size */
.kanban-card-description.d-flex {
  overflow: visible;
  line-height: 1;
}

.kanban-card-description.d-flex .priority-badge {
  padding-top: 3px;
  padding-bottom: 3px;
}

/* ===== PRIORITY BADGES (matching table-badge pattern with background + border) ===== */
.priority-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1875rem 0.5rem;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Priority: Urgent (Red/Danger) */
.priority-badge.urgent {
  background-color: #fdd;
  --badge-color: #ed3c0d;  color: var(--badge-color);
  border: 1px solid #ed3c0d;
}

/* Priority: High (Orange/Warning) */
.priority-badge.high {
  background-color: #fff0db;
  --badge-color: #ff9933;  color: var(--badge-color);
  border: 1px solid #ff9933;
}

/* Priority: Medium (Blue/Info) */
.priority-badge.medium {
  background-color: #e3f2fd;
  --badge-color: #6699ff;  color: var(--badge-color);
  border: 1px solid #6699ff;
}

/* Priority: Low (Green/Success) */
.priority-badge.low {
  background-color: #e6f7ec;
  --badge-color: #009933;  color: var(--badge-color);
  border: 1px solid #009933;
}

/*--------------------------------------------------------------
# Inpage Popup Modal (shared across all detail pages)
--------------------------------------------------------------*/

/* Translucent charcoal backdrop */
.modal-backdrop.show {
  background-color: rgba(0, 0, 0, 0.7) !important;
}

/* Ensure modals sit above any custom elements */
.modal {
  z-index: 2000;
}

/* Wide variant used on detail pages */
.modal-dialog.modal-custom-xl {
  max-width: 70%;
  width: 96vw;
}

/* ===== ASSIGNEE PILL STRIP (Kanban filter) ===== */
.assignee-pill-strip {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    margin-bottom: 10px;
}

.assignee-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px 3px 4px;
    border-radius: 20px;
    border: 2px solid transparent;
    background-color: #f0f0f0;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    font-size: 0.78rem;
    user-select: none;
}

.assignee-pill:hover {
    background-color: #e2e6ea;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}

.assignee-pill.active {
    border-color: #0d6efd;
    background-color: #e7f3ff;
}

.assignee-pill.all-pill {
    font-weight: 600;
    color: #495057;
}

.assignee-pill.all-pill.active {
    border-color: #0d6efd;
    background-color: #e7f3ff;
    color: #0d6efd;
}

.assignee-pill-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.6rem;
    flex-shrink: 0;
}

.assignee-pill-name {
    color: #495057;
    font-size: 0.78rem;
}

/* Overflow +N pill */
.assignee-pill-overflow {
    position: relative;
}

.assignee-pill-overflow-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #ced4da;
    background-color: #f0f0f0;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 700;
    color: #495057;
    transition: all 0.15s ease;
    user-select: none;
}

.assignee-pill-overflow-btn:hover,
.assignee-pill-overflow-btn.open {
    background-color: #dee2e6;
    border-color: #0d6efd;
    color: #0d6efd;
}

.assignee-pill-overflow-btn.has-active {
    border-color: #0d6efd;
    background-color: #e7f3ff;
    color: #0d6efd;
}

.assignee-overflow-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 1050;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    min-width: 180px;
    padding: 6px 0;
}

.assignee-overflow-dropdown.open {
    display: block;
}

.assignee-overflow-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    cursor: pointer;
    font-size: 0.8rem;
    color: #495057;
    transition: background 0.1s;
}

.assignee-overflow-item:hover {
    background-color: #f8f9fa;
}

.assignee-overflow-item.active {
    background-color: #e7f3ff;
    color: #0d6efd;
    font-weight: 600;
}

.assignee-overflow-item .assignee-pill-avatar {
    width: 22px;
    height: 22px;
    font-size: 0.55rem;
}

/* The person filter in dark mode (2026-10-06) - pills, the "All" pill, the +N button and its list were all light-only
   colours. The theme's surfaces and text; the selected pill keeps the theme accent as its border. The avatars inside
   take their own dark style from the .avatar-* rule. */
[data-theme=dark] .assignee-pill,
[data-theme=dark] .assignee-pill-overflow-btn {
    background-color: var(--table-stripe-bg);
    border-color: var(--border-color-light);
}
[data-theme=dark] .assignee-pill:hover,
[data-theme=dark] .assignee-pill-overflow-btn:hover,
[data-theme=dark] .assignee-pill-overflow-btn.open {
    background-color: var(--border-color-light);
    box-shadow: none;
}
[data-theme=dark] .assignee-pill.active,
[data-theme=dark] .assignee-pill.all-pill.active,
[data-theme=dark] .assignee-pill-overflow-btn.has-active {
    border-color: var(--accent-color);
    background-color: rgba(255, 255, 255, 0.07);
}
[data-theme=dark] .assignee-pill.all-pill,
[data-theme=dark] .assignee-pill-name,
[data-theme=dark] .assignee-pill-overflow-btn,
[data-theme=dark] .assignee-overflow-item {
    color: var(--default-color);
}
[data-theme=dark] .assignee-pill.all-pill.active,
[data-theme=dark] .assignee-pill-overflow-btn.has-active,
[data-theme=dark] .assignee-overflow-item.active {
    color: var(--heading-color);
}
[data-theme=dark] .assignee-overflow-dropdown {
    background: var(--surface-color);
    border-color: var(--border-color);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
[data-theme=dark] .assignee-overflow-item:hover {
    background-color: var(--border-color-light);
}
[data-theme=dark] .assignee-overflow-item.active {
    background-color: rgba(255, 255, 255, 0.07);
}

/* ===== ASSIGNEE PILL STRIP — vertical variant (between insights and kanban) ===== */
.assignee-pill-strip-vertical {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    padding-top: 26px;
    /* Keep the strip within the board so a large team cannot push past it */
    max-height: calc(100vh - 360px);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
}

/* Circle-only pills: no name, fixed size */
.assignee-pill-strip-vertical .assignee-pill {
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    justify-content: center;
    gap: 0;
}

.assignee-pill-strip-vertical .assignee-pill-name {
    display: none;
}

/* "All" pill as a compact circle */
.assignee-pill-strip-vertical .all-pill {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
    font-size: 0.6rem;
}

/* Overflow dropdown opens to the right in vertical mode */
.assignee-pill-strip-vertical .assignee-overflow-dropdown {
    top: 0;
    left: calc(100% + 6px);
}

/* ==========================================================================
   Global search dropdown (header search box)
   Markup lives in _Layout.cshtml, behaviour in global-search.js.
   ========================================================================== */

/* The panel hangs off .header-search, which main.css leaves static. */
.header-search {
    position: relative;
}

.global-search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 1050;
    max-height: 70vh;
    overflow-y: auto;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 4px;
}

.global-search-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    background: transparent;
    border-radius: var(--radius-sm);
    text-align: left;
    color: var(--default-color);
}

.global-search-item:hover,
.global-search-item.active {
    background: var(--sidebar-hover-bg);
}

.global-search-icon {
    flex: 0 0 auto;
    font-size: 1.125rem;              /* matches .sidebar .nav-icon i */
    line-height: 1;
    color: var(--muted-color);
}

.global-search-text {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.global-search-title,
.global-search-subtitle {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.global-search-subtitle {
    font-size: 0.75rem;
    color: var(--muted-color);
}

/* Sits inside .global-search-title, in parens right after the name, so the record type reads
   with the name instead of across the panel from it. */
.global-search-type {
    font-size: 0.8rem;
    color: var(--muted-color);
}

.global-search-all {
    display: block;
    padding: 8px 10px;
    margin-top: 4px;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    text-decoration: none;
    color: var(--accent-color);
}

.global-search-empty {
    padding: 12px 10px;
    font-size: 0.85rem;
    color: var(--muted-color);
}

/* Result counts in the global search tab strip.
   Inherits the tab's own colour -- muted on an inactive tab, heading colour on the active one --
   so the number reads as part of the label instead of greying out against it. Follows
   .board-col-count on the status boards, without its opacity dimming. */
.search-tab-count {
    color: inherit;
    font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Campaign email designer (Pages/Shared/_EmailDesignerPartial.cshtml)
   Behaviour in wwwroot/assets/js/campaign-designer.js. Rendered by the campaign
   wizard step 4 and by the Email Design tab on CampaignDetail.
   ========================================================================== */
#quillEmailWrapper {
    border: 1px solid #ced4da;
    border-radius: 4px;
    transition: border-color 0.2s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}
#quillEmailWrapper .ql-toolbar.ql-snow {
    border: none;
    border-bottom: 1px solid #ced4da;
    flex-shrink: 0;
    border-radius: 4px 4px 0 0;
    overflow: visible;
}
#quillEmailWrapper:focus-within {
    border-color: var(--accent-color);
}
#quillEmailWrapper .ql-container.ql-snow {
    border: none;
    font-family: inherit;
    font-size: 0.9375rem;
    flex: 1 1 0;
    overflow: auto;
    min-height: 0;
}
#quillEmailWrapper .ql-editor {
    min-height: 100%;
    background: repeating-linear-gradient(
        45deg,
        #f0f0f0,
        #f0f0f0 6px,
        #e0e0e0 6px,
        #e0e0e0 12px
    );
}
/* List markers inherit the text color set by Quill's color picker */
.ql-editor li::marker,
#emailCanvasContent li::marker,
#emailFullPreviewContent li::marker {
    color: inherit;
}
/* Show actual px values in the Quill size picker instead of "Normal" */
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value]::before {
    content: attr(data-value);
}
/* Lift the picker dropdowns above the editor body, and let a long list scroll rather than run
   past #quillEmailWrapper, which clips with overflow:hidden.
   Do NOT set position:fixed here. Quill's own rule puts top:100% on this element; under
   ixed that resolves against the viewport instead of the .ql-picker, so the menu opens a
   full screen height down and is never seen. That is what made the size, colour, background
   and align pickers all look dead. */
.ql-snow .ql-picker.ql-expanded .ql-picker-options {
    z-index: 9999;
    max-height: 260px;
    overflow-y: auto;
}

/* Insert Button color swatches */
.btn-color-swatch {
    display: inline-block;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color .15s;
}
.btn-color-swatch.selected, .btn-color-swatch:hover {
    border-color: #000;
}
.ql-editor .ql-indent-9  { padding-left: 27em; }
.ql-editor .ql-indent-10 { padding-left: 30em; }
.ql-editor .ql-indent-11 { padding-left: 33em; }
.ql-editor .ql-indent-12 { padding-left: 36em; }
.ql-editor .ql-indent-13 { padding-left: 39em; }
.ql-editor .ql-indent-14 { padding-left: 42em; }
.ql-editor .ql-indent-15 { padding-left: 45em; }
.ql-editor .ql-indent-16 { padding-left: 48em; }
.ql-editor .ql-indent-17 { padding-left: 51em; }
.ql-editor .ql-indent-18 { padding-left: 54em; }
.ql-editor .ql-indent-19 { padding-left: 57em; }
.ql-editor .ql-indent-20 { padding-left: 60em; }
/* Background swatches (modal) */
.bg-thumb {
    width: 100px;
    height: 68px;
    object-fit: cover;
    border-radius: 5px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.1s ease;
}
.bg-thumb:hover { transform: scale(1.04); }
.bg-thumb.selected { border-color: var(--accent-color); box-shadow: 0 0 0 2px rgba(var(--accent-color-rgb,13,110,253),0.4); }
.bg-thumb-item {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 0.7rem;
    color: #6c757d;
    cursor: pointer;
}
.bg-thumb-item.hidden-item { display: none !important; }
.bg-color-swatch {
    width: 68px;
    height: 68px;
    border-radius: 5px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.1s ease;
}
.bg-color-swatch:hover { transform: scale(1.06); }
.bg-color-swatch.selected { border-color: var(--accent-color); box-shadow: 0 0 0 2px rgba(var(--accent-color-rgb,13,110,253),0.4); }
#bgThumbGrid { display: flex; flex-wrap: wrap; gap: 10px; padding: 0.5rem 0; }
#bgPickerModal .modal-body { max-height: 60vh; overflow-y: auto; }
/* Preview pane */
#emailPreviewOuter {
    position: relative;
    height: 100%;
    border-radius: 6px;
    overflow: hidden;
    background: #e9ecef;
}
/* Shared email canvas - always 1200px wide, scaled to fit context */
#emailCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 1200px;
    transform-origin: top left;
}
#emailCanvasBg {
    position: absolute;
    inset: 0;
    background: #f5f5f5 center/cover no-repeat;
    transition: background 0.25s ease;
    z-index: 0;
}
#emailCanvasOverlay {
    position: absolute;
    inset: 0;
    background: #000;
    opacity: 0;
    pointer-events: none;
    z-index: 1;
}
/* Header stripe - sits above content, below nothing */
#emailCanvasHeader, #fullPreviewHeader {
    position: relative;
    z-index: 3;
    width: 100%;
    min-height: 80px;
    display: none;
    align-items: center;
    padding: 0 1.5rem;
    box-sizing: border-box;
}
#emailCanvasHeaderText, #fullPreviewHeaderText {
    width: 100%;
    font-size: 22px;
    font-weight: 700;
    font-family: Arial, sans-serif;
    color: #ffffff;
    word-break: break-word;
}
#emailCanvasContent {
    position: relative;
    z-index: 2;
    width: 100%;
    margin: 0;
    padding: 1.5rem 1rem;
    min-height: 100%;
}
#emailCanvasContent.ql-editor,
#emailFullPreviewContent.ql-editor {
    padding: 1.5rem 1rem;
}
#emailCanvasContent.preview-empty::after {
    content: 'Your email will appear here...';
    color: #adb5bd;
    font-style: italic;
    display: block;
}
/* Large modal shows the canvas at near-native size */
#emailFullPreviewModal .modal-body {
    overflow: hidden;
    position: relative;
}
#emailCanvasLarge {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    position: relative;
}
/* Two-pane editor row: explicit height like the audience table in Step 3 */
/* The offset is what sits above the designer, which differs per host: the wizard stacks a step
   heading and the subject/from row over it, CampaignDetail a tab strip. Hosts override the
   variable rather than the rule. */
.email-designer-row {
    height: calc(100vh - var(--email-designer-offset, 530px));
    min-height: 200px;
    display: flex;
    flex-direction: row;
    align-items: stretch;
}

/* CampaignDetail: less chrome above than the wizard, but a Save row below it and a card edge to
   clear, so the pane needs its own offset and a real bottom buffer. */
#emailPane {
    --email-designer-offset: 560px;
    padding-bottom: 1.25rem;
}
.email-designer-row > .col-md-6 {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}

/* =====================================================================================
   PRINT
   =====================================================================================

   main.css already carries a generic print block - black on white, table borders, repeated
   table headers, no page breaks inside a row. This adds what is specific to this app, and
   it is mostly about two things.

   **Unclipping.** Every list and every board sits in a container with a fixed height and
   its own scrollbar, built with calc(100vh - Npx). On paper there is no viewport and no
   scrollbar, so those containers simply cut the content off at whatever the screen height
   happened to be. They have to become auto-height and visible or most of what you asked
   for never reaches the page.

   **Removing the controls.** A printed search box, tab strip, filter rail or pagination
   bar is furniture for something you cannot do on paper. main.css hides .btn already, but
   not the wrappers those buttons sit in, which leaves gaps where a toolbar used to be.

   Known limit, worth saying out loud: a list prints the rows currently on screen, because
   that is all the page ever loaded. Printing is for the view in front of you. Use Export
   with "All results" when the whole set is what is wanted.
   ===================================================================================== */

.print-only {
    display: none;
}

@media print {

    .print-only {
        display: block;
    }

    .print-timestamp {
        font-size: 0.8rem;
        color: #444 !important;
        margin-bottom: 8px;
    }

    /* --- Let long content break across sheets ---------------------------------------- */
    /* Bootstrap's .card is a flex container, and a flex container does not fragment: the browser
       moves the whole thing to the next sheet rather than splitting it. With a full list inside
       one card that means sheet one carries the title and nothing else, and the table starts on
       sheet two. Plain blocks break where they need to.

       min-height goes with it. .main keeps a calc(100vh - header) floor, which on paper is a whole
       empty sheet held open underneath short content. */
    .card,
    .card-body,
    .section,
    .row,
    .col-lg-12,
    .tab-content,
    .table-scroll-wrapper {
        display: block !important;
        min-height: 0 !important;

        /* main.css sets page-break-inside: avoid on .card, which is right for a card holding a
           chart or a summary and wrong for one holding a whole list: the browser cannot split it,
           so a long list is moved to the next sheet whole and the first one carries the title
           alone. Short lists fitted, which is why this only showed up on "print the whole list". */
        page-break-inside: auto !important;
        break-inside: auto !important;
    }

    .main,
    .main-content,
    .tab-pane {
        min-height: 0 !important;
    }

    /* Only the tab you are looking at prints. Bootstrap hides the others with display:none, and an
       earlier version of this block overrode that - which printed the By Status board after the
       list and left several sheets of empty columns behind it. */
    .tab-pane:not(.active) {
        display: none !important;
    }


    /* --- Put the list table back together ------------------------------------------- */

    /* On screen this table is not laid out as a table at all: the sticky header and the single
       scrollbar are built by making the table a block, the head a table, the body a block with a
       fixed calc(100vh - 440px) height, and each row its own table. That is why printing gave one
       page however many rows were loaded - the body was still a fixed-height scroller with the
       rest below the fold. Print needs an actual table, so the head repeats on every sheet and the
       body flows. */
    .table-scroll-wrapper table {
        display: table !important;
        table-layout: fixed;
    }

    .table-scroll-wrapper thead {
        display: table-header-group !important;
    }

    .table-scroll-wrapper thead th {
        position: static !important;
        box-shadow: none !important;
    }

    .table-scroll-wrapper tbody {
        display: table-row-group !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .table-scroll-wrapper tbody tr {
        display: table-row !important;
    }

    /* --- Unclip everything else that scrolls on screen ------------------------------- */
    .table-scroll-wrapper,
    .detail-pane-scroll,
    .detail-list-scroll,
    .email-designer-row,
    .col-theme .card-body,
    .card-body,
    .tab-content,
    .main,
    .main-content {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    /* --- Controls that mean nothing on paper ---------------------------------------- */
    .table-insight-row,
    .table-insight,
    .assignee-pill-strip,
    .assignee-pill-strip-vertical,
    .nav-tabs,
    .input-group,
    .btn-group,
    .sort-icons-vertical,
    #paginationNav,
    .pagination,
    .page-header .d-flex.align-items-center.gap-2,
    form[id^="frmSearch"] {
        display: none !important;
    }

    /* The sort links stay as plain text: the column heading is still wanted, the link is not. */
    .sort-link {
        text-decoration: none !important;
        color: #000 !important;
    }

    /* --- The table itself ----------------------------------------------------------- */
    /* Striping costs ink and reads worse than plain rules on paper. */
    .table-striped > tbody > tr:nth-of-type(odd) > * {
        background-color: transparent !important;
    }

    .table {
        width: 100% !important;
        font-size: 0.75rem;
    }

    /* A row that navigates is a screen affordance; on paper it is just a row. */
    .table tbody tr {
        cursor: default !important;
    }

    /* --- Boards --------------------------------------------------------------------- */
    /* Columns print down the page rather than across it. Five or ten columns squeezed into
       the width of a sheet are unreadable, and a board is a list once it is on paper. */
    .col-theme {
        width: 100% !important;
        max-width: 100% !important;
        page-break-inside: avoid;
    }

    .kanban-card {
        page-break-inside: avoid;
    }
}

/* The truncation notice on a printed list. Deliberately not quiet: somebody handed an incomplete
   printout has no other way to know it is incomplete. See Helpers/PrintLimits.cs. */
@media print {
    .print-truncated {
        font-size: 0.8rem;
        font-weight: 600;
        color: #000 !important;
        border: 1px solid #000;
        padding: 4px 8px;
        margin-bottom: 10px;
        display: inline-block;
    }
}

/* Chrome that is not wired to anything yet. These came from the template pointing at .html files
   that do not exist here; belmark.js stops them navigating, and this stops them looking clickable.
   Deliberately not display:none - the layout is the thing being kept, and hiding these would leave
   gaps that look like a rendering fault rather than a decision. */
a.placeholder-link {
    cursor: default;
    opacity: 0.55;
}

a.placeholder-link:hover,
a.placeholder-link:focus {
    opacity: 0.55;
    text-decoration: none;
}

/* =====================================================================================
   DASHBOARDS CALENDAR
   =====================================================================================

   The calendar came from a template page where it was the only thing on screen, under a
   header and a page title and nothing else. Here it sits inside a card, inside a tab pane,
   under a tab strip - roughly another 130px of chrome the template never accounted for -
   and it brought two sizing rules that assumed otherwise:

     .calendar-app  min-height: calc(100vh - 200px)   too tall by the difference
     .calendar-day  min-height: 120px                 six rows is 720px before anything else

   Both are overridden here rather than in main.css, and scoped to this pane so the styles
   stay untouched for anything else that ever uses them.

   The offset is a variable so it can be tuned in one place without hunting through a calc.
   ===================================================================================== */

#calendarPane {
    --dashboard-calendar-offset: 330px;

}

#calendarPane .calendar-app {
    min-height: 0;
    height: calc(100vh - var(--dashboard-calendar-offset));
}

/* Bounding the height above was not enough on its own, because .card is a flex column and
   .card-body is flex:1 1 auto with the default min-height:auto - which means it refuses to
   shrink below its own content and grows straight past the bound it was given. Every link
   in that chain needs min-height:0 before the scroll will ever engage. That one property
   is the whole difference between a calendar that fits and one that pushes the page down. */
#calendarPane .calendar-main,
#calendarPane .calendar-main > .card {
    min-height: 0;
}

#calendarPane .calendar-main .card-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

/* Rows divide the height rather than setting it, so a month always fits and nothing scrolls.

   The row count is a constant, which is what makes this exact: renderMonthView always pads to
   42 day cells, so the grid is the day-name row plus six week rows in every month, whether that
   month needs six or not. A fraction of the remaining height is therefore always a sixth, and
   there is no arithmetic to keep in step with the offset above.

   The trade: on a short screen the cells get small rather than the grid scrolling. That is the
   choice asked for - never overflow - and a day holds a count now, which stays legible a lot
   further down than a list of titles would. */
#calendarPane .calendar-scroll-wrapper,
#calendarPane .calendar-main .tab-content,
#calendarPane #monthView {
    height: 100%;
    min-height: 0;
}

#calendarPane .calendar-grid {
    height: 100%;
    grid-template-rows: auto repeat(6, 1fr);
}

#calendarPane .calendar-day {
    position: relative;
    min-height: 0;
    height: auto;
    overflow: hidden;
}

/* The date sits in the corner and the badges sit in the middle of the whole cell (Mark). Both are
   taken out of the flow, so the date no longer pushes the badges down and every day's badges land
   in the same place whatever the row height. */
#calendarPane .calendar-day .day-number {
    position: absolute;
    top: 4px;
    left: 4px;
    margin: 0;
}

#calendarPane .day-counts {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    align-content: center;
    gap: 4px;
    flex-wrap: wrap;
    margin: 0;
    padding: 0 4px;
}

#calendarPane .day-count {
    font-size: 0.65rem;
    padding: 2px 6px;
    line-height: 1.1;
}

/* main.css gives a warning badge dark text; the tickets-due badge uses white like the others (Mark). */
#calendarPane .day-count.bg-warning {
    color: #fff;
}

/* Only a day with something on it goes anywhere, so only that one looks like it will. */
#calendarPane .calendar-day.has-items {
    cursor: pointer;
}

#calendarPane .calendar-day.has-items:hover {
    background-color: var(--bs-tertiary-bg, #f1f3f5);
}

/* One scrollbar in the sidebar, and it belongs to the Coming up list (Mark). The sidebar used to
   scroll as a whole while the template also capped the list at 300px with its own scroller, so the
   two took turns. Now the sidebar does not scroll: the mini calendar keeps its height, the Coming up
   card takes whatever is left, and only its list scrolls. The same holds in the off-canvas drawer
   below 992px, which already has a fixed height of its own. */
#calendarPane .calendar-sidebar {
    min-height: 0;
    overflow: hidden;
}

@media (min-width: 992px) {
    #calendarPane .calendar-sidebar {
        max-height: calc(100vh - var(--dashboard-calendar-offset));
    }
}

#calendarPane .calendar-sidebar > .card:last-child {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

#calendarPane .upcoming-events {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
}

/* Source toggles in the header, beside Day/Week/Month. Sized to the view buttons so the row reads
   as one line, but rounded and separate rather than a joined group, because any number of these can
   be on where only one view can. On = tinted in the source's own colour; off = plain with a hollow
   dot. --source-color is set inline per button. */
#calendarPane .calendar-sources {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

#calendarPane .calendar-source {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.2;
    color: var(--muted-color);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 50rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

#calendarPane .calendar-source:hover {
    border-color: var(--source-color);
    color: var(--default-color);
}

#calendarPane .calendar-source.active {
    color: var(--default-color);
    border-color: var(--source-color);
    background: color-mix(in srgb, var(--source-color), transparent 88%);
}

#calendarPane .calendar-source-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--source-color);
    flex-shrink: 0;
}

#calendarPane .calendar-source.active .calendar-source-dot {
    background: var(--source-color);
}

#calendarPane .calendar-source-count {
    font-size: 0.75rem;
    color: var(--muted-color);
    background: color-mix(in srgb, var(--default-color), transparent 90%);
    padding: 0.05rem 0.45rem;
    border-radius: 10px;
}

/* Day and Week scroll inside the card rather than running past the bottom of the page.

   Month needs no scrollbar because its rows divide the height, but these two are hour grids -
   their height is the day, not the space available - so they have to scroll somewhere. Only
   #monthView was given a bounded height, so the other two took their content's height and
   pushed their scrollbars below the fold. */
#calendarPane #dayView,
#calendarPane #weekView {
    height: 100%;
    min-height: 0;
}

#calendarPane .day-view,
#calendarPane .week-view {
    height: 100%;
    overflow-y: auto;
}

/* One scroller, not two. The template gives the hour grid its own capped scroller
   (max-height 600px, lower in its container queries), which nested inside the one above made
   the two scrollbars take turns and drift apart. It also left the header outside the grid's
   scroller, so the grid was a scrollbar's width narrower and its seven columns slid out of
   line with the header's. Letting the view do all the scrolling fixes both. */
#calendarPane .week-body,
#calendarPane .day-view-body {
    max-height: none;
    overflow: visible;
}

/* The header stays put while the hours scroll under it. The template's header background is
   97% transparent, so it is laid over the card's surface colour here - otherwise the hours
   show through it as they pass. z-index clears the events, which sit at 1. */
#calendarPane .week-header,
#calendarPane .day-view-header {
    position: sticky;
    top: 0;
    z-index: 2;
    background:
        linear-gradient(color-mix(in srgb, var(--default-color), transparent 97%),
                        color-mix(in srgb, var(--default-color), transparent 97%)),
        var(--surface-color);
}

/* =====================================================================================
   DASHBOARDS PROSPECTS
   ===================================================================================== */

/* The template spaces pipeline rows 1.5rem apart. Ten rows at that spacing pushed the card below
   the fold, so rows sit 1rem apart here (Mark, 2026-09-16). Scoped to this tab so the template's
   spacing is untouched anywhere else .pipeline-stages is used. */
#prospectsPane .pipeline-stages {
    gap: 1rem;
}

/* Prospects by Owner: the donut's legend. The template's Deal Sources card uses .legend-item,
   .legend-dot, .legend-label and .legend-value but main.css never defines them, so they are
   defined here - one row per owner, dot and name on the left, count and share on the right. */
:is(#prospectsPane, #salesPane, #projectsPane, #enterprisePane, #masterDashboard, #reportsPage, .widget-body) .owner-legend {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

:is(#prospectsPane, #salesPane, #projectsPane, #enterprisePane, #masterDashboard, #reportsPage, .widget-body) .legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

:is(#prospectsPane, #salesPane, #projectsPane, #enterprisePane, #masterDashboard, #reportsPage, .widget-body) .legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

:is(#prospectsPane, #salesPane, #projectsPane, #enterprisePane, #masterDashboard, #reportsPage, .widget-body) .legend-label {
    flex: 1;
    min-width: 0;
    color: var(--default-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

:is(#prospectsPane, #salesPane, #projectsPane, #enterprisePane, #masterDashboard, #reportsPage, .widget-body) .legend-value {
    font-weight: 600;
    color: var(--heading-color);
}

/* =====================================================================================
   CHART PALETTE
   =====================================================================================

   Categorical colours for charts where a colour stands for a thing rather than a meaning - a
   person, a source. The first four are the theme's own; the app has only five semantic colours
   and danger reads as "bad", so four more are added here. psbChartTheme() in belmark.js reads
   these, and HTML legends use var(--chart-n), so a dot and its slice always match. The extras get
   lighter in dark mode like the theme's colours do. */
:root {
    --chart-1: var(--accent-color);
    --chart-2: var(--success-color);
    --chart-3: var(--warning-color);
    --chart-4: var(--info-color);
    --chart-5: #7c3aed;
    --chart-6: #db2777;
    --chart-7: #0d9488;
    --chart-8: #65a30d;
}

[data-theme=dark] {
    --chart-5: #a78bfa;
    --chart-6: #f472b6;
    --chart-7: #2dd4bf;
    --chart-8: #a3e635;
}

/* The oldest receivables bucket, 91+ days past due (Helpers/InvoiceMoney.AgingBuckets, 2026-09-19): a deeper
   red than --danger-color, which is 61-90, so the two read as worse and worst. Lighter in dark mode, like the
   extras above. */
:root {
    --aging-severe: #7f1d1d;
}

[data-theme=dark] {
    --aging-severe: #fca5a5;
}

/* Project status colours - the column colours of the Projects board (_ProjectsByStatusPartial), so a
   status is the same colour on the Dashboards Projects tab and the Home widget as it is in the Projects
   area (Mark, 2026-09-19). The board keeps these in dark mode too, so there is no dark override.
   Helpers/ProjectStatusBreakdown and the Project Progress bars pass these names, never the hex. */
:root {
    --project-planning:    #B77EFA;
    --project-in-progress: #FF6600;
    --project-submitted:   #0066FF;
    --project-completed:   #339933;
    --project-future:      #777777;
    --project-cancelled:   #CC0000;

    /* Dashboard charts only - the Projects by Status donuts and the Project Progress bars. At full strength
       the orange took them over, In Progress being usually the largest group (Mark, 2026-09-19). Same hue,
       less saturated and lighter. The Projects board keeps --project-in-progress. */
    --project-in-progress-chart: #EC8F51;
}

/* Newest Prospects rows are links to the prospect, so they need the link styling taken back off
   and a hover to show they go somewhere. */
:is(#prospectsPane, #salesPane, #projectsPane, #enterprisePane, #masterDashboard, #reportsPage, .widget-body) a.newest-prospect {
    color: inherit;
    text-decoration: none;
    transition: background 0.2s;
}

:is(#prospectsPane, #salesPane, #projectsPane, #enterprisePane, #masterDashboard, #reportsPage, .widget-body) a.newest-prospect:hover {
    background: color-mix(in srgb, var(--accent-color), transparent 95%);
}

:is(#prospectsPane, #salesPane, #projectsPane, #enterprisePane, #masterDashboard, #reportsPage, .widget-body) .newest-prospect .table-badge {
    font-size: 0.75rem;
    padding: 2px 8px;
}

/* Needs Attention: capped at about four rows so the pipeline below still shows its header without
   scrolling (Mark, 2026-09-16); anything more scrolls inside the card. The whole row opens the ticket
   (script in _HomeProspectsPartial); the title and company are real links so both work from the
   keyboard too. */
:is(#prospectsPane, #salesPane, #projectsPane, #enterprisePane, #masterDashboard, #reportsPage, .widget-body) .attention-list {
    max-height: 15rem;
    overflow-y: auto;
}

:is(#prospectsPane, #salesPane, #projectsPane, #enterprisePane, #masterDashboard, #reportsPage, .widget-body) .attention-item {
    cursor: pointer;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
    transition: background 0.2s;
}

:is(#prospectsPane, #salesPane, #projectsPane, #enterprisePane, #masterDashboard, #reportsPage, .widget-body) .attention-item:hover {
    background: color-mix(in srgb, var(--accent-color), transparent 95%);
}

:is(#prospectsPane, #salesPane, #projectsPane, #enterprisePane, #masterDashboard, #reportsPage, .widget-body) .attention-title {
    font-weight: 500;
    color: var(--heading-color);
    text-decoration: none;
}

:is(#prospectsPane, #salesPane, #projectsPane, #enterprisePane, #masterDashboard, #reportsPage, .widget-body) .attention-company {
    color: var(--accent-color);
    text-decoration: none;
    font-size: 0.8125rem;
}

:is(#prospectsPane, #salesPane, #projectsPane, #enterprisePane, #masterDashboard, #reportsPage, .widget-body) .attention-company:hover {
    text-decoration: underline;
}

:is(#prospectsPane, #salesPane, #projectsPane, #enterprisePane, #masterDashboard, #reportsPage, .widget-body) .attention-item .task-meta {
    font-size: 0.8125rem;
    min-width: 0;
}

:is(#prospectsPane, #salesPane, #projectsPane, #enterprisePane, #masterDashboard, #reportsPage, .widget-body) .attention-due {
    flex-shrink: 0;
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
}

:is(#prospectsPane, #salesPane, #projectsPane, #enterprisePane, #masterDashboard, #reportsPage, .widget-body) .attention-due.overdue {
    color: var(--danger-color);
}

:is(#prospectsPane, #salesPane, #projectsPane, #enterprisePane, #masterDashboard, #reportsPage, .widget-body) .attention-due.soon {
    color: var(--warning-color);
}

/* Shortcuts beside Needs Attention, two across (Mark, 2026-09-16), so the card is no taller than Needs
   Attention - the row's height is the taller of the two, and a taller row pushes the pipeline below the
   fold. Four jump links make two rows; the divider spans both columns; the three page links fill the
   next two. Bootstrap's list-group borders assume one column, so each item is a borderless tile
   with a hover instead. Jump targets stop below the fixed header. */
:is(#prospectsPane, #salesPane, #projectsPane, #enterprisePane, #masterDashboard, #reportsPage, .widget-body) .prospect-shortcuts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem;
    padding: 0.5rem;
}

:is(#prospectsPane, #salesPane, #projectsPane, #enterprisePane, #masterDashboard, #reportsPage, .widget-body) .prospect-shortcuts .list-group-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    padding: 0.5rem 0.6rem;
    font-size: 0.875rem;
    border: 0;
    border-radius: var(--bs-border-radius);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

:is(#prospectsPane, #salesPane, #projectsPane, #enterprisePane, #masterDashboard, #reportsPage, .widget-body) .prospect-shortcuts .list-group-item i {
    color: var(--accent-color);
    width: 1rem;
    flex-shrink: 0;
    text-align: center;
}

:is(#prospectsPane, #salesPane, #projectsPane, #enterprisePane, #masterDashboard, #reportsPage, .widget-body) .prospect-shortcuts .shortcut-divider {
    grid-column: 1 / -1;
    border-top: 1px solid var(--border-color);
    margin: 0.25rem 0.25rem;
}

#prospectPipelineCard,
#prospectOwnersCard,
#newestProspectsCard,
#ownerStageCard,
#staleProspectsCard,
#staleOwnerCard,
#projectProgressCard,
#projectStatusCard,
#teamWorkloadCard,
#upcomingMilestonesCard,
#tenantsCard,
#tenantGrowthCard,
#salesTrendCard,
#salesAgingCard,
#salesPaymentsCard,
#salesProductsCard {
    scroll-margin-top: calc(var(--header-height, 64px) + 1rem);
}

/* =====================================================================================
   DASHBOARDS PROJECTS
   ===================================================================================== */

/* Needs Attention filter pills (Mark, 2026-09-16): four kinds of trouble share one list, and these narrow
   it to one. Filtering is in the browser; the counts do not change. */
:is(#projectsPane, #enterprisePane) .attention-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

:is(#projectsPane, #enterprisePane) .attention-filter {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 50rem;
    background: transparent;
    color: var(--muted-color);
    cursor: pointer;
}

:is(#projectsPane, #enterprisePane) .attention-filter span {
    font-weight: 600;
    margin-left: 0.15rem;
}

:is(#projectsPane, #enterprisePane) .attention-filter:hover {
    border-color: var(--accent-color);
    color: var(--default-color);
}

:is(#projectsPane, #enterprisePane) .attention-filter.active {
    border-color: var(--accent-color);
    background: color-mix(in srgb, var(--accent-color), transparent 88%);
    color: var(--default-color);
}

/* The kind label in front of each title, so a mixed list scans at a glance. */
:is(#projectsPane, #enterprisePane, #masterDashboard) .attention-kind {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.05rem 0.45rem;
    margin-right: 0.35rem;
    border-radius: 4px;
    vertical-align: 1px;
}

#projectsPane .attention-kind.kind-project   { background: color-mix(in srgb, var(--danger-color), transparent 85%);  color: var(--danger-color); }
#projectsPane .attention-kind.kind-milestone { background: color-mix(in srgb, var(--warning-color), transparent 85%); color: var(--warning-color); }
#projectsPane .attention-kind.kind-blocked   { background: color-mix(in srgb, var(--chart-6), transparent 85%);       color: var(--chart-6); }
#projectsPane .attention-kind.kind-ticket    { background: color-mix(in srgb, var(--info-color), transparent 85%);    color: var(--info-color); }

/* Project Progress: 25 or so rows, so the list scrolls inside the card rather than making the row as tall
   as the page. Rows are links to the project. */
#projectsPane .project-progress {
    max-height: 30rem;
    overflow-y: auto;
}

#projectsPane .project-progress .pipeline-stages {
    gap: 0.9rem;
}

#projectsPane a.project-stage {
    color: inherit;
    text-decoration: none;
    border-radius: 6px;
    padding: 0.2rem 0.35rem;
    margin: -0.2rem -0.35rem;
}

#projectsPane a.project-stage:hover {
    background: color-mix(in srgb, var(--accent-color), transparent 95%);
}

#projectsPane .project-stage .pipeline-stage-header {
    gap: 0.75rem;
    min-width: 0;
}

#projectsPane .project-stage-detail {
    font-size: 0.75rem;
}

/* =====================================================================================
   DASHBOARDS ENTERPRISE
   ===================================================================================== */

/* Needs Attention labels by source tab, and the This Week / Recent Activity labels by tone. The label box
   itself is .attention-kind, shared with the Projects tab. */
#enterprisePane .attention-kind.kind-prospects { background: color-mix(in srgb, var(--info-color), transparent 85%);    color: var(--info-color); }
#enterprisePane .attention-kind.kind-sales     { background: color-mix(in srgb, var(--success-color), transparent 85%); color: var(--success-color); }
#enterprisePane .attention-kind.kind-projects  { background: color-mix(in srgb, var(--danger-color), transparent 85%);  color: var(--danger-color); }

:is(#enterprisePane, #masterDashboard) .attention-kind.tone-primary { background: color-mix(in srgb, var(--accent-color), transparent 85%);  color: var(--accent-color); }
:is(#enterprisePane, #masterDashboard) .attention-kind.tone-success { background: color-mix(in srgb, var(--success-color), transparent 85%); color: var(--success-color); }
:is(#enterprisePane, #masterDashboard) .attention-kind.tone-warning { background: color-mix(in srgb, var(--warning-color), transparent 85%); color: var(--warning-color); }
:is(#enterprisePane, #masterDashboard) .attention-kind.tone-info    { background: color-mix(in srgb, var(--info-color), transparent 85%);    color: var(--info-color); }
:is(#enterprisePane, #masterDashboard) .attention-kind.tone-danger  { background: color-mix(in srgb, var(--danger-color), transparent 85%);  color: var(--danger-color); }

/* This Week and Recent Activity scroll inside their cards, so the row stays the height of its 8-column card. */
#enterprisePane .enterprise-list {
    max-height: 22rem;
    overflow-y: auto;
}

#enterprisePane .enterprise-list .deal-item {
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
}

#enterprisePane .team-table th {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted-color);
    text-transform: uppercase;
    white-space: nowrap;
}

/* Enterprise Needs Attention fills its card rather than stopping at the shared 15rem cap (Mark, 2026-09-16).
   The row is as tall as This Week beside it, so a capped list left empty space under it. The list is taken
   out of the flow and stretched over the card body, so it never sets the row's height itself - This Week
   does, or the body's minimum when This Week is short - and scrolls within whatever height that is. */
#enterprisePane .enterprise-attention .card-body {
    position: relative;
    min-height: 22rem;
}

#enterprisePane .enterprise-attention .attention-list {
    position: absolute;
    inset: 0;
    max-height: none;
    overflow-y: auto;
}

/* Email card: the two-sender summary table reads as the tenant table does. */
#masterDashboard .email-table th {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted-color);
    text-transform: uppercase;
}

#emailCard, #optInCard, #workerCard {
    scroll-margin-top: calc(var(--header-height, 64px) + 1rem);
}

/* =====================================================================================
   REPORTS (item 7, 2026-09-19)
   =====================================================================================
   The list page borrows the Dashboards Shortcuts tiles and the report pages the Sales tab's tiles and cards -
   #reportsPage is in the shared :is(...) scopes above for that. What follows is only what a report adds: a
   money table whose figures line up, client rows that expand to their invoices, and a totals row. */
#reportsPage .report-table th,
#reportsPage .report-table td {
    white-space: nowrap;
    vertical-align: middle;
}

#reportsPage .report-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* A colour dot beside a name, in either the header (AR aging buckets) or a row (Payments Received methods).
   .legend-dot itself is sized for a flex legend and has no display of its own, so a table has to give it one. */
#reportsPage .report-table .legend-dot {
    display: inline-block;
    margin-right: 0.35rem;
}

#reportsPage .report-table .report-empty {
    color: var(--muted-color);
}

#reportsPage .report-group {
    cursor: pointer;
}

#reportsPage .report-group:hover {
    background: color-mix(in srgb, var(--accent-color), transparent 95%);
}

#reportsPage .report-group .report-toggle {
    display: inline-block;
    width: 1rem;
    color: var(--muted-color);
    transition: transform 0.15s;
}

#reportsPage .report-group.open .report-toggle {
    transform: rotate(90deg);
}

#reportsPage .report-detail td {
    font-size: 0.8125rem;
    background: color-mix(in srgb, var(--default-color), transparent 97%);
}

#reportsPage .report-detail td:first-child {
    padding-left: 2.25rem;
}

#reportsPage .report-table tfoot td {
    font-weight: 700;
    border-top: 2px solid var(--border-color);
}

#reportsPage .report-note {
    color: var(--muted-color);
    font-size: 0.875rem;
}

/* A report table scrolls inside its card, header row pinned to the top and totals row to the bottom (Mark,
   2026-09-19), so the page stays above the fold however many clients there are. Not .table-scroll-wrapper: that
   turns every row into its own fixed-layout table (equal-width columns - the client name would be as narrow as a
   money column), has no tfoot, and is sized for a pane that is nothing but a table. This keeps a real table and
   sticks the two rows instead. max-height, not height, so a short report does not leave a gap; the offset is the
   header, title row, tiles and card header above it. */
#reportsPage .report-scroll {
    max-height: calc(100vh - 430px);
    min-height: 16rem;
    overflow-y: auto;
}

#reportsPage .report-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background-color: var(--table-header-bg);
    box-shadow: inset 0 -2px 0 var(--border-color);    /* a border would scroll away with the cell's own box */
}

#reportsPage .report-scroll tfoot td {
    position: sticky;
    bottom: 0;
    z-index: 2;
    background-color: var(--card-bg);
    box-shadow: inset 0 2px 0 var(--border-color);
    border-top: 0;                                       /* the shadow above replaces it while stuck */
}

/* A table in the card beside a report chart (Sales by Period's By Month) scrolls at the chart card's height, so the
   two cards line up: the chart's 300px plus the card body's padding. */
#reportsPage .report-scroll.report-scroll-beside-chart {
    max-height: 340px;
}

#reportsPage .report-chart {
    height: 300px;
}

/* The period picker (Helpers/ReportPeriod): a preset, or Custom with two dates. */
#reportsPage .report-period .form-select,
#reportsPage .report-period .form-control {
    width: auto;
}

/* The Reports list: Shortcuts tiles, one per row - a report name is longer than a jump link. */
#reportsPage .prospect-shortcuts.report-list {
    grid-template-columns: 1fr;
}

/* --- Printing a report (ROADMAP item 7, version 2, 2026-09-22) -------------------------------------------------
   Last in the report section on purpose: these selectors weigh the same as the screen rules above, so anything
   placed before them loses on paper without ever saying why.

   The two-column rows need no help here. Every split on these pages is col-xl-8/col-xl-4, a sheet of paper is
   nowhere near 1200px wide, and the print block further up this file turns a .row into a block anyway - so they
   have already stacked full width by the time this runs. The tiles row is the one that has to be put back. */
@media print {
    /* The whole table prints; nothing is pinned, and nothing is cut off at a scroll box's height. */
    #reportsPage .report-scroll,
    #reportsPage .report-scroll.report-scroll-beside-chart {
        max-height: none;
        min-height: 0;
        overflow: visible;
    }

    #reportsPage .report-scroll thead th,
    #reportsPage .report-scroll tfoot td {
        position: static;
        box-shadow: none;
    }

    /* Bootstrap spaces stacked rows with a gutter, not with margins you can see: every .row carries
       margin-top: calc(-1 * var(--bs-gutter-y)) and every column inside it carries the same figure positive
       (main.css sets --bs-gutter-y to 1.5rem on ALL rows, not only the g-4 ones). On screen the row is a flex
       container, so the two never meet - the row is pulled up and its contents pushed back down.

       On paper the print block above makes a .row a block, and block margins collapse. The previous row's mb-4,
       this row's -1.5rem and its first column's +1.5rem then form ONE collapsing set worth 1.5rem + (-1.5rem) =
       nothing, so the tiles sit flush against the card below them - which is exactly what a chart card, having no
       margin of its own, showed first (Mark, 2026-09-22).

       Dropping the row's negative half is enough. The columns keep their +1.5rem, which on paper is not a gutter
       at all any more but the gap between two cards stacked one above the other, and is doing real work. */
    #reportsPage .row {
        margin-top: 0;
    }

    /* The tiles keep their row across the sheet, and that takes putting the flex back: the print block further up
       this file turns every .row into a block so a card holding a long list can fragment. That is right for the
       cards and wrong for this one - it would stack the tiles one per sheet-width line and spend most of the first
       page before the report had started. The ID outweighs that rule, and !important is needed to reach it at all.

       Three widths because the reports do not agree on one: most run five tiles, Client Activity and Reorder drop
       to four for a reader without CanSeeFinancials, and AR Aging has six. */
    #reportsPage .row-cols-xl-5,
    #reportsPage .row-cols-xl-4,
    #reportsPage .row-cols-xxl-6 {
        display: flex !important;
        flex-wrap: nowrap;
        --bs-gutter-x: 0.5rem;
    }

    #reportsPage .row-cols-xl-5 > .col {
        flex: 0 0 20%;
        max-width: 20%;
    }

    #reportsPage .row-cols-xl-4 > .col {
        flex: 0 0 25%;
        max-width: 25%;
    }

    #reportsPage .row-cols-xxl-6 > .col {
        flex: 0 0 16.6666%;
        max-width: 16.6666%;
    }

    /* A4 inside a 2cm margin is about 640px, so a tile gets 100px or so. The 48px icon and the 1.75rem figure were
       sized for a dashboard card several times that wide. The icon goes entirely: it is the only part of a tile
       carrying no information, and it is the part costing the most width. */
    #reportsPage .widget-stat {
        padding: 0.5rem;
    }

    #reportsPage .widget-stat-icon {
        display: none !important;
    }

    #reportsPage .widget-stat-value {
        font-size: 1.05rem;
    }

    #reportsPage .widget-stat-label,
    #reportsPage .widget-stat-change {
        font-size: 0.7rem;
    }

    /* CSS deliberately does NOT size the chart. A chart is a canvas: CSS can only resample the bitmap the screen
       drew, which came out squashed sideways with parts of it lost (2026-09-22, twice - the first attempt set a
       height of auto, which collapsed ECharts' absolutely positioned canvas and printed nothing at all).
       belmark.js re-draws each chart at the sheet's width on beforeprint instead, so ECharts lays it out again at
       the right size. Anything set here would only fight that - keep it to page breaks. */
    #reportsPage .report-chart {
        page-break-inside: avoid;
    }

    /* The period picker is a control, but WHICH period this is remains part of the answer - a report on paper that
       does not say what it covers is worse than no report at all. So the form stays and only the button goes, with
       the fields flattened to read as text rather than as something still to fill in. */
    #reportsPage .report-period .form-select,
    #reportsPage .report-period .form-control {
        border: 0 !important;             /* main.css draws one on every select and input when printing */
        padding-left: 0;
        background-image: none;
        -webkit-appearance: none;
        appearance: none;
        font-weight: 600;
    }

    /* A table that has to split takes its headings and its totals row with it onto the next sheet. */
    #reportsPage .report-table thead {
        display: table-header-group;
    }

    #reportsPage .report-table tfoot {
        display: table-footer-group;
    }

    #reportsPage .report-table tr,
    #reportsPage .widget-stat,
    #reportsPage .attention-item,
    #reportsPage .deal-item {
        page-break-inside: avoid;
    }

    /* Colour carries meaning on these pages - the aging buckets, the outcome dots, the status badges - so it has to
       survive the printer's habit of dropping backgrounds. */
    #reportsPage .legend-dot,
    #reportsPage .table-badge,
    #reportsPage .pipeline-stage {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* Page notices (_PageNoticeBarPartial, Helpers/PageNotices): a compact bar in the page title row, between the title
   and any page actions, so it never pushes the page content down. Its d-flex/gap-2 classes also hide it when
   printing. */
.page-header .page-notice {
    align-self: center;
    margin-left: auto;
    padding: 0.3rem 0.5rem 0.3rem 0.75rem;
    font-size: 0.85rem;
    max-width: 30rem;
}

.page-header .page-notice .page-notice-text {
    font-weight: 600;
}

.page-header .page-notice .page-notice-more {
    opacity: 0.8;
}

.page-header .page-notice .page-notice-details {
    color: inherit;
    text-decoration: underline;
}

.page-header .page-notice .btn-close {
    font-size: 0.6rem;
}

.page-header .page-notice + .d-flex {
    margin-left: 0;
}

#pageNoticesModal .page-notice-item + .page-notice-item {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Home list widgets (_HomeWidgetListPartial): the dashboard cards' rows, but striped and with the orange hover every
   list page uses (Mark, 2026-09-17), so a widget reads like the list it summarises. The variables are the same ones
   .table-striped and .table-hover take, so both themes follow. */
.widget-body .deal-list .deal-item {
    padding: 0.45rem 0.75rem;
}

.widget-body .deal-list .deal-item:nth-of-type(odd) {
    background-color: var(--table-stripe-bg);
}

/* Wins over the dashboard cards' subtle accent hover above - #homeGrid outweighs their :is(...) list. */
#homeGrid .widget-body .deal-list a.deal-item:hover {
    background: var(--table-hover-bg);
}

/* ── In-app help (ROADMAP item 7c) ───────────────────────────────────────────
   The panel is a component of its own - not Bootstrap's offcanvas - plus the question-mark button and the few
   classes a help fragment may use. Fragments inherit the app's own type and colours on purpose: help that looks
   like the app reads as part of it, and an author writing plain HTML gets that for free. */

.btn-help {
    border: 1px solid var(--input-border);
    color: var(--muted-color);
    background: transparent;
    padding: 1px 8px;
    line-height: 1.6;
    /* No margin of its own - the title row's flex group spaces it (gap-2), so it sits the same distance from a
       page's buttons as they sit from each other. */
}

.btn-help:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
}

/* The panel slides in from the right and has to sit above a modal. Note the number: this app raises .modal to 2000
   (see "Ensure modals sit above any custom elements" earlier in this file), not Bootstrap's 1055, so 1070 put the
   panel underneath the very form it was explaining and out of reach of its own close button (Mark, 2026-09-18).

   It is a plain panel rather than an offcanvas on purpose - see help.js: two Bootstrap overlays at once closed each
   other. No backdrop either, so the form the help is about stays readable and usable while it is open. */
.help-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 2100;
    width: 420px;
    max-width: 92vw;
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    color: var(--default-color);
    border-left: 1px solid var(--border-color);
    box-shadow: -8px 0 24px rgba(0, 0, 0, .12);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform .25s ease, visibility .25s;
}

.help-panel.is-open {
    transform: translateX(0);
    visibility: visible;
}

@media (prefers-reduced-motion: reduce) {
    .help-panel { transition: none; }
}

.help-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.help-panel-title {
    margin: 0;
    font-size: 1rem;
    display: flex;
    align-items: center;
}

.help-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    font-size: 0.875rem;
    line-height: 1.55;
}

/* What a fragment may use. Kept deliberately short: the more classes there are, the more an author has to know. */
.help-panel .help-lead {
    font-size: 0.9rem;
    color: var(--default-color);
    margin-bottom: 1rem;
}

.help-panel h6 {
    margin-top: 1.25rem;
    margin-bottom: 0.35rem;
    font-weight: 600;
    color: var(--heading-color);
}

.help-panel ul {
    padding-left: 1.1rem;
    margin-bottom: 0.75rem;
}

.help-panel li { margin-bottom: 0.25rem; }

.help-panel .help-tip {
    border-left: 3px solid var(--accent-color);
    background: var(--table-stripe-bg);
    padding: 0.5rem 0.75rem;
    border-radius: 0 var(--radius-md, 6px) var(--radius-md, 6px) 0;
    margin: 1rem 0;
}

/* Screenshots run to the panel's width; a walkthrough keeps a 16:9 box so the panel does not jump as it loads. */
.help-panel img {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md, 6px);
    margin: 0.5rem 0;
}

.help-panel .help-video {
    position: relative;
    padding-top: 56.25%;
    margin: 0.75rem 0;
}

.help-panel .help-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: var(--radius-md, 6px);
}

/* The full-page flows (_LayoutNoNav) have no title row to put the button in, so it floats. Below the panel's own
   z-index, so it cannot sit on top of the help it opened. */
.btn-help-floating {
    position: fixed;
    top: 14px;
    right: 18px;
    z-index: 1030;
    background: var(--card-bg);
}

/* In a modal header, Bootstrap gives .btn-close "margin-left: auto", so a button inserted before it lands in the
   middle of the header rather than beside the close (Mark, 2026-09-18). Giving the help button the auto margin and
   taking it off the close puts the pair together at the right. */
.modal-header .btn-help-modal {
    flex: 0 0 auto;
    margin-left: auto;
}

.modal-header .btn-help-modal + .btn-close {
    margin-left: 0;
}

/* ============================================================================
   Support Tickets - the By Status board
   ----------------------------------------------------------------------------
   The Projects/Events board, rule for rule, so the three look the same. Those
   two each keep their own copy inside the partial's <style>; this one lives
   here because custom CSS belongs in this file and a third copy is how three
   boards end up disagreeing. Scoped to .support-board so it reaches neither.
   ========================================================================== */
.support-board .col-theme {
    display: flex;
    flex-direction: column;
}

/* A FIXED width, not Bootstrap's `col-lg` flex: 1 0 0% - so columns never widen
   to fill space left by a hidden one. Picking a status leaves that column where
   it was rather than stretching it across the board (Mark, 2026-09-24).
   One fifth because there are five statuses; the count is fixed by
   Helpers/SupportTicketStatus.All, so if a status is ever added this follows. */
@media (min-width: 992px) {
    .support-board .col-theme {
        flex: 0 0 20%;
        max-width: 20%;
    }
}

.support-board .col-theme .card {
    --bs-card-bg: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.support-board .col-theme .card-body {
    background-color: transparent !important;
    padding: 0;
    box-sizing: border-box;
    /* calc, not a flex-fill chain - CLAUDE.md, Views. */
    height: calc(100vh - 440px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.support-board .col-theme .card-title {
    color: var(--title-color);
    margin-bottom: 4px !important;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
}

.support-board .col-theme h5.card-title {
    padding-bottom: 0 !important;
}

.support-board .col-theme .drop-here {
    padding-bottom: 10px;
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.support-board .col-theme .drop-here table {
    width: 100%;
    height: 40px;
    color: var(--title-color);
    border: 1px solid var(--title-color);
    border-radius: 4px;
    text-align: center;
    border-collapse: separate;
    overflow: hidden;
}

/* The one addition to the house rules: the cell a card is actually over, so a
   drop is never a guess. Invisible until something is being dragged. */
.support-board .col-theme .drop-here td.drop-hover {
    background-color: var(--ticket-background);
    font-weight: 600;
}

/* Who has it, matching .project-leader-badge / .event-leader-badge - the assignee, as on those boards. */
.support-board .ticket-person-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Size only - the COLOUR comes from the .avatar.avatar-* class the server puts
   on it, from Helpers/Avatars, so a person keeps the same colour here as in the
   pill strip and everywhere else. Events and Projects paint their leader avatar
   with the column colour instead, which makes every face in a column identical;
   that is the one thing a per-person colour exists to avoid (Mark, 2026-09-24). */
.support-board .ticket-person-avatar {
    width: 17px;
    height: 17px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.4375rem;
    flex-shrink: 0;
}

.support-board .kanban-card-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

/* ----------------------------------------------------------------------------
   Support ticket badges
   Same colours as the project statuses they sit beside, but their own classes:
   recolouring Planning should not silently recolour New.
   -------------------------------------------------------------------------- */
.table-badge.ticket-new {
    background-color: #f3e6ff;
    --badge-color: #9966cc;    color: var(--badge-color);
    border: 1px solid #c6a6e5;
}

.table-badge.ticket-in-progress {
    background-color: #fff0db;
    --badge-color: #FF9933;    color: var(--badge-color);
    border: 1px solid #ffc487;
}

.table-badge.ticket-waiting {
    background-color: #e3f2fd;
    --badge-color: #025be2;    color: var(--badge-color);
    border: 1px solid #72a8ef;
}

.table-badge.ticket-resolved {
    background-color: #e6f7ec;
    --badge-color: #009933;    color: var(--badge-color);
    border: 1px solid #73cb8f;
}

.table-badge.ticket-closed {
    background-color: #e8e8e8;
    --badge-color: #777777;    color: var(--badge-color);
    border: 1px solid #afafaf;
}

/* Priority, keyed by the stored number so the view needs no lookup table. */
.table-badge.priority-1 {
    background-color: #e8e8e8;
    --badge-color: #777777;    color: var(--badge-color);
    border: 1px solid #afafaf;
}

.table-badge.priority-2 {
    background-color: #e3f2fd;
    --badge-color: #025be2;    color: var(--badge-color);
    border: 1px solid #72a8ef;
}

.table-badge.priority-3 {
    background-color: #fff0db;
    --badge-color: #FF9933;    color: var(--badge-color);
    border: 1px solid #ffc487;
}

.table-badge.priority-4 {
    background-color: #fdd;
    --badge-color: #ed3c0d;    color: var(--badge-color);
    border: 1px solid #f49b88;
}

/* ============================================================================
   Support Tickets - the list, several rows per ticket
   ----------------------------------------------------------------------------
   Each ticket is its details in ordinary columns, and then UNDER them a row
   spanning the full width carrying the subject and the first lines of what the
   customer wrote (Mark, 2026-09-24). A subject is a sentence, not a field: in a
   column beside five others it was truncated, which is the part somebody
   scanning the list actually reads.

   There is no Ticket column heading, because the subject is no longer a column
   - a heading for it would label nothing.

   All of it lives in ONE <tbody>. Giving each ticket its own was the tidier
   idea and was tried first, but Bootstrap's `.table > :not(:first-child)` puts
   a 2px currentColor border on every table section after the first, so every
   ticket drew a heavy rule across the list. Rows carry a record id and a parity
   class instead.

   Which also means .table-striped and .table-hover cannot be used: both work on
   every other <tr>, so they would stripe the parts of one ticket differently
   and cut each record down the middle. The colours below are the same variables
   those classes take, so both themes follow without a second set of rules.

   Backgrounds go on the CELLS, not the row: Bootstrap paints background-color
   on every `.table > * > * > *`, which would sit on top of a row-level colour.
   ========================================================================== */
#ticketsTable tr.ticket-row.record-alt > td {
    background-color: var(--table-stripe-bg);
}

#ticketsTable tr.ticket-row.is-hovered > td {
    background-color: var(--table-hover-bg);
    cursor: pointer;
}

/* No rule between the parts of one ticket - only under the last of them, so the
   lines in this table fall between TICKETS. */
#ticketsTable tr.ticket-row > td {
    border-bottom: 0;
}

#ticketsTable tr.ticket-row.record-end > td {
    border-bottom: 1px solid var(--border-color);
}

#ticketsTable tr.ticket-meta > td {
    padding-bottom: 0.1rem;
}

#ticketsTable tr.ticket-subject > td {
    padding-top: 0.1rem;
    padding-bottom: 0.5rem;
}

/* Its own class rather than .table-card-title, which carries white-space: nowrap
   with an ellipsis and an accent-coloured :hover. Both are wrong here: the
   subject is given the full width precisely so it is not truncated, and the
   hover colour made a plain span look like a link after the link was taken off
   it (Mark, 2026-09-24). */
#ticketsTable tr.ticket-subject .ticket-subject-text {
    font-weight: 600;
    color: var(--heading-color, #212529);
}

/* The description helps someone choose a ticket; it is not meant to be read in
   full here - two lines, then the detail page. */
#ticketsTable .ticket-blurb {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ----------------------------------------------------------------------------
   Support Tickets - the detail page's read-only pane
   Kept when the editing moved into the Core Details tab (Mark, 2026-09-24):
   whichever tab is open, this pane answers "what am I looking at". It carries
   the subject and description for that reason - the tab that holds them is
   editable and may not be the one in front of you.
   -------------------------------------------------------------------------- */
#supportTicketDetailPage dl dt {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--muted-color);
    font-weight: 600;
}

#supportTicketDetailPage dl dd {
    margin-bottom: 0.75rem;
}

#supportTicketDetailPage dl dd:last-child {
    margin-bottom: 0;
}

/* pre-line, so the paragraphs somebody typed into the description survive here
   - they are the account of the problem, and running them together loses the
   shape of it. Capped, because this is the summary pane and the full text is a
   textarea one tab away. */
#supportTicketDetailPage .ticket-detail-description {
    display: block;
    white-space: pre-line;
    max-height: 11rem;
    overflow-y: auto;
}

/* The saved confirmation beside a Save button, in place of a banner at the top
   of the page (Mark, 2026-09-24). It fades in because it arrives with a page
   load rather than in front of the reader - without that it is simply already
   there, and reads as a label on the button rather than as something that just
   happened. */
.save-flash {
    animation: psb-save-flash 0.35s ease-out;
    white-space: nowrap;
}

@keyframes psb-save-flash {
    from { opacity: 0; transform: translateX(-4px); }
    to   { opacity: 1; transform: none; }
}

/* ============================================================================
   Support Tickets and Reminders - the list pane's height
   ----------------------------------------------------------------------------
   These pages put a .table-insight-row between the tabs and the table. Projects
   and Events go straight from the tabs header to .table-scroll-wrapper, and the
   shared rule fixes its tbody to a calc(100vh - 440px) BLOCK - not a max - so
   anything inserted above it pushes the page past the fold and the window grows
   a scrollbar (Mark, 2026-09-24). The warning is already written at the top of
   the TABLE SCROLL WRAPPER section; these pages are the case it describes.

   So they subtract the row they added (Announcements joined them 2026-09-25):
       440px  the shared offset for a pane that is nothing but a table
     +  31px  .table-insight height (border-box, so borders are inside it)
     +  16px  its mb-3
     = 487px
   ========================================================================== */
:is(#supportTicketsPage, #remindersPage, #announcementsPage) .table-scroll-wrapper tbody {
    height: calc(100vh - 487px);
    min-height: calc(100vh - 487px);
}

/* ============================================================================
   Reminders - the By Due board
   ----------------------------------------------------------------------------
   The same column shell as .support-board, which is itself the Projects/Events
   one. Written as its own scope rather than shared with .support-board because
   the two differ in one real way - this board has no drop target, so it has no
   .drop-here rules and its columns start a little higher - and because a single
   scope covering both would make a change for one silently reach the other.

   No drop target and no dragging: four of the five columns are worked out from
   the target date, so dragging between them would have to rewrite the date. See
   the note at the top of _RemindersByDuePartial.
   ========================================================================== */
.reminders-board .col-theme {
    display: flex;
    flex-direction: column;
}

/* Fixed width, not Bootstrap's `col-lg` flex: 1 0 0% - so a column never widens
   to fill space left by another. One fifth because ReminderDue.All has five. */
@media (min-width: 992px) {
    .reminders-board .col-theme {
        flex: 0 0 20%;
        max-width: 20%;
    }
}

.reminders-board .col-theme .card {
    --bs-card-bg: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.reminders-board .col-theme .card-body {
    background-color: transparent !important;
    padding: 0;
    box-sizing: border-box;
    /* calc, not a flex-fill chain - CLAUDE.md, Views. Taller than .support-board
       by the height of the drop target this board does not have. */
    height: calc(100vh - 390px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.reminders-board .col-theme .card-title {
    color: var(--title-color);
    margin-bottom: 8px !important;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
    padding-bottom: 0 !important;
}

/* The card itself gets NO overrides - it is the plain .kanban-card from
   main.css, exactly as on Projects and Events. This block used to add a coloured
   left border and its own anchor colour and hover underline, which is why the
   cards did not look like theirs (Mark, 2026-09-25). .kanban-card-title already
   handles the hover.

   Who the reminder belongs to, matching .project-leader-badge / .event-leader-badge
   in those two partials' own <style> blocks - same size, same shape. The COLOUR
   comes from the .avatar.avatar-* class the server puts on it, from
   Helpers/Avatars, as on the Support Tickets board. */
.reminders-board .reminder-person-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.reminders-board .reminder-person-avatar {
    width: 17px;
    height: 17px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.4375rem;
    flex-shrink: 0;
}

/* ----------------------------------------------------------------------------
   Reminder badges
   Same colours as the project statuses they sit beside, but their own classes:
   recolouring Cancelled should not silently recolour Overdue. Chosen by MEANING
   from that palette - see Helpers/ReminderDue.
   -------------------------------------------------------------------------- */
.table-badge.reminder-overdue {
    background-color: #fdd;
    --badge-color: #ed3c0d;    color: var(--badge-color);
    border: 1px solid #f49b88;
}

.table-badge.reminder-today {
    background-color: #fff0db;
    --badge-color: #FF9933;    color: var(--badge-color);
    border: 1px solid #ffc487;
}

.table-badge.reminder-week {
    background-color: #e3f2fd;
    --badge-color: #025be2;    color: var(--badge-color);
    border: 1px solid #72a8ef;
}

.table-badge.reminder-later {
    background-color: #f3e6ff;
    --badge-color: #9966cc;    color: var(--badge-color);
    border: 1px solid #c6a6e5;
}

.table-badge.reminder-done {
    background-color: #e6f7ec;
    --badge-color: #009933;    color: var(--badge-color);
    border: 1px solid #73cb8f;
}

/* ============================================================================
   Announcements
   ----------------------------------------------------------------------------
   The "For You" tab is a feed rather than a table: an announcement is a short
   piece of writing, and a table row would truncate the one thing worth reading.
   The "Published" tab IS a table, because that is a management list.
   ========================================================================== */
.announcement-feed {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    /* calc, not a flex-fill chain - CLAUDE.md, Views. */
    max-height: calc(100vh - 330px);
    overflow-y: auto;
    padding-right: 0.25rem;
}

.announcement-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md, 0.5rem);
    padding: 0.85rem 1rem;
    background-color: var(--table-stripe-bg);
}

.announcement-card-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 0.4rem;
}

.announcement-card-title {
    display: block;
    font-weight: 600;
    color: var(--heading-color, #212529);
    text-decoration: none;
    margin-bottom: 0.25rem;
}

.announcement-card-title:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* pre-line, so the paragraphs the author typed survive. Capped on the feed
   because the whole thing is one click away. */
.announcement-card-body {
    white-space: pre-line;
    color: var(--muted-color);
    font-size: 0.875rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.announcement-card-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.6rem;
}

/* On the detail page there is no cap - that page IS the whole thing. */
#announcementDetailPage .announcement-detail-body {
    white-space: pre-line;
}

#announcementDetailPage dl dt {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--muted-color);
    font-weight: 600;
}

#announcementDetailPage dl dd {
    margin-bottom: 0.75rem;
}

#announcementDetailPage dl dd:last-child {
    margin-bottom: 0;
}

/* ----------------------------------------------------------------------------
   Announcement badges
   Who it came from, and whether it is still running. Their own classes rather
   than the project statuses they share colours with, as with the ticket and
   reminder badges: recolouring one should not silently recolour another.
   -------------------------------------------------------------------------- */
.table-badge.announcement-platform {
    background-color: #f3e6ff;
    --badge-color: #9966cc;    color: var(--badge-color);
    border: 1px solid #c6a6e5;
}

.table-badge.announcement-internal {
    background-color: #e3f2fd;
    --badge-color: #025be2;    color: var(--badge-color);
    border: 1px solid #72a8ef;
}

.table-badge.announcement-current {
    background-color: #e6f7ec;
    --badge-color: #009933;    color: var(--badge-color);
    border: 1px solid #73cb8f;
}

.table-badge.announcement-expired {
    background-color: #e8e8e8;
    --badge-color: #777777;    color: var(--badge-color);
    border: 1px solid #afafaf;
}

/* ============================================================================
   The notification bell (2026-09-25, ROADMAP item 17)
   ----------------------------------------------------------------------------
   The template's four hardcoded notifications are gone; the dropdown now lists
   PageNotices.All - the same notices as the bar in the title row, including the
   ones closed there. The bar is the interruption, the bell is the record.

   The template styles .notification-item as a div; these rows are anchors now,
   because every notice has somewhere to go.
   ========================================================================== */
/* #mobileNotificationsModal is the same list for phones, where the header and its bell are hidden (2026-09-30).
   Named here rather than given .notification-menu, which main.css fixes at 360px - wider than a small phone. */
:is(.notification-menu, #mobileNotificationsModal) a.notification-item {
    text-decoration: none;
    color: inherit;
}

:is(.notification-menu, #mobileNotificationsModal) a.notification-item:hover .notification-title {
    color: var(--accent-color);
}

/* In a modal the list can use the height a phone has, instead of the dropdown's 350px. */
#mobileNotificationsModal .notification-list {
    max-height: none;
}

/* The bell's count uses the template's own .header-badge (main.css) - nothing to
   add here. .header-action is already position: relative, so the badge sits
   where the template intended. */

/* ============================================================================
   History tab (2026-10-01, ROADMAP item 0 of the order, step 4)
   ----------------------------------------------------------------------------
   One audit row per list-group-item, the same look as the Notes tab: what
   changed as a small table, then who and when in the muted line underneath.
   ========================================================================== */
/* width:auto overrides Bootstrap's .table 100%: stretched, the arrow and the new value landed somewhere different on
   every row. Hugging the content keeps "from -> to" reading as one phrase. */
.history-changes {
    width: auto;
    max-width: 100%;
    margin-bottom: 0.5rem;
    background: transparent;
}

.history-changes th,
.history-changes td {
    padding: 0.15rem 0.5rem 0.15rem 0;
    border: none;
    background: transparent;
    vertical-align: top;
    word-break: break-word;
}

.history-changes .history-field {
    white-space: nowrap;
    font-weight: 600;
    color: var(--heading-color);
}

.history-changes .history-from {
    color: var(--muted-color);
}

/* No percentage widths on these cells: in a width:auto table they stretch the table to fill the space. */
.history-changes .history-arrow {
    white-space: nowrap;
    color: var(--muted-color);
}
/* Inside a .table-scroll-wrapper (the Activity Log), the wrapper's own rules - written for OnE table, with
   descendant selectors - also reached the change table nested in each row: display:block, a tbody
   calc(100vh - 440px) tall, every row a separate fixed-layout table. One row filled the screen (2026-10-01).
   Put the nested table back to being an ordinary one. */
.table-scroll-wrapper table.history-changes {
    display: table;
    width: auto;
}

.table-scroll-wrapper table.history-changes tbody {
    display: table-row-group;
    height: auto;
    min-height: 0;
    overflow: visible;
}

.table-scroll-wrapper table.history-changes tr {
    display: table-row;
    width: auto;
    table-layout: auto;
    background: transparent;
}

/* ============================================================================
   Activity Log (2026-10-01, ROADMAP item 0 of the order, step 5)
   ----------------------------------------------------------------------------
   The scroll wrapper lays out every row as its own fixed-layout table, so the
   columns only line up with the header if both carry the same widths. Child
   selectors throughout, so nothing reaches into the nested change table.
   ========================================================================== */
.activity-table > thead > tr > th:nth-child(1),
.activity-table > tbody > tr > td:nth-child(1) {
    width: 11rem;
}

.activity-table > thead > tr > th:nth-child(2),
.activity-table > tbody > tr > td:nth-child(2) {
    width: 32%;
}

.activity-table > tbody > tr > td {
    vertical-align: top;
}

/* ============================================================================
   Reminders list - the done checkbox column (2026-10-01)
   ----------------------------------------------------------------------------
   Same cause as the Activity Log above: the width was only on the header cell
   (inline), so the body rows shared the space equally and every column sat
   one step to the right of its heading. Both sides carry it now.
   ========================================================================== */
#remindersTable > thead > tr > th:nth-child(1),
#remindersTable > tbody > tr > td:nth-child(1):not([colspan]) {
    width: 40px;
}

/* ============================================================================
   Phone header menu and search bar - solid, not see-through (2026-10-01)
   ----------------------------------------------------------------------------
   Both drop down over the page with the header's colour, --header-bg, which is
   90% opaque because the header itself blurs what is behind it. These do not
   blur, so the page's title and notice showed through behind the menu labels.
   ========================================================================== */
.mobile-header-menu,
.mobile-search {
    background: var(--surface-color);
}

/* ---- Project proposal editor (Pages/ProjectProposalDetail, ROADMAP item 21) ---- */
.project-proposal-editor .ql-editor { min-height: 110px; }
.project-proposal-editor.ql-disabled .ql-editor { min-height: 0; }

/* ---- Project wizard step 1 (Pages/ProjectWizard, ROADMAP item 21 step 7) ---- */
/* Step 1 is a list in its own scrolling area - the modal layout switches page scrolling off (_LayoutModal) - with each
   section's header stuck to the top while its rows scroll under it. */
.wizard-list { max-height: calc(100vh - 200px); overflow-y: auto; border: 1px solid var(--border-color); border-radius: 6px; }
.wizard-group-head { position: sticky; top: 0; z-index: 1; padding: 5px 12px; font-size: .75rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .03em; color: var(--muted-color, #6c757d);
    /* A light grey band of its own, so a section reads apart from its rows (Mark, 2026-10-03). Mixed from the theme's
       colours, so it is a lighter grey in light mode and a lifted tone in dark. */
    background: color-mix(in srgb, var(--muted-color, #6c757d) 14%, var(--modal-background-color, #fff));
    border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); }
.wizard-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 7px 12px;
    color: inherit; text-decoration: none; border-bottom: 1px solid var(--border-color); }
/* The app's row hover - the same orange as every table (--table-hover-bg; Mark, 2026-10-03). */
.wizard-row:hover, .wizard-row:focus { background: var(--table-hover-bg); color: inherit; }
.wizard-row-name { font-weight: 600; }
.wizard-row-meta { font-size: .8rem; color: var(--muted-color, #6c757d); white-space: nowrap; }
.wizard-row-note { padding: 7px 12px; font-size: .8rem; color: var(--muted-color, #6c757d); }
/* Step 2 (a chosen template): the whole page scrolls inside the modal, so the summary and Create are always reachable. */
.wizard-scroll { height: 100vh; overflow-y: auto; padding-bottom: 24px; }
/* The wizard's step indicator (Mark, 2026-10-03): Template · Project · Schedule and people. Named psb-* because main.css
   has a template wizard of its own on .psb-wizard-steps / .wizard-step - a connector line and centred columns - which these
   picked up while they shared the names. */
.psb-wizard-steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 14px 0; font-size: .8rem; }
.psb-wizard-steps li { flex: 1; text-align: center; padding: 5px 8px; border-radius: 4px; color: var(--muted-color, #6c757d);
    background: color-mix(in srgb, var(--muted-color, #6c757d) 10%, transparent); }
.psb-wizard-steps li a { color: inherit; text-decoration: none; }
.psb-wizard-steps li.done { color: var(--default-color); }
.psb-wizard-steps li.active { color: #fff; background: var(--accent-color); font-weight: 600; }
/* The wizard's "Will be made" list scrolls in a box of its own, so Next stays above the fold on a template with many
   steps (Mark, 2026-10-03). The height is what the modal leaves after the screen's fields; the headings stay put. */
.wizard-summary { max-height: calc(100vh - 430px); min-height: 120px; overflow-y: auto; border: 1px solid var(--border-color); border-radius: 6px; }
.wizard-summary thead th { position: sticky; top: 0; z-index: 1; background: color-mix(in srgb, var(--muted-color, #6c757d) 14%, var(--modal-background-color, #fff)); }

/* ── Reminders, Announcements and the support desk, out of the sidebar (Mark, 2026-10-03) ─────────────────────────
   Reminders and Announcements moved to the user menu, the support desk's count to the help card at the foot of the
   sidebar, and the bell gained a way to every announcement. Colours from the theme, so both modes follow. */
.user-menu-badge {
    margin-left: auto;
    min-width: 20px;
    height: 18px;
    padding: 0 7px;
    border-radius: var(--radius-full);
    background: var(--accent-color);
    color: var(--contrast-color);
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

/* "Something outstanding" on the avatar while the menu is closed - a reminder still to do. */
.user-trigger { position: relative; }
.user-trigger-dot {
    position: absolute;
    top: 3px;
    left: 30px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--danger-color);
    box-shadow: 0 0 0 2px var(--header-background-color, var(--background-color));
}

/* The open support tickets, on the "Need help?" card. */
.sidebar-help-count {
    margin-left: auto;
    padding: 1px 7px;
    border-radius: var(--radius-full);
    background: var(--accent-color);
    color: var(--contrast-color);
    font-size: 0.62rem;
    font-weight: 700;
    white-space: nowrap;
}
.sidebar-help-count + i { margin-left: 4px; }

/* "See all announcements" at the foot of the bell's list (and the phone's Notifications modal). */
.notification-footer-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    border-top: 1px solid var(--border-color);
    color: var(--accent-color);
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
}
.notification-footer-link:hover { background: color-mix(in srgb, var(--accent-color), transparent 92%); }

/* Sidebar groups (2026-10-05): a group header carries its total count AND the fold-out arrow - the count's
   margin-left:auto puts it at the right edge with the arrow straight after it, so give them room. */
.sidebar .has-submenu > .nav-link > .nav-badge {
    margin-right: 6px;
}

/* Save messages moved beside the button that was pressed (belmark.js, 2026-10-05) - in the button's row, compact. */
.save-message-slot {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    vertical-align: middle;
    margin: 0 10px;
    max-width: 100%;
}
.save-message-slot .alert {
    margin: 0;
    padding: 6px 12px;
    font-size: 0.875rem;
}
.save-message-slot .alert-dismissible {
    padding-right: 36px;
}
.save-message-slot .alert-dismissible .btn-close {
    padding: 9px 10px;
}
/* A full-width button has no room beside it: the message goes just under it, full width. */
.save-message-slot.save-message-below {
    display: flex;
    margin: 8px 0 0;
    width: 100%;
}

/* Badges whose colour is chosen in script (Invoices, Proposals, Payments) pass it as --badge-bg / --badge-color rather than an
   inline background - an inline style beats every stylesheet rule, so the dark rule below could not reach them (2026-10-06). */
.table-badge[style*="--badge-bg"] {
    background-color: var(--badge-bg);
    color: var(--badge-color);
    border: 1px solid var(--badge-color);
}

/* The campaign board's badge picks up its column's own variables, so a card's badge can never disagree with the column it is
   sitting in. Moved here from _CampaignsByStatusPartial (2026-10-06), where it came after this file and beat the dark rule. */
.table-badge.campaign-status {
    --badge-color: var(--campaign-color);
    background-color: var(--campaign-background);
    color: var(--badge-color);
    border: 1px solid var(--badge-color);
}

/* Badges in dark mode (Mark, 2026-10-05: "maybe all the status badges"). Every badge rule names its colour once as
   --badge-color and uses it for the text, which is all light mode needs. Their pale fills and dark text were a
   light-only design: in dark mode 34 of 78 fell below 4.5:1 and the pastel fills glared. This one rule derives the
   dark version from the same colour - text mixed with white, a faint tint for the fill, a mid-strength border - so
   every badge keeps its hue. A new badge only has to set --badge-color to get it. */
[data-theme=dark] :is(.table-badge, .table-badge-sm, .table-status-badge, .priority-badge) {
    color: color-mix(in srgb, var(--badge-color, currentColor) 55%, white);
    background-color: color-mix(in srgb, var(--badge-color, currentColor) 18%, transparent);
    border-color: color-mix(in srgb, var(--badge-color, currentColor) 45%, transparent);
}

/* Avatars in dark mode (2026-10-05) - the same light-only design as the badges (pale fill, deep-coloured initials),
   so the same fix: each .avatar-* rule names its colour as --avatar-color, and in dark mode the circle is that hue
   deepened into the card colour, with light initials of the same hue. */
[data-theme=dark] .avatar[class*="avatar-"] {
    background-color: color-mix(in srgb, var(--avatar-color, currentColor) 55%, var(--surface-color));
    color: color-mix(in srgb, var(--avatar-color, currentColor) 22%, white);
}

/* Row hover in dark mode - the theme's teal, a little brighter (Mark, 2026-10-06: "(a) is ok but I think it needs to be just a bit
   brighter"). main.css has 0.1, which barely showed; it is not edited, so this later rule wins. */
[data-theme=dark] {
    --table-hover-bg: rgba(34, 211, 206, 0.18);
}

/* Inactive tabs in dark mode (2026-10-06) - main.css gives every .nav-tabs link a fixed navy (#366491), which is 2.6:1 on the
   dark card: every tab bar in the app (detail pages, list pages' By Status, Dashboards) read as nearly invisible. */
[data-theme=dark] .nav-tabs .nav-link:not(.active) {
    color: var(--muted-color);
}
[data-theme=dark] .nav-tabs .nav-link:not(.active):hover,
[data-theme=dark] .nav-tabs .nav-link:not(.active):focus {
    color: var(--heading-color);
}

/* Coloured badge fills in dark mode (2026-10-06) - main.css maps .bg-danger / -success / -warning / -info to the dark theme's
   lighter colours (e.g. #fb7185), and white text on those is ~2.7:1 (the Dashboards count bubbles). Keep the bright fill,
   use dark text - the usual dark-mode answer for a light fill. */
[data-theme=dark] .badge:is(.bg-danger, .bg-success, .bg-warning, .bg-info) {
    color: #0b1418;
}

/* Board column headings in dark mode (2026-10-06) - each column passes its colour as --title-color (the *ByStatus partials);
   the deep reds and blues of Blocked / Cancelled / Review were ~2.8:1 on the dark card. The same colour, mixed toward white. */
[data-theme=dark] .col-theme .card-title,
[data-theme=dark] .col-theme .drop-here table {
    color: color-mix(in srgb, var(--title-color) 65%, white);
    border-color: color-mix(in srgb, var(--title-color) 65%, white);
}

/* Grey (secondary) buttons in dark mode (2026-10-06) - main.css paints them the dark theme's muted blue-grey with white text,
   2.3:1 ("Cancel", "Back to ...", "Close"). A deep slate with light text instead - still clearly the quieter button. */
[data-theme=dark] .btn-secondary {
    color: var(--heading-color);
    background-color: var(--border-color-dark);
    border-color: var(--border-color-dark);
}
[data-theme=dark] .btn-secondary:hover,
[data-theme=dark] .btn-secondary:focus {
    color: var(--heading-color);
    background-color: #4a7090;
    border-color: #4a7090;
}

/* ===== Project timeline (ProjectDetail's Timeline tab, _ProjectTimelinePartial, 2026-11-16) =====
   The project in at most ten equal sections. Past sections are muted, the current one carries the accent, future ones
   are neutral; a section with an overdue milestone gets a red underline and a red count. Theme variables only, so it
   follows dark mode with no rules of its own. Below 576px the strip stands on end. */
.project-timeline {
    --tl-bar-height: 40px;
}

.project-timeline .timeline-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
    font-size: 0.8125rem;
    color: var(--muted-color);
    margin-bottom: 12px;
}

.project-timeline .timeline-overdue {
    color: var(--danger-color);
    font-weight: 600;
}

.project-timeline .timeline-strip {
    position: relative;
    display: flex;
    gap: 3px;
}

.project-timeline .timeline-section {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 0;
    border: none;
    background: none;
    color: inherit;
    cursor: pointer;
}

.project-timeline .timeline-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    height: var(--tl-bar-height);
    padding: 0 6px;
    border-radius: 4px;
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background-color: var(--surface-color);
    color: var(--heading-color);
    border: 1px solid var(--border-color);
    transition: filter 0.15s, box-shadow 0.15s;
}

.project-timeline .timeline-section.is-past .timeline-bar {
    background-color: color-mix(in srgb, var(--muted-color) 18%, var(--surface-color));
    color: var(--muted-color);
}

.project-timeline .timeline-section.is-current .timeline-bar {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--contrast-color);
}

.project-timeline .timeline-section.has-overdue .timeline-bar {
    box-shadow: inset 0 -4px 0 var(--danger-color);
}

.project-timeline .timeline-section:hover .timeline-bar {
    filter: brightness(0.95);
}

.project-timeline .timeline-section[aria-expanded="true"] .timeline-bar {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.project-timeline .timeline-section:focus-visible {
    outline: none;
}

.project-timeline .timeline-section:focus-visible .timeline-bar {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.project-timeline .timeline-count {
    min-height: 1.25em;
    font-size: 0.8125rem;
    text-align: center;
    color: var(--default-color);
}

/* Today: a thin line across the bar row, placed by the builder's TodayPercent. */
.project-timeline .timeline-today {
    position: absolute;
    top: -4px;
    height: calc(var(--tl-bar-height) + 8px);
    width: 2px;
    margin-left: -1px;
    background-color: var(--danger-color);
    border-radius: 1px;
    pointer-events: none;
}

.project-timeline .timeline-panel {
    margin-top: 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px 14px;
    background-color: var(--surface-color);
}

.project-timeline .timeline-panel-heading {
    font-weight: 600;
    color: var(--heading-color);
    margin-bottom: 6px;
}

.project-timeline .timeline-panel-heading span {
    font-weight: 400;
    color: var(--muted-color);
    margin-left: 8px;
    font-size: 0.8125rem;
}

.project-timeline .timeline-item {
    display: grid;
    /* Fixed widths, not auto: each row is its own grid, so an auto column would size to that row's badge and the
       columns would not line up from one row to the next. */
    grid-template-columns: minmax(0, 1fr) 170px 150px 130px;
    align-items: center;
    gap: 12px;
    padding: 7px 0;
    border-top: 1px solid var(--border-color);
    color: var(--default-color);
    text-decoration: none;
    font-size: 0.875rem;
}

.project-timeline .timeline-item:hover .timeline-item-name {
    color: var(--accent-color);
}

.project-timeline .timeline-item-name {
    font-weight: 600;
    color: var(--heading-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-timeline .timeline-item-leader,
.project-timeline .timeline-item-date {
    color: var(--muted-color);
    white-space: nowrap;
}

/* Owner, date and status sit centred in their columns (Mark, 2026-11-16). */
.project-timeline .timeline-item-leader,
.project-timeline .timeline-item-date,
.project-timeline .timeline-item .table-badge {
    justify-self: center;
    text-align: center;
}

.project-timeline .timeline-item.is-overdue .timeline-item-date {
    color: var(--danger-color);
    font-weight: 600;
}

@media (max-width: 575.98px) {
    .project-timeline .timeline-strip {
        flex-direction: column;
    }

    .project-timeline .timeline-section {
        flex-direction: row;
        align-items: center;
    }

    .project-timeline .timeline-bar {
        flex: 0 0 55%;
        justify-content: flex-start;
        padding: 0 12px;
    }

    .project-timeline .timeline-count {
        text-align: left;
    }

    .project-timeline .timeline-today {
        display: none;
    }

    .project-timeline .timeline-item {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 2px 12px;
    }

    .project-timeline .timeline-item-leader,
    .project-timeline .timeline-item-date {
        grid-column: 1;
        font-size: 0.8125rem;
        justify-self: start;
        text-align: left;
    }

    .project-timeline .timeline-item .table-badge {
        grid-column: 2;
        grid-row: 1;
    }
}

/* ── Logo in dark mode (Mark, 2026-11-16) ───────────────────────────────────────────────
   main.css whitens every logo in dark mode (brightness(0) invert(1)) - meant for the template's
   one-colour mark. On the blue globe it leaves a flat silhouette that vanishes, so keep the
   globe's own colours, with a faint glow so its darker edge holds against the dark header. */
[data-theme=dark] .header-logo img,
[data-theme=dark] .auth-brand-logo img,
[data-theme=dark] .auth-logo img {
    filter: drop-shadow(0 0 3px rgba(255, 255, 255, .35));
}

/* A project template's tickets, grouped under their milestones (ProjectTemplateDetail, 2026.11.17.1): the heading row
   where the milestone changes. Theme variables only, so it reads the same in dark mode. */
.template-ticket-group td {
    padding-top: .6rem;
    font-weight: 600;
    font-size: .85rem;
    color: var(--muted-color);
    background: transparent;
    border-bottom-color: var(--border-color);
}
