:root {
  --brand: #3268ff;
  --brand-dark: #2140ff;
}

body {
  background: #f6f8fb;
}

.brand-header {
  background: linear-gradient(90deg, var(--brand-dark), var(--brand));
  border-radius: 0 0 1.2rem 1.2rem;
  /*overflow: hidden; */
}
.nav-link.dropdown-toggle.show ~ .brand-header {
    overflow: visible;
}

.brand-title {
  font-weight: 700 !important;
  letter-spacing: .2px;
  color: #fff !important;
}

.crm-badge {
  background: #fff;
  color: #111;
  font-weight: 700;
}

main.container {
  max-width: unset;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

@media (min-width:1400px) {
  main.container {
    max-width: unset;
  }
}

@media (min-width:1600px) {
  main.container {
    max-width: unset;
  }
}

@media (min-width:1920px) {
  main.container {
    max-width: unset;
  }
}

.hover-card {
  border: none;
  border-radius: 1rem;
  transition: transform .15s ease, box-shadow .15s ease;
  overflow: visible;
}

.hover-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 .8rem 2rem rgba(0, 0, 0, .08);
}

.btn-brand {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.btn-brand:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

.kv .k {
  font-weight: 600;
  color: #111;
}

.kv .v {
  color: #6c757d;
}

/* Tabs */
.nav-tabs .nav-link,
.nav-pills .nav-link {
  border-radius: 999px;
}

.top-tabs {
  background: #ffffff;
  border: 1px solid #e9edf7;
  border-radius: 12px;
  padding: .35rem;
}

.top-tabs .nav-link {
  color: #334155;
  font-size: 1.05rem;
  font-weight: 600;
  padding: .6rem 1rem;
}

.top-tabs .nav-link i {
  font-size: 1.1rem;
  margin-right: .4rem;
}

.top-tabs .nav-link.active {
  background: linear-gradient(90deg, rgba(50, 104, 255, .12), rgba(50, 104, 255, .04));
  color: #1f2a44;
  border: 1px solid #e6ebff;
  box-shadow: 0 0 0 .1rem rgba(13, 110, 253, .1) inset, 0 .125rem .25rem rgba(0, 0, 0, .05);
}

ul#mainTabs.top-tabs {
  gap: .5rem;
}

/* === Client Summary + Journey Timeline (new) === */

.client-summary-card {
  background: #ffffff;
  border: 1px solid #e9edf7;
  border-radius: 16px;
  padding: 1.5rem 2rem 1.75rem;
  margin-bottom: 1.75rem;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
}

.client-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
}

.client-summary-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: .2px;
  margin: 0;
  color: #111827;
}

.client-summary-id {
  font-size: .9rem;
  /* font-weight: 600; */
  color: #6b7280;
  margin-top: .15rem;
}

.client-keyline {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: .6rem;
}

.summary-pill {
  padding: .25rem .7rem;
  border-radius: 999px;
  background: #f3f4ff;
  border: 1px solid #e0e7ff;
  font-size: .75rem;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: #4b5563;
}

.summary-pill span.label {
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 600;
  font-size: .65rem;
  color: #9ca3af;
}

.summary-pill span.value {
  font-weight: 600;
  color: #111827;
}

/* Light red variant for unaided clients */
.summary-pill.aided-no {
  background: #fdecec;
  /* soft red background */
  border: 1px solid #fbc5c5;
  /* subtle red border */
  color: #b91c1c;
  /* dark red text */
}

.summary-pill.aided-no span.label {
  color: #b91c1c;
}

.summary-pill.aided-no span.value {
  font-weight: 700;
  color: #7f1d1d;
}


.client-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
  min-width: 260px;
}

@media (max-width: 992px) {
  .client-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.metric-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #9ca3af;
  font-weight: 600;
  margin-bottom: .15rem;
}

.metric-value-big {
  font-size: 1.6rem;
  font-weight: 800;
  color: #111827;
  line-height: 1.1;
}

.metric-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: #111827;
}

.metric-sub {
  font-size: .75rem;
  color: #6b7280;
}

