/* CliNext: patient card density, consistent hierarchy and accessible
 * inline detail editing. Data, permissions and handlers remain unchanged. */
#dashboard[data-workspace="patients"] .cl-compact-patient{color:#223f51}
#dashboard[data-workspace="patients"] .cl-compact-patient>.top{
 gap:12px;margin:0 0 7px!important;min-height:46px
}
#dashboard[data-workspace="patients"] .cl-compact-patient #patientTitle{
 font-size:20px;line-height:1.2;color:#143f57
}
#dashboard[data-workspace="patients"] .cl-compact-patient .cl-patient-emblem{
 width:39px;height:39px;flex-basis:39px;font-size:22px
}
#dashboard[data-workspace="patients"] .cl-compact-patient #patientSubtitle{
 margin:1px 0 7px;padding-left:49px;color:#617a8b;font-size:12px
}
#dashboard[data-workspace="patients"] .cl-compact-patient #clPatientStats{
 gap:8px;margin:9px 0 13px
}
#dashboard[data-workspace="patients"] .cl-compact-patient .cl-stat{
 padding:10px 12px;background:#fafcfe;border-color:#dde8ef
}
#dashboard[data-workspace="patients"] .cl-compact-patient .cl-stat small{
 font-size:11px;color:#698295
}
#dashboard[data-workspace="patients"] .cl-compact-patient .cl-stat strong{
 font-size:13px;color:#254b62
}
#dashboard[data-workspace="patients"] .cl-compact-patient .cl-dr-cockpit{
 margin:9px 0 13px;padding:15px 16px;border-radius:11px;
 border-color:#cfe1e9;background:#f4f9fb
}
#dashboard[data-workspace="patients"] .cl-compact-patient .cl-dr-section-heading{
 margin-bottom:10px;gap:9px
}
#dashboard[data-workspace="patients"] .cl-compact-patient .cl-dr-section-heading h3{
 font-size:16px
}
#dashboard[data-workspace="patients"] .cl-compact-patient .cl-dr-safety-grid{
 gap:9px;margin-bottom:9px
}
#dashboard[data-workspace="patients"] .cl-compact-patient .cl-dr-safety{
 padding:11px 12px;border-radius:8px
}
#dashboard[data-workspace="patients"] .cl-compact-patient .cl-dr-safety>strong{
 font-size:13px;margin-bottom:5px
}
#dashboard[data-workspace="patients"] .cl-compact-patient .cl-dr-lines{
 font-size:12px;line-height:1.5
}
#dashboard[data-workspace="patients"] .cl-compact-patient .cl-dr-brief-panel{
 padding:12px 13px;line-height:1.5
}
#dashboard[data-workspace="patients"] .cl-compact-patient .cl-dr-brief-panel h4{
 font-size:13px;margin-bottom:5px
}
#dashboard[data-workspace="patients"] .cl-compact-patient #clPatientDetailGrid.cl-patient-overview{
 align-items:start;gap:12px;margin:8px 0 14px
}
#dashboard[data-workspace="patients"] .cl-compact-patient #clPatientDetailGrid.cl-patient-overview
 > .cl-visit-nav,
