/* SOAH Finance patient card V2 — hybrid: legacy visual grouping + modern identity/photo */
#finance-section .finance-patient-card{
  display:grid;
  grid-template-columns:minmax(0,1fr) 238px;
  gap:14px;
  align-items:stretch;
  margin-bottom:24px;
  overflow:hidden;
  border:1px solid #b9e1dc;
  border-radius:20px;
  padding:16px;
  background:#effbf8;
  box-shadow:0 8px 22px rgba(10,93,84,.055);
}
#finance-section .finance-patient-card::before{display:none!important}
#finance-section .finance-patient-overview{
  display:grid;
  grid-template-columns:100px minmax(290px,1.25fr) minmax(250px,.75fr);
  gap:16px;
  align-items:center;
  min-width:0;
}
#finance-section .finance-patient-avatar{
  position:relative;
  display:grid;
  place-items:center;
  width:100px;
  height:100px;
  overflow:hidden;
  border:1px solid #9ddbd4;
  border-radius:16px;
  background:#f8fffd;
  color:#00958a;
  box-shadow:0 4px 12px rgba(0,149,138,.06);
}
#finance-section .finance-patient-avatar img{
  width:100%;
  height:100%;
  display:block;
  padding:4px;
  border-radius:15px;
  background:#fff;
  object-fit:contain;
}
#finance-section #finPatientPhoto[hidden]{display:none!important}
#finance-section .finance-patient-photo-fallback{
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  align-content:center;
  gap:5px;
  color:#00958a;
}
#finance-section .finance-patient-photo-fallback[hidden]{display:none!important}
#finance-section .finance-patient-photo-fallback .ui-icon{width:28px;height:28px}
#finance-section .finance-patient-photo-fallback small{color:#627f7b;font-size:9px;font-weight:750}
#finance-section .finance-patient-avatar.is-loading .finance-patient-photo-fallback{opacity:.7}
#finance-section .finance-patient-identity{min-width:0;align-self:center}
#finance-section .finance-patient-eyebrow{
  margin:0 0 3px;
  color:#00a997;
  font-size:10px;
  font-weight:900;
}
#finance-section .finance-patient-name{
  margin:0;
  max-width:100%;
  color:#102f46;
  font-size:clamp(25px,2.15vw,32px);
  font-weight:950;
  line-height:1.14;
  letter-spacing:-.018em;
  overflow-wrap:anywhere;
  word-break:break-word;
}
#finance-section .finance-patient-hn{
  display:inline-flex;
  align-items:center;
  min-height:32px;
  margin-top:9px;
  border:1px solid #97d5ce;
  border-radius:999px;
  padding:5px 12px;
  background:#f7fffd;
  color:#076f66;
  font-size:13px;
  font-weight:900;
  line-height:1;
  font-variant-numeric:tabular-nums;
}
#finance-section .finance-communication-section{min-width:0;margin:0;align-self:center}
#finance-section .finance-comm-card{
  min-width:0;
  border:1px solid #c7dfdc;
  border-radius:12px;
  padding:9px 10px;
  background:rgba(255,255,255,.88);
  box-shadow:0 2px 8px rgba(24,70,65,.035);
}
#finance-section .finance-comm-header{
  min-height:22px;
  padding-bottom:5px;
  border-bottom:1px solid #e6f0ee;
}
#finance-section .finance-comm-heading{font-size:10px;color:#17635d;font-weight:900}
#finance-section .finance-comm-heading-icon{
  width:22px;
  height:22px;
  border-radius:7px;
  background:#e8f8f5;
  color:#008f84;
}
#finance-section .finance-comm-summary{margin-top:5px}
#finance-section .finance-comm-line-name{font-size:10.5px}
#finance-section .finance-comm-status-strip{gap:4px 8px;margin-top:5px}
#finance-section .finance-comm-warning{margin-top:5px;padding-top:4px;padding-bottom:4px;line-height:1.25}
#finance-section .finance-patient-actions{
  display:flex;
  flex-direction:column;
  min-width:0;
  border-left:1px solid #bfe2dd;
  padding:2px 0 2px 15px;
}
#finance-section .finance-patient-actions-title{
  margin:0 0 9px;
  color:#56716d;
  font-size:9.5px;
  font-weight:900;
}
#finance-section .finance-patient-action-list{display:grid;gap:7px}
#finance-section .finance-card-action{
  min-height:42px;
  border-radius:10px;
  padding:8px 11px;
  font-size:10.5px;
  font-weight:900;
  box-shadow:none;
}
#finance-section .finance-card-action .icon-label{display:inline-flex;align-items:center;justify-content:center;gap:7px}
#finance-section .finance-card-action .ui-icon{width:15px;height:15px;flex:0 0 auto}
#finance-section .finance-card-action-primary{background:#119a8e;border-color:#0d8d82;color:#fff}
#finance-section .finance-card-action-primary:hover{background:#0b887e}
#finance-section .finance-card-action-connect{background:#fffaf1;border-color:#f0b453;color:#a75308}
#finance-section .finance-card-action-connect.is-unlinked{background:#f4fffd;border-color:#69cfc4;color:#08786f}
#finance-section .finance-card-action-warning{background:#fffaf1;border-color:#e6c48e;color:#8a5b1c}
#finance-section .finance-card-action-danger{margin-top:2px;background:#fffafb;border-color:#f1b5c0;color:#d23859}
#finance-section .finance-card-action:hover:not(:disabled){transform:none;box-shadow:none}
#finance-section .finance-action-danger-mark{
  display:inline-grid;
  place-items:center;
  width:16px;
  height:16px;
  border:1px solid currentColor;
  border-radius:50%;
  font-size:12px;
  line-height:1;
}
#finance-section .finance-crm-inline{
  grid-column:1/-1;
  margin:2px 0 0;
  border:0!important;
  border-top:1px solid #bde3dd!important;
  border-radius:0!important;
  padding:10px 2px 0!important;
  background:transparent!important;
  box-shadow:none!important;
}
#finance-section .finance-crm-compact-main.finance-crm-summary-bar{
  display:grid;
  grid-template-columns:auto auto auto minmax(260px,1fr) auto;
  align-items:center;
  gap:10px 16px;
  min-height:34px;
}
#finance-section .finance-crm-tier-badge{
  display:inline-flex;
  width:max-content;
  min-width:88px;
  min-height:28px;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  padding:5px 10px;
  color:#fff!important;
  font-size:10px;
  font-weight:950;
  letter-spacing:.035em;
  line-height:1;
  white-space:nowrap;
  box-shadow:none!important;
}
#finance-section .finance-crm-tier-badge.bg-slate-500{background:#6a8098!important}
#finance-section .finance-crm-tier-badge.bg-amber-500{background:#d79a22!important}
#finance-section .finance-crm-tier-badge.bg-indigo-600{background:#4f46e5!important}
#finance-section .finance-crm-compact-metric{
  display:inline-flex;
  align-items:center;
  gap:5px;
  min-width:0;
  color:#526e6a;
  font-size:9.5px;
  white-space:nowrap;
}
#finance-section .finance-crm-compact-metric strong{font-size:12.5px;color:#163d39}
#finance-section .finance-crm-compact-points strong{font-size:17px;color:#00a997}
#finance-section .finance-crm-points-info{
  display:inline-grid;
  place-items:center;
  width:17px;
  height:17px;
  margin-left:1px;
  border:1px solid #b8d9d4;
  border-radius:50%;
  color:#527a75;
  font-size:10px;
  font-weight:900;
  line-height:1;
}
#finance-section .finance-crm-progress{min-width:180px}
#finance-section .finance-crm-progress-copy{
  overflow:hidden;
  color:#456b67;
  font-size:9.5px;
  font-weight:700;
  line-height:1.25;
  text-overflow:ellipsis;
  white-space:nowrap;
}
#finance-section .finance-crm-progress-track{
  height:5px;
  margin-top:5px;
  overflow:hidden;
  border-radius:999px;
  background:#d8e9e6;
}
#finance-section .finance-crm-progress-scale{display:none!important}
#finance-section .finance-crm-policy{display:none!important}
#finance-section .finance-crm-breakdown-details{
  position:relative;
  min-width:0;
}
#finance-section .finance-crm-breakdown-details>summary{
  display:inline-flex;
  min-height:30px;
  align-items:center;
  gap:5px;
  border:1px solid #b9ddd8;
  border-radius:9px;
  padding:5px 9px;
  background:rgba(255,255,255,.76);
  color:#08796f;
  cursor:pointer;
  font-size:9.5px;
  font-weight:900;
  white-space:nowrap;
  list-style:none;
}
#finance-section .finance-crm-breakdown-details>summary::-webkit-details-marker{display:none}
#finance-section .finance-crm-breakdown-details>summary span{
  font-size:14px;
  line-height:1;
  transition:transform .15s ease;
}
#finance-section .finance-crm-breakdown-details[open]>summary span{transform:rotate(90deg)}
#finance-section .finance-crm-breakdown{
  position:absolute;
  top:calc(100% + 7px);
  right:0;
  z-index:30;
  display:flex;
  width:max-content;
  max-width:min(520px,80vw);
  align-items:center;
  flex-wrap:nowrap;
  gap:14px;
  min-width:0;
  margin:0;
  overflow-x:auto;
  white-space:nowrap;
  scrollbar-width:none;
  border:1px solid #bfe8d8!important;
  border-radius:10px!important;
  padding:8px 10px!important;
  background:#fff!important;
  color:#244b46!important;
  box-shadow:0 10px 28px rgba(15,23,42,.12)!important;
}
#finance-section .finance-crm-breakdown::-webkit-scrollbar{display:none}
#finance-section .finance-crm-breakdown>span{flex:0 0 auto}
#finance-section .finance-crm-breakdown>span:first-child{color:#08796f;font-weight:850}