.metric-tag-ok {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .1rem .45rem;
  border-radius: 999px;
  background: #e8f6ee;
  color: #15803d;
  font-size: .7rem;
  font-weight: 600;
}

/* Journey filter pills */

.journey-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: 1.25rem;
}

.journey-filter-btn {
  padding: .3rem .8rem;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  font-size: .75rem;
  color: #4b5563;
  cursor: pointer;
}

.journey-filter-btn.active {
  background: var(--brand, #3268ff);
  color: #ffffff;
  border-color: var(--brand, #3268ff);
  font-weight: 600;
}

/* Timeline */

.client-journey-timeline {
  margin-top: .75rem;
  pointer-events: none;
  cursor: none;
}

.timeline-track {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 2.4rem;
  padding: 1.1rem 0 .25rem;
  overflow-x: auto;
}

.timeline-track::before {
  content: "";
  position: absolute;
  top: 32px;
  left: 0;
  right: 0;
  height: 3px;
  background: #e5e7eb;
  border-radius: 999px;
}

.timeline-event {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 82px;
  z-index: 1;
}

.timeline-year {
  font-size: .7rem;
  color: #9ca3af;
  margin-bottom: .2rem;
}

.timeline-icon {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #3268ff;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(50, 104, 255, .25);
  margin-bottom: .25rem;
  font-size: .8rem;
  font-weight: 600;
}

.timeline-label {
  font-size: .75rem;
  font-weight: 600;
  color: #374151;
  text-align: center;
}

/* State variants */

.timeline-event-past .timeline-icon {
  background: #3268ff;
}

.timeline-event-goal .timeline-icon {
  background: #22c55e;
}

.timeline-event-issue .timeline-icon {
  background: #f97316;
}

.timeline-event-future .timeline-icon {
  background: #e5e7eb;
  color: #6b7280;
  box-shadow: none;
}

.timeline-event-future .timeline-label {
  color: #6b7280;
}

/* Make future '940 eligible' feel like a next step */
.timeline-event-future-940 .timeline-icon {
  background: #eef2ff;
  color: #3268ff;
  border: 2px solid #3268ff;
}

.timeline-event-future-940 .timeline-label {
  color: #111827;
  font-weight: 700;
}

/* Outer wrapper hides default scrollbar chrome */
.client-journey-timeline {
  position: relative;
  overflow: hidden;
  /* hides scrollbar track */
  margin-top: 0.75rem;
}

/* Scrollable track */
.timeline-track {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 2.4rem;
  padding: 1.1rem 0 .25rem;
  overflow-x: auto;
  /* horizontal scroll */
  overflow-y: visible;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* Hide scrollbars */
.timeline-track::-webkit-scrollbar {
  display: none;
}

.timeline-track {
  -ms-overflow-style: none;
  /* IE/Edge */
  scrollbar-width: none;
  /* Firefox */
}

/* Ensure events stack correctly for tooltips */
.timeline-event {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1;
  cursor: pointer;
}

/* Tooltip above the icon */
.timeline-tooltip {
  position: absolute;
  bottom: 56px;
  /* push it clearly above the icon/line */
  left: 50%;
  transform: translateX(-50%);
  background: #111827;
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.7rem;
  line-height: 1.3;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 20;
}

.timeline-event:hover .timeline-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

/* Tooltip arrow */
.timeline-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: #111827 transparent transparent transparent;
}

/* Allow tooltips to flow above the track */
.client-journey-timeline {
  overflow: visible;
}

/* Keep tooltip clearly above and on top */
.timeline-tooltip {
  z-index: 50;
}

/* Allow tooltips to flow above the track */
.client-journey-timeline {
  overflow: visible;
}

/* Keep tooltip clearly above and on top */
.timeline-tooltip {
  z-index: 50;
}



/* Amount label under financial timeline events */
.timeline-amount {
  margin-top: 0.2rem;
  padding: 0.1rem 0.5rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  background: #f3f4ff;
  color: #111827;
}

/* Muted (filtered-out) events stay visible but subtle */
.timeline-event-muted {
  opacity: 0.18;
  filter: grayscale(1);
}


/* Layout: 3-column responsive header */
.client-summary-header {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(260px, 2fr) minmax(260px, 2fr);
  gap: 1.5rem;
  align-items: stretch;
}

/* Stack nicely on smaller screens */
@media (max-width: 992px) {
  .client-summary-header {
    grid-template-columns: 1fr;
  }
}

/* Left block */
.client-summary-left .client-contact-inline {
  margin-top: .5rem;
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.25rem;
  font-size: .8rem;
  color: #4b5563;
}

.client-summary-left .client-contact-inline i {
  font-size: .9rem;
}

/* Middle + Right cards share a look */
.client-personal-card,
.client-financial-card {
  background: #ffffff;
  border-radius: 12px;
  padding: .9rem 1rem;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
  border: 1px solid #e5e7eb;
}

.client-section-label {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 600;
  color: #9ca3af;
  margin-bottom: .4rem;
}

/* Re-use k/v look but lighter */
.client-personal-card .k,
.client-financial-card .fi-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #9ca3af;
  margin-bottom: 0;
}

.client-personal-card .v,
.client-financial-card .fi-value {
  font-size: .85rem;
  color: #111827;
  font-weight: 500;
}

/* Financial insights rows */
.fi-row {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .15rem;
}

.fi-row .fi-value {
  text-align: right;
  white-space: nowrap;
}

/* Voucher status */
.fi-status {
  margin-top: .25rem;
  font-size: .78rem;
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .15rem .5rem;
  border-radius: 999px;
}

.fi-status-ok {
  background: #ecfdf5;
  color: #15803d;
}

/* Metrics grid inside financial card: tighten spacing slightly */
.client-financial-card .client-metrics-grid {
  margin-top: .6rem;
  border-top: 1px solid #eef2ff;
  padding-top: .5rem;
}


/* Section banner */
/* === Unified merged section header design === */

.card.hover-card {
  border: none;
  border-radius: 1rem;
  overflow: hidden;
  /* Ensures gradient header merges smoothly */
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  margin-bottom: 1.5rem;
  /* consistent spacing between sections */
}

.section-banner {
  background: linear-gradient(90deg, #dbe7ff, #eaf0ff);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-top-left-radius: 1rem;
  border-top-right-radius: 1rem;
  margin: 0;
}

.section-banner .icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #3268ff;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 .25rem .75rem rgba(50, 104, 255, .25);
}

.section-banner .title {
  margin: 0;
  color: var(--brand-dark);
  font-weight: 800;
  letter-spacing: .2px;
}

.card.hover-card .card-body {
  padding-top: 1rem;
}

.card-body {
  overflow-y: auto;
  overflow-x: hidden;
}

/* Optional: make hover-card subtly lift on hover */
.card.hover-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.2s ease;
}

