/* Home visits page — reference matched 2026-09-12 */
.home-visits-page{display:block;padding:0 18px 24px;background:linear-gradient(180deg,#faf6f1 0%,#f7f0ea 100%);direction:rtl}
.home-visits-page[hidden]{display:none!important}.lang-en .home-visits-page{direction:ltr}
.hv-hero{position:relative;height:196px;border:1px solid #eadfd8;border-radius:20px;overflow:hidden;background:linear-gradient(120deg,#fffdfb 0%,#fff9f4 54%,#f8e8df 100%);box-shadow:0 12px 34px rgba(93,41,27,.08)}
.hv-hero-art{position:absolute;inset:0 47% 0 0;background:url('/assets/archive-home-art.jpg') center/cover no-repeat}
.hv-hero-art:after{content:'';position:absolute;inset:0;background:linear-gradient(90deg,rgba(70,15,24,.18),rgba(255,250,245,.06) 68%,#fffaf6 100%)}
.hv-hero-copy{position:absolute;right:3.8%;top:28px;width:49%;text-align:right}.lang-en .hv-hero-copy{right:auto;left:3.8%;text-align:left}
.hv-hero-copy small{display:flex;align-items:center;gap:12px;color:#b5793d;font-weight:700;font-size:13px}.hv-hero-copy small:before,.hv-hero-copy small:after{content:'';width:34px;height:1px;background:#cf9c64}
.hv-hero-copy h1{margin:8px 0 2px;color:#88001f;font:800 36px/1.3 'Noto Kufi Arabic','IBM Plex Sans Arabic',sans-serif}.hv-hero-copy p{margin:0;color:#71666a;font-size:14px}
.hv-hero-quote{position:absolute;left:28px;bottom:28px;color:#fff;font:700 18px/1.7 'IBM Plex Sans Arabic',sans-serif;text-shadow:0 3px 12px rgba(0,0,0,.55);max-width:260px;text-align:right}.lang-en .hv-hero-quote{left:auto;right:28px;text-align:left}
.hv-hero-wave{position:absolute;left:-4%;right:-4%;bottom:-22px;height:62px;border-radius:50% 50% 0 0/100% 100% 0 0;background:linear-gradient(90deg,#8d001e,#a20d31 46%,#b7687d 72%,#96485f);opacity:.95;border-top:2px solid #e2b884}
.hv-sync-strip{height:34px;margin:10px 0;display:flex;align-items:center;justify-content:space-between;padding:0 12px;border:1px solid #eadfd7;border-radius:12px;background:rgba(255,255,255,.88);color:#8a0021;font-size:11px;font-weight:700}
.hv-sync-strip .hv-live{display:flex;align-items:center;gap:7px}.hv-sync-strip .hv-live i{width:8px;height:8px;border-radius:50%;background:#16a55a;box-shadow:0 0 0 4px rgba(22,165,90,.10)}
.hv-kpis{display:grid;grid-template-columns:repeat(6,1fr);gap:10px;margin-bottom:12px}.hv-kpi{min-height:88px;border:1px solid #eadfd7;border-radius:14px;background:#fff;padding:12px 13px;display:grid;grid-template-columns:46px 1fr;align-items:center;gap:10px;box-shadow:0 8px 24px rgba(93,41,27,.055)}
.hv-kpi>i{width:44px;height:44px;border-radius:50%;display:grid;place-items:center;font-style:normal;font-size:21px;background:#fff1f3;color:#8e0022;border:1px solid #f1dfe4}.hv-kpi b,.hv-kpi strong,.hv-kpi small{display:block}.hv-kpi b{font-size:11px;color:#7f2336}.hv-kpi strong{font-size:23px;color:#8a001f;line-height:1.1}.hv-kpi small{font-size:9px;color:#998b8f;margin-top:3px}
.hv-kpi.success{background:#f5fbf6}.hv-kpi.success>i{background:#e9f8ed;color:#16934f}.hv-kpi.warning{background:#fffaf2}.hv-kpi.warning>i{background:#fff2d9;color:#c08022}.hv-kpi.info{background:#f6f7ff}.hv-kpi.info>i{background:#eceeff;color:#5365d8}.hv-kpi.danger{background:#fff5f5}.hv-kpi.danger>i{background:#ffe9ea;color:#d33345}
.hv-layout{display:grid;grid-template-columns:270px minmax(0,1fr);gap:12px;direction:ltr}.hv-layout>*{direction:rtl}.lang-en .hv-layout>*{direction:ltr}
.hv-side{display:grid;gap:10px;align-content:start}.hv-side-card{border:1px solid #eadfd8;border-radius:16px;background:#fff;padding:14px;box-shadow:0 8px 24px rgba(93,41,27,.055)}
.hv-side-card h3{margin:0 0 2px;color:#890020;font:800 15px 'Noto Kufi Arabic',sans-serif}.hv-side-card>small{display:block;color:#9a8b8f;font-size:9px;margin-bottom:12px}
.hv-bars{display:grid;grid-template-columns:repeat(7,1fr);align-items:end;height:128px;gap:8px}.hv-bar{display:flex;flex-direction:column;align-items:center;justify-content:end;height:100%}.hv-bar b{font-size:9px;color:#66575b;margin-bottom:4px}.hv-bar i{display:block;width:100%;max-width:24px;border-radius:5px 5px 2px 2px;background:linear-gradient(180deg,#a40b31,#e5b2ae);min-height:10px}.hv-bar span{font-size:8px;color:#8f8185;margin-top:5px}
.hv-donut-wrap{display:flex;align-items:center;gap:14px}.hv-donut{width:105px;height:105px;border-radius:50%;background:conic-gradient(#8a001f 0 45%,#ca8f8a 45% 70%,#e1c7a5 70% 90%,#f2e2ca 90% 100%);position:relative;flex:0 0 105px}.hv-donut:after{content:'';position:absolute;inset:24px;border-radius:50%;background:#fff}
.hv-status-list{display:grid;gap:7px;font-size:10px;color:#5e5356;flex:1}.hv-status-list p{margin:0;display:grid;grid-template-columns:8px 1fr auto;align-items:center;gap:6px}.hv-status-list i{width:7px;height:7px;border-radius:50%}
.hv-region-list{display:grid;gap:9px}.hv-region{display:grid;grid-template-columns:68px 1fr 24px;align-items:center;gap:7px;font-size:9px;color:#65595d}.hv-region>i{height:6px;border-radius:99px;background:#efe6e1;overflow:hidden}.hv-region>i:after{content:'';display:block;height:100%;width:var(--w);border-radius:inherit;background:linear-gradient(90deg,#8c001f,#c24a65)}
.hv-main{min-width:0}.hv-toolbar{min-height:52px;border:1px solid #eadfd8;border-radius:15px;background:#fff;padding:8px 10px;display:flex;align-items:center;gap:8px;box-shadow:0 8px 24px rgba(93,41,27,.055);margin-bottom:9px}.hv-toolbar h2{margin:0 auto 0 0;color:#84001f;font:800 15px 'Noto Kufi Arabic',sans-serif}.lang-en .hv-toolbar h2{margin:0 0 0 auto}.hv-toolbar button,.hv-toolbar select{height:34px;border:1px solid #e9dcd4;border-radius:10px;background:#fff;color:#6c5b60;padding:0 12px;font-weight:700;font-size:10px}.hv-toolbar .hv-add{border:0;background:linear-gradient(135deg,#a40b31,#760018);color:#fff;box-shadow:0 6px 15px rgba(121,0,24,.18)}
.hv-list{display:grid;gap:8px}.hv-patient{border:1px solid #eadfd8;border-radius:15px;background:#fff;overflow:hidden;box-shadow:0 8px 24px rgba(93,41,27,.05);transition:.22s}.hv-patient.open{border-color:#d6b37d;box-shadow:0 12px 30px rgba(93,41,27,.10)}
.hv-patient-row{display:grid;grid-template-columns:44px minmax(170px,1.45fr) minmax(80px,.65fr) minmax(100px,.85fr) minmax(120px,1fr) minmax(115px,.9fr) minmax(100px,.85fr);gap:8px;align-items:center;min-height:62px;padding:8px 10px;cursor:pointer}.hv-patient-row:hover{background:#fffaf7}
.hv-expand-btn{width:32px;height:32px;border:1px solid #eadfd8;border-radius:50%;background:#fff;color:#8a001f;display:grid;place-items:center;transition:.22s}.hv-patient.open .hv-expand-btn{transform:rotate(180deg);background:#fff3f5}
.hv-person{display:flex;align-items:center;gap:9px;min-width:0}.hv-avatar{width:38px;height:38px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(145deg,#f4e2df,#fff8f4);border:1px solid #ead7d3;color:#890020;font-weight:800;flex:0 0 38px}.hv-person div{min-width:0}.hv-person b,.hv-person small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.hv-person b{color:#3b2d31;font-size:12px}.hv-person small{color:#988a8e;font-size:8.5px;margin-top:2px}
.hv-cell{min-width:0;border-inline-start:1px solid #f1e8e3;padding-inline-start:8px}.hv-cell small,.hv-cell b{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.hv-cell small{color:#a08f93;font-size:8px}.hv-cell b{color:#5f5055;font-size:10px;margin-top:3px}.hv-state{justify-self:start;min-width:86px;padding:6px 9px;border-radius:999px;font-size:9px;font-weight:800;text-align:center;background:#eaf8ee;color:#21864b}.hv-state.scheduled{background:#fff4df;color:#b77b1c}.hv-state.active{background:#edf1ff;color:#5667ca}.hv-state.cancelled{background:#ffecef;color:#c83449}
.hv-expand{display:grid;grid-template-rows:0fr;opacity:0;border-top:1px solid transparent;transition:grid-template-rows .28s ease,opacity .22s ease}.hv-patient.open .hv-expand{grid-template-rows:1fr;opacity:1;border-top-color:#eee1da}.hv-expand-inner{min-height:0;overflow:hidden;background:linear-gradient(180deg,#fffdfb,#fbf5f0)}
.hv-tabs{height:38px;padding:0 12px;display:flex;align-items:end;justify-content:flex-start;gap:5px;border-bottom:1px solid #eee2dc}.hv-tabs button{height:34px;border:0;background:transparent;color:#75666a;font-size:9px;font-weight:700;padding:0 14px;border-radius:8px 8px 0 0}.hv-tabs button.active{color:#85001f;background:#fff;box-shadow:0 3px 0 #85001f}
.hv-detail-grid{display:grid;grid-template-columns:1.1fr 1fr 1fr 1fr;gap:8px;padding:11px 12px 12px}.hv-detail-card{min-height:92px;border:1px solid #eadfd7;border-radius:12px;background:#fff;padding:11px}.hv-detail-card h4{margin:0 0 7px;color:#790018;font-size:10px}.hv-detail-card p{margin:0;color:#6f6165;font-size:9px;line-height:1.8}.hv-detail-card b{color:#45383c}.hv-visit-date{font-size:15px!important;font-weight:800;color:#790018!important}
.hv-empty{padding:50px 20px;text-align:center;border:1px solid #eadfd8;border-radius:16px;background:#fff;color:#8c7f83}.hv-empty b{display:block;color:#85001f;font-size:16px;margin-bottom:5px}
.hv-modal{position:fixed;inset:0;z-index:260;background:rgba(45,10,18,.45);backdrop-filter:blur(4px);display:grid;place-items:center;padding:16px}.hv-modal[hidden]{display:none}.hv-modal-card{width:min(720px,100%);max-height:90vh;overflow:auto;border-radius:20px;background:#fff;padding:20px;box-shadow:0 30px 80px rgba(45,10,18,.28);direction:rtl}.lang-en .hv-modal-card{direction:ltr}.hv-modal-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px}.hv-modal-head h3{margin:0;color:#85001f;font:800 18px 'Noto Kufi Arabic',sans-serif}.hv-modal-close{width:36px;height:36px;border:0;border-radius:50%;background:#fff0f2;color:#8b001f;font-size:20px}.hv-form{display:grid;grid-template-columns:1fr 1fr;gap:10px}.hv-form label{display:grid;gap:5px;color:#6e5e62;font-size:10px;font-weight:700}.hv-form label.full{grid-column:1/-1}.hv-form input,.hv-form select,.hv-form textarea{width:100%;border:1px solid #e4d7cf;border-radius:11px;background:#fffdfa;padding:10px;outline:0;color:#3f3337}.hv-form textarea{min-height:90px;resize:vertical}.hv-form-actions{grid-column:1/-1;display:flex;justify-content:flex-end;gap:8px;margin-top:5px}.hv-form-actions button{height:38px;border:0;border-radius:10px;padding:0 18px;font-weight:800}.hv-save{background:linear-gradient(135deg,#a40b31,#760018);color:#fff}.hv-cancel{background:#f4ece7;color:#6a565c}
@media(max-width:1250px){.hv-kpis{grid-template-columns:repeat(3,1fr)}.hv-layout{grid-template-columns:235px minmax(0,1fr)}.hv-patient-row{grid-template-columns:40px minmax(150px,1.4fr) minmax(80px,.6fr) minmax(100px,.8fr) minmax(110px,.9fr) minmax(95px,.8fr)}.hv-patient-row>.hv-cell:nth-of-type(5){display:none}.hv-detail-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:900px){.home-visits-page{padding:0 10px 18px}.hv-hero{height:250px}.hv-hero-art{inset:0 0 92px 0;background-position:center 35%}.hv-hero-art:after{background:linear-gradient(180deg,rgba(80,15,28,.05),rgba(255,250,246,.06) 66%,#fffaf6 100%)}.hv-hero-copy{right:18px;left:18px;top:auto;bottom:24px;width:auto;text-align:center}.lang-en .hv-hero-copy{right:18px;left:18px;text-align:center}.hv-hero-copy small{justify-content:center}.hv-hero-copy h1{font-size:25px}.hv-hero-copy p{font-size:11px}.hv-hero-quote{display:none}.hv-hero-wave{height:32px;bottom:-16px}.hv-sync-strip{font-size:9px}.hv-kpis{grid-template-columns:repeat(2,1fr);gap:7px}.hv-kpi{min-height:76px;grid-template-columns:38px 1fr;padding:9px}.hv-kpi>i{width:36px;height:36px}.hv-kpi strong{font-size:20px}.hv-layout{grid-template-columns:1fr;direction:rtl}.hv-side{grid-template-columns:1fr 1fr}.hv-side-card:last-child{grid-column:1/-1}.hv-toolbar{flex-wrap:wrap}.hv-toolbar h2{flex:1 1 100%;order:-1}.hv-toolbar button,.hv-toolbar select{flex:1}.hv-patient-row{grid-template-columns:34px minmax(0,1fr) 88px 96px;min-height:64px}.hv-patient-row>.hv-cell{display:none}.hv-patient-row>.hv-cell:nth-of-type(1),.hv-patient-row>.hv-cell:nth-of-type(4){display:block}.hv-detail-grid{grid-template-columns:1fr 1fr}.hv-tabs{overflow:auto}.hv-tabs button{white-space:nowrap;padding-inline:10px}.hv-form{grid-template-columns:1fr}}
@media(max-width:520px){.hv-kpis{grid-template-columns:1fr 1fr}.hv-kpi{min-height:70px}.hv-kpi b{font-size:9px}.hv-kpi small{display:none}.hv-side{grid-template-columns:1fr}.hv-side-card:last-child{grid-column:auto}.hv-patient-row{grid-template-columns:32px minmax(0,1fr) 84px}.hv-patient-row>.hv-cell:nth-of-type(1){display:none}.hv-detail-grid{grid-template-columns:1fr}.hv-toolbar .hv-filter{display:none}.hv-hero-copy h1{font-size:22px}.hv-sync-strip>span:last-child{display:none}}
body.home-visits-view .dashboard{display:none!important}body.home-visits-view .home-visits-page{display:block!important}

/* Home visit profile tabs + record actions 2026-09-12 */
.hv-tabs{height:46px;align-items:stretch;padding:0 14px;gap:6px;background:#fffdfb}
.hv-tabs button{height:46px;padding:0 18px;font-family:'IBM Plex Sans Arabic','Noto Kufi Arabic',sans-serif;font-size:12px;font-weight:700;color:#5d5054;cursor:pointer;transition:.18s ease}
.hv-tabs button:hover{color:#870020;background:#fff7f7}.hv-tabs button.active{color:#8a001f;background:#fff;font-weight:800;box-shadow:inset 0 -3px 0 #8a001f}
.hv-tab-panels{background:linear-gradient(180deg,#fffdfb,#fbf5f0)}.hv-tab-panel{display:none}.hv-tab-panel.active{display:block;animation:hvTabIn .22s ease}
@keyframes hvTabIn{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
.hv-wide-card{margin:12px;border:1px solid #eadfd7;border-radius:14px;background:#fff;padding:16px 18px;min-height:94px}.hv-wide-card h4{margin:0 0 10px;color:#85001f;font:800 13px 'IBM Plex Sans Arabic',sans-serif}.hv-wide-card>b{display:block;color:#43363a;font-size:13px;margin-bottom:5px}.hv-wide-card p{margin:0;color:#66595d;font-size:12px;line-height:1.9}
.hv-history-list{display:grid;gap:7px}.hv-history-list>div{display:grid;grid-template-columns:130px 1fr 110px;gap:12px;align-items:center;padding:9px 11px;border:1px solid #f0e5df;border-radius:10px;background:#fffaf7}.hv-history-list b{color:#7e001d}.hv-history-list span{color:#5e5356}.hv-history-list em{font-style:normal;color:#16844b;font-weight:700;text-align:center}
.hv-record-actions{display:flex;justify-content:flex-end;gap:8px;padding:10px 12px 0;background:#fffdfb}.hv-record-actions button{height:34px;border-radius:10px;padding:0 14px;font-family:'IBM Plex Sans Arabic',sans-serif;font-size:11px;font-weight:800;cursor:pointer;transition:.18s}.hv-edit-record{border:1px solid #d9b77d;background:#fff9ef;color:#7d5419}.hv-edit-record:hover{background:#fff1d8}.hv-delete-record{border:1px solid #efc7ce;background:#fff1f3;color:#a10c2e}.hv-delete-record:hover{background:#ffe5ea}
@media(max-width:900px) and (min-width:521px){.hv-side-card:last-child{grid-column:auto}}
@media(max-width:520px){.hv-tabs{height:42px;padding:0 8px}.hv-tabs button{height:42px;padding:0 11px;font-size:11px}.hv-record-actions{justify-content:stretch}.hv-record-actions button{flex:1}.hv-history-list>div{grid-template-columns:1fr;gap:4px}.hv-history-list em{text-align:start}}

/* Full home-visit clinical edit scope 2026-09-12 */
.hv-clinical-field{padding:10px 12px;border:1px solid #efe3dc;border-radius:13px;background:#fffaf7}
.hv-clinical-field>span{font-family:'IBM Plex Sans Arabic',sans-serif;font-size:12px;font-weight:800;color:#83001e}
.hv-file-hint{font-size:9.5px;color:#8d7e82;font-weight:500}
.hv-attachments-list{display:grid;gap:8px;margin-top:8px}.hv-attachment-item{display:flex;align-items:center;gap:8px;padding:10px 11px;border:1px solid #eee1da;border-radius:11px;background:#fffaf7}
.hv-attachment-item a{min-width:0;flex:1;text-decoration:none}.hv-attachment-item b,.hv-attachment-item small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.hv-attachment-item b{color:#720018;font-size:11px}.hv-attachment-item small{color:#94868a;font-size:8.5px;margin-top:2px}
.hv-delete-attachment{width:30px;height:30px;border:1px solid #efcbd1;border-radius:9px;background:#fff0f2;color:#a20b2c;font-size:17px;cursor:pointer}
.hv-wide-card>p{white-space:pre-wrap;overflow-wrap:anywhere}.hv-form textarea[name="carePlan"],.hv-form textarea[name="medications"],.hv-form textarea[name="medicalHistory"]{min-height:110px}
@media(max-width:520px){.hv-clinical-field{padding:9px}.hv-attachment-item{padding:9px}.hv-attachment-item b{font-size:10px}}

/* Patient-information-only layout — 2026-09-12 */
.hv-layout.hv-patient-only{display:block;direction:rtl}
.lang-en .hv-layout.hv-patient-only{direction:ltr}
.hv-layout.hv-patient-only .hv-main{width:100%;min-width:0}
.hv-layout.hv-patient-only .hv-toolbar{min-height:66px;padding:10px 14px;margin-bottom:12px}
.hv-layout.hv-patient-only .hv-toolbar h2{font-size:20px;line-height:1.5}
.hv-layout.hv-patient-only .hv-toolbar button,.hv-layout.hv-patient-only .hv-toolbar select{height:40px;font-size:13px;padding:0 15px}
.hv-layout.hv-patient-only .hv-list{gap:10px}
.hv-layout.hv-patient-only .hv-patient{border-radius:16px}
.hv-layout.hv-patient-only .hv-patient-row{min-height:82px;padding:12px 14px;grid-template-columns:48px minmax(210px,1.55fr) minmax(110px,.75fr) minmax(125px,.9fr) minmax(145px,1fr) minmax(125px,.9fr) minmax(110px,.8fr)}
.hv-layout.hv-patient-only .hv-expand-btn{width:36px;height:36px;font-size:18px}
.hv-layout.hv-patient-only .hv-avatar{width:46px;height:46px;flex-basis:46px;font-size:15px}
.hv-layout.hv-patient-only .hv-person{gap:12px}
.hv-layout.hv-patient-only .hv-person b{font-size:17px;font-weight:800;color:#2f2327}
.hv-layout.hv-patient-only .hv-person small{font-size:11px;margin-top:4px;color:#87787d}
.hv-layout.hv-patient-only .hv-cell{padding-inline-start:12px}
.hv-layout.hv-patient-only .hv-cell small{font-size:11px;font-weight:700;color:#8b7b80}
.hv-layout.hv-patient-only .hv-cell b{font-size:14px;font-weight:800;color:#4d3f44;margin-top:5px}
.hv-layout.hv-patient-only .hv-state{min-width:96px;padding:8px 12px;font-size:12px}
.hv-layout.hv-patient-only .hv-tabs button{font-size:14px}
.hv-layout.hv-patient-only .hv-detail-card h4,.hv-layout.hv-patient-only .hv-wide-card h4{font-size:14px}
.hv-layout.hv-patient-only .hv-detail-card p,.hv-layout.hv-patient-only .hv-wide-card p{font-size:13px;line-height:1.9}
.hv-layout.hv-patient-only .hv-detail-card b,.hv-layout.hv-patient-only .hv-wide-card b{font-size:14px}
@media(max-width:1250px){
.hv-layout.hv-patient-only .hv-patient-row{grid-template-columns:44px minmax(190px,1.5fr) minmax(95px,.7fr) minmax(110px,.8fr) minmax(125px,.95fr) minmax(105px,.8fr)}
}
@media(max-width:900px){
.hv-layout.hv-patient-only .hv-toolbar h2{font-size:18px}
.hv-layout.hv-patient-only .hv-patient-row{grid-template-columns:40px minmax(0,1fr) 110px 115px;min-height:78px;padding:10px 12px}
.hv-layout.hv-patient-only .hv-person b{font-size:15px}
.hv-layout.hv-patient-only .hv-person small{font-size:10px}
.hv-layout.hv-patient-only .hv-cell small{font-size:10px}
.hv-layout.hv-patient-only .hv-cell b{font-size:12px}
.hv-layout.hv-patient-only .hv-tabs button{font-size:12px}
}
@media(max-width:520px){
.hv-layout.hv-patient-only .hv-toolbar{min-height:58px;padding:8px 10px}
.hv-layout.hv-patient-only .hv-toolbar h2{font-size:16px}
.hv-layout.hv-patient-only .hv-patient-row{grid-template-columns:36px minmax(0,1fr) 98px;min-height:74px;padding:9px 10px}
.hv-layout.hv-patient-only .hv-avatar{width:42px;height:42px;flex-basis:42px;font-size:13px}
.hv-layout.hv-patient-only .hv-person b{font-size:14px}
.hv-layout.hv-patient-only .hv-state{min-width:84px;font-size:11px;padding:7px 9px}
.hv-layout.hv-patient-only .hv-detail-card p,.hv-layout.hv-patient-only .hv-wide-card p{font-size:12px}
}