@media(max-width:1080px){
  #finance-section .finance-patient-card{grid-template-columns:1fr}
  #finance-section .finance-patient-overview{grid-template-columns:92px minmax(260px,1.2fr) minmax(230px,.8fr)}
  #finance-section .finance-patient-avatar{width:92px;height:92px}
  #finance-section .finance-patient-actions{border-top:1px solid #bfe2dd;border-left:0;padding:12px 0 0}
  #finance-section .finance-patient-action-list{grid-template-columns:repeat(3,minmax(0,1fr))}
  #finance-section .finance-card-action-danger{margin-top:0}
}
@media(max-width:820px){
  #finance-section .finance-patient-card{padding:14px;border-radius:18px}
  #finance-section .finance-patient-overview{grid-template-columns:86px minmax(0,1fr);gap:12px}
  #finance-section .finance-patient-avatar{width:86px;height:86px}
  #finance-section .finance-communication-section{grid-column:1/-1}
  #finance-section .finance-crm-compact-main.finance-crm-summary-bar{
    grid-template-columns:auto auto auto minmax(190px,1fr);
    gap:8px 10px;
  }
  #finance-section .finance-crm-breakdown-details{grid-column:1/-1;justify-self:end}
}
@media(max-width:620px){
  #finance-section .finance-patient-card{gap:12px;padding:12px}
  #finance-section .finance-patient-overview{grid-template-columns:76px minmax(0,1fr);gap:10px}
  #finance-section .finance-patient-avatar{width:76px;height:76px;border-radius:14px}
  #finance-section .finance-patient-avatar img{border-radius:12px}
  #finance-section .finance-patient-name{font-size:22px;line-height:1.18}
  #finance-section .finance-patient-hn{min-height:30px;font-size:12px;padding:5px 10px}
  #finance-section .finance-patient-action-list{grid-template-columns:1fr 1fr}
  #finance-section .finance-card-action{min-height:44px}
}
@media(max-width:620px){
  #finance-section .finance-crm-compact-main.finance-crm-summary-bar{
    grid-template-columns:auto 1fr;
    gap:8px 10px;
  }
  #finance-section .finance-crm-progress{grid-column:1/-1}
  #finance-section .finance-crm-breakdown-details{grid-column:auto;justify-self:end}
  #finance-section .finance-crm-breakdown{
    position:fixed;
    right:12px;
    left:12px;
    width:auto;
    max-width:none;
  }
}
@media(max-width:430px){
  #finance-section .finance-patient-action-list{grid-template-columns:1fr}
  #finance-section .finance-crm-compact-main.finance-crm-summary-bar{grid-template-columns:1fr 1fr}
  #finance-section .finance-crm-tier-badge{min-width:0}
}