/* Editable fields */
.editable-field {
  display: inline-flex;
  flex-direction: column;
  gap: 0;
}

.editable-field label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #94a3b8;
  margin: 0 0 2px 1px;
}

.editable-field .editable {
  padding: 2px 4px;
  border-radius: 4px;
  border-bottom: 1px dashed #cbd5ff;
  cursor: text;
  font-weight: 500;
  color: #0f172a;
}

.editable-field .editable:focus {
  outline: none;
  background: #eff6ff;
  border-bottom-style: solid;
}

/* Alerts chips */
.alerts-rail {
  background: #ffffff;
  border: 1px solid #edf0f7;
  border-radius: 12px;
  padding: .4rem .6rem; 
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.alert-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .85rem;
  background: #f9fbff;
  border: 1px solid #e8ecff;
  border-radius: 999px;
  padding: .25rem .6rem;
  white-space: nowrap;
}

.chip-red {
  background: #fff5f5;
  border-color: #ffdede;
  color: #b00020;
}

.chip-amber {
  background: #fff8e1;
  border-color: #ffe0a3;
  color: #8a6d00;
}

.alerts-rail .spacer {
  flex: 1 0 auto;
}

.alerts-rail .more {
  font-size: .85rem;
}

/* Info band */
.info-band {
  background: #fff7e6;
  border: 1px solid #ffe4b8;
  border-left: 4px solid #ffb74d;
  border-radius: 12px;
  padding: .5rem .75rem;
  display: flex;
  gap: .5rem;
  align-items: center;
  font-weight: 700;
}