#dashboard[data-workspace="patients"] .cl-compact-patient #clPatientDetailGrid.cl-patient-overview
 > .cl-rail{
 align-self:start;min-height:0;padding:13px 14px
}
#dashboard[data-workspace="patients"] .cl-compact-patient .cl-visit-item{
 gap:5px 8px;padding:9px 10px;margin:5px 0;align-items:center
}
#dashboard[data-workspace="patients"] .cl-compact-patient .cl-visit-date{
 font-size:13px;flex:1 1 130px;color:#2b5068
}
#dashboard[data-workspace="patients"] .cl-compact-patient .cl-visit-item button{
 font-size:12px!important;padding:6px 9px!important;min-height:29px
}
#dashboard[data-workspace="patients"] .cl-compact-patient .cl-safety-card{
 padding:10px 12px;margin:0;border-color:#dbe7ee
}
#dashboard[data-workspace="patients"] .cl-compact-patient .cl-safety-card>strong{
 font-size:13px;padding-right:140px
}
#dashboard[data-workspace="patients"] .cl-compact-patient .cl-safety-card p{
 font-size:12px;line-height:1.5
}
#dashboard[data-workspace="patients"] .cl-compact-patient .cl-safety-quick-action{
 font-size:12px;padding:6px 9px
}
#dashboard[data-workspace="patients"] .cl-compact-patient #clLongitudinalQuickPanel{
 margin:10px 0 0;padding:10px 12px
}
#dashboard[data-workspace="patients"] .cl-compact-patient #clLongitudinalQuickPanel strong{
 font-size:13px
}
#dashboard[data-workspace="patients"] .cl-compact-patient #clLongitudinalQuickPanel p{
 font-size:12px;line-height:1.5;margin:6px 0
}
#dashboard[data-workspace="patients"] .cl-compact-patient #clLongitudinalQuickPanel button{
 font-size:12px;padding:7px 10px;margin-top:7px
}
#dashboard[data-workspace="patients"] .cl-compact-patient .tabs{
 margin:12px 0 5px;padding-bottom:8px;gap:6px
}
#dashboard[data-workspace="patients"] .cl-compact-patient #clCompactMeaning{
 font-size:12px;line-height:1.5;margin:4px 0 8px
}
#dashboard[data-workspace="patients"] .cl-compact-patient .cl-compact-tab-area #tabContent{
 padding:4px 1px;border:0;background:transparent
}
/* Four permanent data categories become scannable, independently expandable
 * cards. Allergies/medicines remain open by default, because they matter at
 * every visit; history and surgery remain one click away. */
#dashboard[data-workspace="patients"] .cl-compact-patient:has(.tabs button[data-tab="permanent"].active)
 #tabContent{
 display:grid;grid-template-columns:repeat(2,minmax(0,1fr));
 gap:12px;margin:0;padding:0;align-items:start
}
#dashboard[data-workspace="patients"] .cl-compact-patient
 .cl-permanent-section{
 min-width:0;max-width:100%;margin:0;padding:0;
 border:1px solid #d4e4ec;border-radius:10px;
 background:#fff;overflow:clip;align-self:start
}
#dashboard[data-workspace="patients"] .cl-compact-patient
 .cl-permanent-section[open]{
 border-color:#bcd8e5;box-shadow:0 2px 12px #18485a0a
}
#dashboard[data-workspace="patients"] .cl-compact-patient
 .cl-permanent-summary{
 display:flex;align-items:center;gap:10px;justify-content:space-between;
 list-style:none;position:relative;cursor:pointer;
 padding:13px 17px;background:#f5f9fc;color:#1c455d;
 font-size:14px;font-weight:750;border-bottom:1px solid transparent
}
#dashboard[data-workspace="patients"] .cl-compact-patient
 .cl-permanent-summary::-webkit-details-marker{display:none}
#dashboard[data-workspace="patients"] .cl-compact-patient
 .cl-permanent-summary:before{
 content:"▸";font-size:14px;color:#49788e;margin-right:2px
}
#dashboard[data-workspace="patients"] .cl-compact-patient
 .cl-permanent-section[open]>.cl-permanent-summary:before{content:"▾"}
#dashboard[data-workspace="patients"] .cl-compact-patient
 .cl-permanent-section[open]>.cl-permanent-summary{
 border-bottom-color:#dce9ef;background:#eef6fa
}
#dashboard[data-workspace="patients"] .cl-compact-patient
 .cl-permanent-summary:focus-visible{
 outline:2px solid #187c9a;outline-offset:-3px
}
#dashboard[data-workspace="patients"] .cl-compact-patient
 .cl-permanent-heading{flex:1;min-width:0;overflow-wrap:anywhere}
#dashboard[data-workspace="patients"] .cl-compact-patient
 .cl-permanent-count{
 font:650 11px/1.4 system-ui,sans-serif;color:#4a7186;
 background:white;padding:4px 8px;border:1px solid #d5e3eb;
 border-radius:20px;white-space:nowrap
}
#dashboard[data-workspace="patients"] .cl-compact-patient
 .cl-permanent-section-body{padding:11px 15px 13px}