/* Yes/No pills */
.yes-badge {
  background: #e8f6ee;
  color: #198754;
}

.no-badge {
  background: #fdeaea;
  color: #dc3545;
}


/* Scrollable personal details */
.personal-details-scroll {
  max-height: 600px;
  overflow-y: auto;
  overflow-x: auto;
  padding-right: .5rem;
}

.personal-details-scroll::-webkit-scrollbar {
  width: 8px;
}

.personal-details-scroll::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.personal-details-scroll::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 10px;
}

.personal-details-scroll::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Device / accessories product rows */
.product-row {
  border: 1px solid #edf0f7;
  border-radius: 10px;
  padding: .75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.product-row+.product-row {
  margin-top: .5rem;
}

.prod-left {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.prod-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #7a8cff;
  display: inline-block;
}

.prod-name {
  font-weight: 600;
}

.prod-meta {
  color: #6c757d;
  font-size: .85rem;
}

/* Feature tiles (if needed later) */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .6rem;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  border: 1px solid #e8ecff;
  background: #f9fbff;
  border-radius: 12px;
  padding: .55rem .6rem;
}

.feature-item.ok {
  background: #f3fbf7;
  border-color: #cde9d8;
}

.feature-item .fi-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.feature-item.ok .fi-icon {
  background: #e8f6ee;
  color: #198754;
}

.feature-item .fi-title {
  font-weight: 600;
}

.feature-item .fi-sub {
  font-size: .85rem;
  color: #6c757d;
}

/* Divider */
.divider-line {
  height: 1px;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.03));
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  margin-top: .5rem;
}

/* Appointments table */
.appointments-scroll {
  max-height: 260px;
  overflow-y: auto;
  margin-top: .5rem;
}

.appointments-table {
  width: 100%;
  font-size: .85rem;
}

.appointments-table thead th {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 5;
  padding: .35rem .35rem;
  border-bottom: 1px solid #e9edf7;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: #6c757d;
}

.appointments-table tbody td {
  padding: .35rem .35rem;
  border-bottom: 1px solid #f1f3f8;
  vertical-align: middle;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: .15rem .5rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  gap: .25rem;
}

.status-open-completed {
  background: #e8f6ee;
  color: #198754;
}

.status-cancelled {
  background: #fdeaea;
  color: #b00020;
}

/* Claim status pills */
.claim-status-pill {
  display: inline-flex;
  align-items: center;
  padding: .15rem .5rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  gap: .25rem;
}

.claim-status-accepted {
  background: #e8f6ee;
  color: #198754;
}

.claim-status-rejected {
  background: #fdeaea;
  color: #b00020;
}

.claim-status-pending {
  background: #fff8e1;
  color: #8a6d00;
}

.overdue-pill {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .15rem .5rem;
  border-radius: 999px;
  font-size: .7rem;
  background: #fff5f5;
  color: #b00020;
  font-weight: 600;
}

/* Claims history scrollable table (fixed header) */
.claims-scroll {
  max-height: 400px;
  overflow-y: auto;
  padding-right: .25rem;
}

.claims-scroll table {
  width: 100%;
  font-size: .85rem;
}

.claims-scroll thead th {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 5;
  padding: .5rem .5rem;
  border-bottom: 1px solid #e9edf7;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: #6c757d;
}

.claims-scroll tbody td {
  padding: .5rem .5rem;
  border-bottom: 1px solid #f1f3f8;
  vertical-align: middle;
}

.padlock {
  font-size: .75rem;
  color: #94a3b8;
  margin-left: .2rem;
}

/* Contact history table (fixed header, scrollable body, native tooltips) */
.contact-history-scroll {
  max-height: 450px;
  overflow-y: auto;
  overflow-x: auto;
  padding-right: .5rem;
}

.contact-history-scroll::-webkit-scrollbar {
  width: 8px;
}

.contact-history-scroll::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.contact-history-scroll::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 10px;
}

.contact-history-scroll::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

.contact-history-table {
  /*width: 100%;*/
  table-layout: fixed;
  font-size: .9rem;
}

.contact-history-table thead th {
  font-weight: 700;
  font-size: .9rem;
  color: #1f2937;
  padding-bottom: .75rem;
  padding-right: 1rem;
  border-bottom: 2px solid #e9edf7;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 10;
}

.contact-history-table tbody td {
  padding: .6rem 1rem .6rem 0;
  border-bottom: 1px solid #e9edf7;
  vertical-align: top;
}

.contact-history-table tbody tr:last-child td {
  border-bottom: none;
}

.contact-history-table .date-col {
  color: #1f2937;
  font-weight: 600;
  white-space: nowrap;
  width: 110px;
}

.contact-history-table .channel-col {
  color: #6c757d;
  white-space: nowrap;
  width: 140px;
}

.contact-history-table .desc-col {
  color: #495057;
}

.desc-truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Device status pills for Full Device History */
.device-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  gap: 0.25rem;
  white-space: nowrap;
}

.device-status-received {
  background: #fff7e6;
  color: #A37200;
}

.device-status-current {
  background: #e8f6ee;
  color: #198754;
}

.device-status-noncurrent {
  background: #f3f4f6;
  color: #6b7280;
}

/* Tighter spacing for Contact History columns */
.contact-history-table thead th {
  padding-bottom: 0.75rem;
  padding-right: 0.5rem;
}

.contact-history-table tbody td {
  padding: 0.6rem 0.5rem 0.6rem 0;
}

.contact-history-table .date-col {
  width: 95px;
}

.contact-history-table .channel-col {
  width: 120px;
}

.device-actions {
  display: flex;
  gap: 0.5rem;
  /* spacing between Repair and Reorder buttons */
  margin-top: 0.5rem;
}

.device-actions .btn {
  min-width: 80px;
}

/* Optional: make the Repair button look slightly different */
.btn-outline-secondary {
  color: #495057;
  border-color: #adb5bd;
}

.btn-outline-secondary:hover {
  background-color: #E8E8E8;
  border-color: #868e96;
  color: #212529;
}

.documents-scroll {
  max-height: 320px;
  overflow-y: auto;
  border-radius: 8px;
}

/* Smooth scrollbar styling */
.documents-scroll::-webkit-scrollbar {
  width: 8px;
}

.documents-scroll::-webkit-scrollbar-thumb {
  background-color: #d1d5db;
  /* light grey thumb */
  border-radius: 10px;
}

.documents-scroll::-webkit-scrollbar-thumb:hover {
  background-color: #9ca3af;
  /* darker on hover */
}

.documents-scroll::-webkit-scrollbar-track {
  background: #f9fafb;
  /* light background track */
  border-radius: 10px;
}

/* Ensure document names wrap neatly and table fits without horizontal scroll */
.documents-table td:first-child {
  white-space: normal;
  /* allows wrapping */
  word-break: break-word;
  /* breaks long words or filenames */
  max-width: 400px;
  /* adjust width as needed */
}

.documents-table td,
.documents-table th {
  overflow-wrap: anywhere;
  /* breaks long text gracefully */
}


/* Clinical Insights layout */

.clinical-insights-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.clinical-flags-list {
  display: grid;
  grid-template-columns: 1fr auto;
  row-gap: 0.3rem;
  column-gap: 0.75rem;
  align-items: center;
  font-size: 0.85rem;
  color: #111827;
}

.clinical-flag-label {
  font-weight: 500;
  color: #4b5563;
}

.clinical-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}

.clinical-pill-yes {
  background: #e8f6ee;
  color: #15803d;
}

.clinical-pill-no {
  background: #fdeaea;
  /* red pill for 'No' */
  color: #b91c1c;
}

.clinical-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 150px;
}