#dashboard[data-workspace="patients"] .cl-compact-patient
 .cl-permanent-actions{
 display:flex;justify-content:flex-end;margin:-2px 0 5px
}
#dashboard[data-workspace="patients"] .cl-compact-patient
 .cl-permanent-actions>button{
 font-size:12px;padding:7px 11px;border-radius:7px;
 background:#edf5fa;color:#245b75;border:1px solid #d3e5ef
}
#dashboard[data-workspace="patients"] .cl-compact-patient
 .cl-permanent-row{
 display:grid;grid-template-columns:minmax(0,1fr) auto;
 gap:12px;align-items:center;padding:9px 0;border-bottom:1px solid #ebf0f3
}
#dashboard[data-workspace="patients"] .cl-compact-patient
 .cl-permanent-row:last-child{border-bottom:0}
#dashboard[data-workspace="patients"] .cl-compact-patient
 .cl-permanent-record{
 font-size:13px;line-height:1.45;overflow-wrap:anywhere;
 color:#2d4a5c;min-width:0
}
#dashboard[data-workspace="patients"] .cl-compact-patient
 .cl-permanent-row>button{
 font-size:12px;padding:7px 9px;min-height:32px;border-radius:6px
}
#dashboard[data-workspace="patients"] .cl-compact-patient
 .cl-permanent-empty{font-size:12px;color:#657f8f;margin:7px 0}
#dashboard[data-workspace="patients"] .cl-compact-patient
 .cl-permanent-rows>form{
 border:1px solid #d8e7ed;border-radius:9px;margin:8px 0;
 padding:12px!important;background:#f5fafc!important
}
#dashboard[data-workspace="patients"] .cl-compact-patient
 .cl-permanent-rows>form>label{
 font-size:12px;margin:4px 0;color:#35596e
}
#dashboard[data-workspace="patients"] .cl-compact-patient
 .cl-permanent-rows>form input,
#dashboard[data-workspace="patients"] .cl-compact-patient
 .cl-permanent-rows>form select{
 margin-top:5px;padding:8px 10px;font-size:13px;min-width:0
}
#dashboard[data-workspace="patients"] .cl-compact-patient
 .cl-permanent-rows>form button{font-size:12px;padding:8px 12px}
@media(max-width:1180px){
 #dashboard[data-workspace="patients"] .cl-compact-patient:has(.tabs button[data-tab="permanent"].active) #tabContent{
  grid-template-columns:minmax(0,1fr)
 }
 #dashboard[data-workspace="patients"] .cl-compact-patient #clPatientDetailGrid.cl-patient-overview{
  grid-template-columns:minmax(0,1fr)
 }
}
@media(max-width:850px){
 #dashboard[data-workspace="patients"] .cl-compact-patient .cl-dr-safety-grid,
 #dashboard[data-workspace="patients"] .cl-compact-patient .cl-dr-cockpit-grid{
  grid-template-columns:minmax(0,1fr)
 }
 #dashboard[data-workspace="patients"] .cl-compact-patient #clPatientDetailGrid.cl-patient-overview{
  grid-template-columns:minmax(0,1fr)
 }
}


/* 2026-10-13 · Retire duplicate overview rail without touching clinical data.
   Vizit history takes the usable width; safety still appears in the primary
   physician cockpit and permanent clinical record cards above/below. */
#dashboard[data-workspace="patients"] .cl-compact-patient #clClinicalRail{
 display:none!important;
}
#dashboard[data-workspace="patients"] .cl-compact-patient
 #clPatientDetailGrid.cl-patient-overview{
 grid-template-columns:minmax(0,1fr)!important;
 margin:8px 0 12px;
}
#dashboard[data-workspace="patients"] .cl-compact-patient
 #clPatientDetailGrid.cl-patient-overview>.cl-visit-nav{
 width:100%;min-height:0;align-self:start;
 padding:12px 14px;
}
#dashboard[data-workspace="patients"] .cl-compact-patient
 #clPatientDetailGrid .cl-visit-item{
 display:flex;align-items:center;gap:8px 10px;
 flex-wrap:wrap;padding:9px 12px;
}
#dashboard[data-workspace="patients"] .cl-compact-patient
 #clPatientDetailGrid .cl-visit-date{
 flex:1 1 170px;
}
#dashboard[data-workspace="patients"] .cl-compact-patient
 #clPatientDetailGrid .cl-visit-item button{
 flex:0 0 auto;min-height:32px;
}
/* No duplicate safety records or pointless gaps should survive re-renders. */
#dashboard[data-workspace="patients"] #clFullClinicalSafety,
#dashboard[data-workspace="patients"] #clLongitudinalQuickPanel{
 display:none!important;
}