.clinical-actions .btn-clinical {
  width: 100%;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 999px;
  border: none;
  background: var(--brand, #3268ff);
  color: #ffffff;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.clinical-actions .btn-clinical.secondary {
  background: #f3f4ff;
  color: #1f2937;
  border: 1px solid #e0e7ff;
}

/* Body text */
.clinical-body-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ca3af;
  font-weight: 600;
}

.clinical-last-note-date {
  font-weight: 600;
  margin-left: 0.5rem;
  color: #111827;
}

.clinical-ai-summary h6 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-top: 0.9rem;
  margin-bottom: 0.25rem;
}

.clinical-ai-summary p {
  font-size: 0.85rem;
  color: #374151;
  margin-bottom: 0.25rem;
}

.clinical-ai-summary ul {
  padding-left: 1.15rem;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  color: #374151;
}

/* Clinical Insights layout */

.clinical-insights-top {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(210px, 260px) minmax(150px, 170px);
  gap: 1.5rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

@media (max-width: 992px) {
  .clinical-insights-top {
    grid-template-columns: 1fr;
  }
}

/* Left: flags */
.clinical-flags-list {
  display: grid;
  grid-template-columns: auto auto;
  row-gap: 0.3rem;
  column-gap: 0.75rem;
  align-items: center;
  font-size: 0.85rem;
  color: #111827;
}

.clinical-flag-label {
  font-weight: 500;
  color: #4b5563;
}

.clinical-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}

.clinical-pill-yes {
  background: #e8f6ee;
  color: #15803d;
}

.clinical-pill-no {
  background: #fdeaea;
  color: #b91c1c;
}

/* Middle: audiogram thumbnail */

.clinical-audiogram {
  text-align: center;
}

.clinical-audiogram-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 0.25rem;
}

.clinical-audiogram img {
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
}

/* Right: actions – match existing button style (rounded corners, not pill) */

.clinical-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.clinical-actions .btn-clinical {
  width: 100%;
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 10px;
  /* not pill-shaped */
  border: none;
  background: var(--brand, #3268ff);
  color: #ffffff;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.clinical-actions .btn-clinical.secondary {
  background: #f3f4ff;
  color: #1f2937;
  border: 1px solid #e0e7ff;
}

/* Body + table */

.clinical-body-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ca3af;
  font-weight: 600;
}

.clinical-last-note-date {
  font-weight: 600;
  margin-left: 0.5rem;
  color: #111827;
}

.clinical-ai-summary h6 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-top: 0.9rem;
  margin-bottom: 0.25rem;
}

.clinical-ai-summary p {
  font-size: 0.85rem;
  color: #374151;
  margin-bottom: 0.25rem;
}

.clinical-ai-summary ul {
  padding-left: 1.15rem;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  color: #374151;
}

.degree-pill {
  display: inline-block;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.4;
}

/* Worse: pale red */
.degree-worse {
  background-color: #ffc9c9;
  color: #b00020;
}

/* Slightly Better: pale orange */
.degree-slightly-better {
  background-color: #ffe0b2;
  color: #c05600;
}

/* No Different: pale yellow */
.degree-no-different {
  background-color: #fff9c4;
  color: #8a6d00;
}

/* Better: pale green */
.degree-better {
  background-color: #c8f7d4;
  color: #166534;
}

/* Much Better: strong green */
.degree-much-better {
  background-color: #00e676;
  color: #004d40;
}

/* Vertical scroll for COSI goals */
.clinical-goals-wrapper {
  max-height: 350px;
  /* adjust if you want more or fewer visible rows */
  overflow-y: auto;
  border-radius: 8px;
  padding-right: 4px;
}

/* Optional: styled scrollbar (matches documents + appointments sections) */
.clinical-goals-wrapper::-webkit-scrollbar {
  width: 8px;
}

.clinical-goals-wrapper::-webkit-scrollbar-thumb {
  background-color: #d1d5db;
  border-radius: 10px;
}

.clinical-goals-wrapper::-webkit-scrollbar-thumb:hover {
  background-color: #9ca3af;
}

.clinical-goals-wrapper::-webkit-scrollbar-track {
  background: #f9fafb;
  border-radius: 10px;
}

/* 3-column responsive layout */
.client-summary-header {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(260px, 2fr) minmax(260px, 2fr);
  gap: 1.5rem;
  align-items: flex-start;
}

@media (max-width: 992px) {
  .client-summary-header {
    grid-template-columns: 1fr;
  }
}

/* Inline contact beside name */
.client-summary-left .client-contact-inline {
  margin-top: .4rem;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.25rem;
  font-size: .8rem;
  color: #4b5563;
}

.client-summary-left .client-contact-inline i {
  font-size: .9rem;
}

/* Personal & contact (no card) */
.client-personal-area {
  padding-top: .2rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1.5rem;
  row-gap: .2rem;
  font-size: .85rem;
}

.client-personal-area .pc-span {
  grid-column: 1 / -1;
}

.client-personal-area .k {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #9ca3af;
  margin-bottom: 0;
}

.client-personal-area .v {
  font-size: .85rem;
  color: #111827;
  font-weight: 500;
}

/* Financial Insights card */
.client-financial-card {
  background: #ffffff;
  border-radius: 12px;
  padding: .9rem 1rem;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
  border: 1px solid #e5e7eb;
}

.client-outstanding-card {
  background: #ffffff;
  border-radius: 12px;
  padding: .9rem 1rem;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
  border: 1px solid #e5e7eb;
}

.client-section-label {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 600;
  color: #9ca3af;
  margin-bottom: .35rem;
}

/* Aligned funding rows: labels + values all left aligned in columns */
.fi-row {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: .5rem;
  align-items: baseline;
  margin-bottom: .12rem;
}

.fi-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #9ca3af;
}

.fi-value {
  font-size: .85rem;
  color: #111827;
  font-weight: 500;
}

/* Voucher status */
.fi-status {
  margin-top: .25rem;
  font-size: .78rem;
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .15rem .5rem;
  border-radius: 999px;
}

.fi-status-ok {
  background: #ecfdf5;
  color: #15803d;
}

/* Light-red key status pill */
.summary-pill-alert {
  background-color: #fef2f2;
  border-color: #fee2e2;
  color: #b91c1c;
}

/*////////////*/
.section-icon {
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-top-left-radius: 1rem;
  border-top-right-radius: 1rem;
  margin: 0;
}

.section-icon .icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #3268ff;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 .25rem .75rem rgba(50, 104, 255, .25);
}

.section-icon .title {
  font-size: .75rem;
  font-weight: 600;
  color: #374151;
  text-align: center;
  display: inline-block;
}

.section-icon .title:hover {
  text-decoration: underline;
  cursor: pointer;
}

.tab-flex {
  background: #ffffff;
  border: 1px solid #edf0f7;
  border-radius: 12px;
  padding: .4rem .6rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.flex {
    display: flex;
    gap: 1rem !important;    
    align-items: flex-start;
    justify-content: normal;
    flex-wrap: wrap;
}


.button2:hover, .btn-default:hover {
  color: var(--bs-btn-active-bg); 
}

.btn-check:checked+.btn, .btn.active, .btn.show, .btn:first-child:active, :not(.btn-check)+.btn:active
 {
    color: var(--bs-btn-active-bg);
 }

 .gap-35 {
  gap: 3.5rem !important;
 }

 .summary-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.summary-item span {
  color: #6c757d;
  font-size: 0.9rem;
  max-width: 65%;
}

.summary-item strong {
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

.col-one {
  color: black; 
  font-weight: 400; 
  font-size: 14px;
}

.expand-icon {
    cursor: pointer;
    font-weight: bold;
    text-align: center;
}

.invoice-row {
    cursor: pointer;
}

.invoice-lines-row td {
    padding: 12px 16px;
    background: #fafafa;
}

.invoice-lines-table {
    width: 100%;
    border-collapse: collapse;
}

.invoice-lines-table th {
    font-size: 12px;
    color: #777;
    text-align: left;
    padding-bottom: 6px;
}

.invoice-lines-table td {
    padding: 6px 0;
}
