/* RadiologyHub, responsive RTL-first user interface */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;800&display=swap');
:root { --navy:#12304A; --teal:#0E92A5; --paper:#FFFFFF; --canvas:#F5F8FC; --amber:#E9A23B; --green:#169B74; --text:#12304A; }
* { box-sizing:border-box; }
body { margin:0; min-height:100vh; background:var(--canvas); color:var(--text); font-family:'Vazirmatn',Tahoma,sans-serif; padding-bottom:78px; }
body.login-without-bottom-nav { padding-bottom:0; }
.main-header { height:68px; background:var(--navy); color:white; display:flex; align-items:center; justify-content:space-between; padding:0 18px; }
.brand { color:white; text-decoration:none; font-weight:800; font-size:1.05rem; }
.brand:hover {color:white}
.brand-symbol { color:#49D7D6; margin-left:6px; }
.header-link { padding:8px 12px; color:white; background:transparent; border:1px solid #517086; border-radius:10px; cursor:pointer; }
.page-wrap { max-width:1040px; padding:20px 14px; margin:0 auto; }
.app-card { background:var(--paper); border:1px solid #E2EAF0; border-radius:18px; box-shadow:0 7px 22px rgba(15,40,65,.035); padding:22px; }
h1 { font-size:1.45rem; line-height:1.8; font-weight:800; margin:.25rem 0 12px; }
.eyebrow {font-size:.82rem; color:var(--teal); font-weight:800;}
.muted { color:#60798C; line-height:2; font-size:.93rem; }
.auth-card { width:100%; max-width:450px; margin:10px auto; }
.auth-card label { display:block; margin-top:17px; margin-bottom:7px; font-weight:700; font-size:.86rem; }
.form-control { border:1px solid #D9E4EA; background:#FBFCFE; padding:12px 13px; border-radius:12px; }
.form-control:focus { border-color:var(--teal); box-shadow:0 0 0 .2rem rgba(14,146,165,.12); }
.primary-button {display:block; background:var(--teal); color:white; width:100%; border:0; border-radius:12px; padding:13px; margin-top:22px; text-align:center; font-weight:800; text-decoration:none; cursor:pointer;}
.primary-button:hover { background:#087A8D; color:white; }
.as-link { max-width:280px; }
.notice-amber { background:#FFF7E9; color:#755014; border:1px solid #F5D59B; padding:14px; line-height:1.9; border-radius:12px; margin-top:20px; font-size:.86rem; }
.stat-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.stat-card { padding:18px; display:flex; flex-direction:column; gap:10px; }
.stat-card span {color:#5D788A; font-size:.84rem;}
.stat-card strong {font-size:1.7rem; color:var(--teal);}
.mobile-nav {position:fixed; z-index:100; left:0; right:0; bottom:0; padding-bottom:env(safe-area-inset-bottom); min-height:61px; background:white; border-top:1px solid #DFE8ED; display:flex; justify-content:space-evenly; align-items:center;}
.mobile-nav a {text-decoration:none; color:var(--navy); padding:11px 10px; font-size:.85rem; font-weight:700;}
@media (min-width:768px) {
 body { padding-bottom:0; }
 .main-header { padding:0 5vw; }
 .page-wrap { padding:32px 20px; }
 .auth-card { margin:55px auto; }
 .stat-grid { grid-template-columns:repeat(4,minmax(0,1fr)); gap:20px; }
 .mobile-nav {position:static; margin:60px auto 0; width:max-content; border:1px solid #DFE8ED; border-radius:20px 20px 0 0; padding:0 24px;}
}

/* Admin imaging records — mobile first, RTL, touch targets >= 44px. */
.admin-entry{margin-top:16px;display:flex;flex-direction:column;gap:10px}
.admin-entry h2,.admin-results-title h2{font-size:1.1rem;font-weight:800;margin:0}
.admin-entry p{margin:5px 0 0}
.admin-entry-button{margin:0;min-height:48px;display:grid;place-items:center}
.admin-page-heading h1{margin-bottom:0}
.admin-filter{margin:16px 0;padding:16px;display:grid;gap:10px}
.admin-filter label{font-size:.87rem;font-weight:700}
.admin-filter select{min-height:48px;min-width:0}
.admin-filter-button{margin:0;min-height:48px}
.admin-results{padding:5px 0 12px}
.admin-results-title{display:flex;justify-content:space-between;align-items:center;gap:10px;margin:8px 0 16px}
.admin-results-title span{font-size:.83rem;color:#59718a;white-space:nowrap}
.admin-study-list{display:grid;grid-template-columns:minmax(0,1fr);gap:12px}
.admin-study-card{min-width:0;padding:16px;display:grid;gap:14px}
.admin-study-main{min-width:0}
.admin-study-title{display:flex;flex-wrap:wrap;align-items:center;gap:9px;justify-content:space-between}
.admin-study-title h3{margin:0;font-size:1rem;font-weight:800;overflow-wrap:anywhere}
.admin-file-count{font-size:.76rem;color:#0c6470;background:#e7f6f6;border-radius:15px;padding:5px 9px;white-space:nowrap}
.admin-study-description{color:#3b5870;margin:10px 0;overflow-wrap:anywhere}
.admin-study-meta{display:grid;gap:4px;font-size:.82rem;line-height:1.9;color:#64778a}
.admin-study-meta b{color:#394e60}
.admin-open-study,.admin-no-files{display:grid;place-items:center;border-radius:12px;padding:12px 14px;min-height:48px;text-decoration:none;font-weight:700}
.admin-open-study{color:#fff;background:var(--teal)}
.admin-open-study:hover{background:#087A8D;color:white}
.admin-no-files{background:#f2f4f6;color:#67798a}
.admin-pagination{display:flex;justify-content:center;align-items:center;gap:12px;flex-wrap:wrap;margin:22px 0 16px;font-size:.86rem}
.admin-pagination a{display:grid;place-items:center;min-height:46px;padding:8px 16px;background:white;border:1px solid #d4e1e8;border-radius:11px;text-decoration:none;color:var(--navy)}
.empty-studies{text-align:center;color:#546c80}
@media(min-width:768px){
 .admin-entry{flex-direction:row;justify-content:space-between;align-items:center;padding:25px}
 .admin-entry-button{width:auto;min-width:220px}
 .admin-filter{grid-template-columns:auto minmax(180px,1fr) auto;align-items:center;gap:16px;padding:18px}
 .admin-filter-button{width:auto;min-width:135px}
 .admin-study-card{grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:26px;padding:20px}
 .admin-study-meta{grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
 .admin-open-study,.admin-no-files{min-width:150px}
}

/* Patient share management: mobile-first and right-to-left. */
.admin-study-actions { display:grid;grid-template-columns:1fr;gap:8px; }
.admin-share-study { display:grid;place-items:center;min-height:48px;padding:12px 14px;border:1px solid #B5DDE2;border-radius:12px;background:#F0FAFB;color:#0B6574;text-decoration:none;font-weight:800; }
.admin-share-study:hover { color:#074B58;background:#E6F5F8; }
.share-topbar { display:flex;gap:10px;flex-wrap:wrap;margin:12px 0; }
.share-back-link { display:grid;place-items:center;text-decoration:none;min-height:44px;padding:10px 14px;border:1px solid #D7E5EE;border-radius:12px;background:#FFFFFF;color:var(--navy);font-weight:700; }
.share-case,.share-create,.share-once { margin:12px 0;padding:16px;min-width:0; }
.share-case h2,.share-create h2,.share-once h2,.share-history h2 { margin:0 0 10px;font-size:1.1rem;font-weight:800; }
.share-case p { margin:7px 0;overflow-wrap:anywhere; }
.share-once label { display:block;font-size:.9rem;font-weight:700;margin:12px 0 6px; }
.share-url { width:100%;min-width:0;padding:13px;border-radius:12px;border:1px solid #CAD9E4;background:#F8FAFD;font-family:Consolas,monospace;font-size:.89rem;direction:ltr;text-align:left; }
.share-copy-btn { margin-top:10px;min-height:48px; }
.share-copy-feedback { min-height:1.5em;color:#11684F;font-weight:700; }
.share-meta { font-size:.86rem;color:#4D647C; }
.share-alert { padding:14px;border-radius:12px;line-height:1.8;margin:8px 0; }
.share-warning { background:#FFF7E8;border:1px solid #F2D49B;color:#735019; }
.share-error { background:#FDF1F1;border:1px solid #E9B6B6;color:#8D2929; }
.share-history { margin-top:22px; }
.share-history > p { margin:6px 0 12px; }
.share-list { display:grid;gap:10px; }
.share-card { display:grid;gap:12px;padding:16px; }
.share-card-data { display:grid;gap:5px;font-size:.88rem;color:#486079; }
.share-state { color:#12304A; }
.share-revoke-btn { width:100%;min-height:48px;padding:12px;border-radius:12px;background:white;border:1px solid #C46262;color:#8A3434;font-weight:700;cursor:pointer; }
.share-empty { color:#637489; }
@media (min-width:768px) {
 .admin-study-actions { min-width:170px; }
 .share-card { grid-template-columns:minmax(0,1fr) 220px;align-items:center; }
 .share-create,.share-once,.share-case { padding:22px; }
 .share-copy-btn { width:auto;min-width:170px; }
}

/* Center management – mobile-first, readable touch targets and RTL forms */
.center-top-actions{display:flex;flex-wrap:wrap;align-items:stretch;gap:10px;margin:14px 0}
.center-action-link{width:auto;min-width:190px;min-height:48px;margin:0;display:grid;place-items:center}
.center-filter{display:grid;gap:10px;margin:14px 0}
.center-filter label,.center-form label{display:block;font-weight:700;font-size:.9rem;margin:0 0 6px}
.center-filter-button{margin:0;min-height:48px}
.center-list{display:grid;gap:12px}
.center-list-card{display:grid;gap:14px;padding:17px;min-width:0}
.center-list-card h2,.center-form h2{font-weight:800;font-size:1.12rem;margin:0 0 12px}
.center-meta{font-size:.88rem;color:#567087;overflow-wrap:anywhere;margin:5px 0}
.center-status{display:inline-flex;border-radius:999px;padding:5px 12px;font-size:.82rem;font-weight:800;margin-top:7px}
.center-active{color:#135C44;background:#E1F5EE}
.center-blocked{color:#8F3333;background:#FDEAEA}
.center-card-actions{display:grid;gap:8px}
.center-card-actions form{margin:0}
.center-card-actions .share-back-link{min-height:48px}
.center-toggle{display:block;width:100%;min-height:48px;padding:11px;border-radius:12px;font-weight:800;cursor:pointer;border:1px solid}
.center-block-button{background:#FFF5F5;color:#A22B2B;border-color:#E8B2B2}
.center-allow-button{background:#E9F9F0;color:#0D6344;border-color:#A0DDC0}
.center-form{padding:17px}
.center-form h2:not(:first-child){margin-top:24px}
.center-fields{display:grid;gap:14px}
.center-fields .form-control{width:100%;min-height:47px}
.center-fields textarea.form-control{min-height:90px}
@media(min-width:768px){
 .center-filter{grid-template-columns:auto minmax(0,1fr) auto;align-items:center}
 .center-filter-button{min-width:120px}
 .center-list-card{grid-template-columns:minmax(0,1fr) 220px;align-items:center;padding:22px}
 .center-card-actions{width:220px}
 .center-fields{grid-template-columns:repeat(2,minmax(0,1fr))}
 .center-wide{grid-column:1/-1}
 .center-form{padding:26px}
}

/* Stage 1 center status filter and one-time API credential display. */
.center-filter-input{min-width:0}
.center-filter-input .form-control{width:100%;min-height:48px}
.center-secret{direction:ltr;text-align:left;overflow-wrap:anywhere;user-select:all;font-family:Consolas,monospace;font-size:.86rem}
.center-secret-label{display:block;font-weight:700;margin:14px 0 6px}
@media(min-width:768px){.center-filter{grid-template-columns:minmax(0,1.3fr) minmax(0,1fr) auto}}

/* The Center pages start as single-column, full-width touch layouts. */
.center-top-actions > .center-action-link,
.center-top-actions > .share-back-link{width:100%}
.center-copy-row{display:grid;grid-template-columns:minmax(0,1fr);gap:9px;align-items:stretch}
.center-copy-row .center-secret{display:block;white-space:normal;min-width:0;line-height:1.8;margin:0}
.center-copy-button{min-height:48px;width:100%;border:1px solid #91CED5;background:#EAF9FA;color:#0B6574;border-radius:12px;font:inherit;font-weight:800;cursor:pointer}
.center-copy-button:focus-visible,.center-toggle:focus-visible{outline:3px solid #0E92A5;outline-offset:3px}
.center-copy-result{min-height:1.8em;font-size:.89rem;color:#0D6344;font-weight:700}
@media (min-width:768px){
  .center-top-actions > .center-action-link,.center-top-actions > .share-back-link{width:auto}
  .center-copy-row{grid-template-columns:minmax(0,1fr) 130px}
}

/* Stage 2: physician directory / specialties / referrals. Mobile-first and RTL. */
.phys-actions { display:grid;gap:10px;grid-template-columns:minmax(0,1fr);margin:14px 0; }
.phys-actions .primary-button,.phys-actions .share-back-link { margin:0;min-height:48px;display:grid;place-items:center; }
.phys-filter { display:grid;gap:12px; margin:14px 0; padding:16px; }
.phys-filter label,.phys-form label,.phys-specialty-edit label { display:block;margin-bottom:7px;font-size:.88rem;font-weight:700; }
.phys-filter .form-control,.phys-form .form-control,.phys-specialty-edit .form-control {min-height:48px;min-width:0;width:100%;}
.phys-filter .primary-button {margin:0;min-height:48px;}
.phys-list {display:grid;grid-template-columns:minmax(0,1fr);gap:12px;}
.phys-card {padding:16px;min-width:0;display:grid;gap:12px;}
.phys-card h2,.phys-card h3 {font-size:1rem;font-weight:800;margin:0 0 8px;}
.phys-card p {font-size:.9rem;margin:6px 0;line-height:1.85;overflow-wrap:anywhere;}
.phys-card-main {min-width:0;}
.phys-heading {display:flex;justify-content:space-between;gap:10px;align-items:center;flex-wrap:wrap;}
.phys-badge {border-radius:50px;padding:5px 12px;font-size:.8rem;font-weight:800;}
.phys-on {background:#e7f8f0;color:#096c43;}
.phys-off {background:#fff0ee;color:#9a3834;}
.phys-card-actions {display:grid;gap:8px;}
.phys-card-actions .share-back-link {min-height:48px;}
.phys-form {padding:16px; margin:12px 0;}
.phys-form h2,.phys-status-area h2 {font-size:1.08rem;font-weight:800;margin:8px 0 15px;}
.phys-fields {display:grid;grid-template-columns:minmax(0,1fr);gap:12px;margin-bottom:24px;}
.phys-fields > div,.phys-center-option {min-width:0;}
.phys-center-grid {display:grid;grid-template-columns:minmax(0,1fr);gap:9px;max-height:310px;overflow-y:auto;padding:6px 1px;}
.phys-center-option {display:flex!important;align-items:center;gap:12px;padding:12px 14px;border:1px solid #dce6ed;border-radius:12px;background:#fbfdff;min-height:48px;font-size:.91rem;font-weight:600;cursor:pointer;margin:0!important;}
.phys-center-option input {flex:0 0 20px;width:20px;height:20px;accent-color:var(--teal);}
.phys-center-option span {overflow-wrap:anywhere;}
.phys-status-area {margin:16px 0;}
.phys-status-area .primary-button {width:100%;min-height:48px;}
.phys-add-specialty,.phys-specialty-edit {display:grid;gap:10px;}
.phys-add-specialty .primary-button,.phys-specialty-edit .primary-button {margin:0;min-height:48px;}
.phys-section-title {font-size:1.12rem;font-weight:800;margin:20px 0 12px;}
.phys-cancel {border-color:#e9c6c6;color:#943937;width:100%;min-height:48px;background:white;cursor:pointer;}
.phys-cancel:hover {background:#fff3f3;}
.mobile-nav {overflow-x:auto;justify-content:flex-start;gap:2px;scrollbar-width:thin;}
.mobile-nav a {flex:0 0 auto;min-height:44px;white-space:nowrap;display:grid;place-items:center;}
@media (min-width:768px) {
  .phys-actions {display:flex;flex-wrap:wrap;align-items:center;gap:10px;}
  .phys-actions .primary-button,.phys-actions .share-back-link {width:auto;min-width:170px;}
  .phys-filter {grid-template-columns:minmax(0,2fr) minmax(140px,1fr) auto;align-items:end;padding:20px;}
  .phys-filter .primary-button {width:auto;min-width:110px;}
  .phys-card {grid-template-columns:minmax(0,1fr) auto;gap:22px;align-items:center;padding:20px;}
  .phys-card-actions {min-width:175px;}
  .phys-form {padding:24px;}
  .phys-fields {grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;}
  .phys-wide {grid-column:1/-1;}
  .phys-center-grid {grid-template-columns:repeat(2,minmax(0,1fr));}
  .phys-specialty-edit {grid-template-columns:minmax(0,1fr) auto auto auto;align-items:end;}
  .phys-specialty-edit .primary-button {width:auto;min-width:140px;}
  .phys-add-specialty {grid-template-columns:minmax(0,1fr) auto;align-items:end;}
  .phys-add-specialty .primary-button {width:auto;min-width:160px;}
  .mobile-nav {justify-content:center;overflow:visible;}
}

/* Usage dashboards: mobile-first, touch-friendly, RTL; desktop cards expand naturally. */
.usage-top{display:flex;flex-wrap:wrap;gap:10px;margin:12px 0}
.usage-top a{min-height:48px;min-width:0;flex:1 1 140px}
.usage-search{display:grid;gap:12px;padding:16px;margin-bottom:14px}
.usage-search label,.usage-policy-form label:not(.usage-check){display:block;font-weight:700;margin-bottom:7px}
.usage-search input,.usage-policy-form input[type="number"]{width:100%;min-width:0;min-height:48px}
.usage-search button,.usage-save,.usage-edit-button{min-height:48px;width:100%;margin:0}
.usage-center-list,.usage-stats{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;margin:16px 0}
.usage-center-card{display:grid;gap:14px;padding:16px;align-items:center;min-width:0}
.usage-center-info h2{font-size:1.08rem;font-weight:800;margin:0 0 5px;overflow-wrap:anywhere}
.usage-metric,.usage-stat{display:flex;flex-direction:column;gap:6px;min-width:0}
.usage-metric span,.usage-stat span{color:#455b69;font-size:.88rem}
.usage-metric strong,.usage-stat strong{font-size:1.16rem;overflow-wrap:anywhere}
.usage-metric small,.usage-stat small{color:#526878;line-height:1.8}
.usage-stat{padding:17px}
.usage-policy-form{padding:16px;margin:16px 0}
.usage-policy-form h2{font-size:1.13rem;font-weight:800;margin:10px 0 18px}
.usage-policy-form h2:not(:first-child){margin-top:28px}
.usage-fields{display:grid;grid-template-columns:minmax(0,1fr);gap:12px 18px;margin-bottom:15px}
.usage-check{display:flex;gap:12px;align-items:center;min-height:48px;padding:10px 13px;border:1px solid #dce5ec;border-radius:12px;font-weight:700;cursor:pointer}
.usage-check input{width:20px;height:20px;flex:none;accent-color:#118a9b}
.usage-bar{height:9px;border-radius:30px;background:#e5ebef;overflow:hidden;margin-top:8px}
.usage-bar span{display:block;height:100%;background:#138e9d;border-radius:30px}
.usage-empty{padding:20px}
@media(min-width:768px){
 .usage-top a{flex:0 0 auto}
 .usage-search{grid-template-columns:minmax(0,1fr) 150px;align-items:end;padding:20px}
 .usage-center-card{grid-template-columns:minmax(0,1.4fr) minmax(150px,1fr) minmax(140px,1fr) 150px;padding:20px}
 .usage-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
 .usage-fields{grid-template-columns:repeat(2,minmax(0,1fr));align-items:end}
 .usage-policy-form{padding:25px}
 .usage-save{width:auto;min-width:180px}
}
@media(min-width:1100px){.usage-stats{grid-template-columns:repeat(3,minmax(0,1fr))}}

.usage-alert{color:#9b3720;background:#fff3db;border-radius:8px;padding:4px 10px;font-size:.82rem;font-weight:800;align-self:flex-start}

/* Center medical records and physician management: single-column-first, touch accessible. */
.cc-center-links,.cc-card-list,.cc-links{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;margin:14px 0}
.cc-center-link{display:grid;gap:8px;min-height:92px;padding:18px;text-decoration:none!important;color:#193953}
.cc-center-link strong{font-size:1.07rem;font-weight:800}
.cc-center-link span{font-size:.9rem;color:#546b7c}
.cc-links>a{min-height:48px;display:grid;place-items:center;margin:0}
.cc-filter{display:grid;grid-template-columns:minmax(0,1fr);gap:11px;margin:12px 0;padding:16px}
.cc-filter label,.cc-phys-form label{font-weight:750;font-size:.92rem;display:block;margin-bottom:6px}
.cc-filter .form-control,.cc-phys-form .form-control{width:100%;min-width:0;min-height:48px}
.cc-filter button{min-height:48px;width:100%;margin:0}
.cc-record{padding:16px;display:grid;grid-template-columns:minmax(0,1fr);gap:14px;min-width:0}
.cc-record-body{min-width:0}
.cc-record h2{font-size:1.09rem;font-weight:800;margin:0 0 12px;overflow-wrap:anywhere}
.cc-record p{font-size:.95rem;line-height:1.8;margin:0 0 8px;overflow-wrap:anywhere}
.cc-details{display:flex;flex-wrap:wrap;gap:8px 18px;color:#53687a;font-size:.88rem;line-height:1.9}
.cc-details span{overflow-wrap:anywhere}
.cc-record-actions{display:grid;gap:8px;align-content:center;min-width:0}
.cc-record-actions form{margin:0}
.cc-record-actions a,.cc-record-actions button{width:100%;min-height:48px;display:grid;place-items:center;text-align:center;margin:0}
.cc-secondary-button{border:1px solid #8cb6c5;border-radius:12px;background:#eff8fb;color:#165b71;padding:10px 13px;font:inherit;font-weight:750;cursor:pointer}
.cc-secondary-button:disabled{opacity:.48;cursor:not-allowed}
.center-clinical-empty{padding:24px}
.cc-phys-form{padding:16px;margin:15px 0}
.cc-fields{display:grid;grid-template-columns:minmax(0,1fr);gap:14px}
.cc-save{width:100%;min-height:48px;margin:18px 0 0}
.cc-back{display:inline-flex;min-height:48px;align-items:center;margin:10px 0}
@media(min-width:768px){
 .cc-center-links{grid-template-columns:repeat(2,minmax(0,1fr))}
 .cc-links{display:flex;flex-wrap:wrap;gap:10px}
 .cc-filter{grid-template-columns:minmax(0,1fr) minmax(0,1.5fr) auto;align-items:end;padding:20px}
 .cc-filter button{width:auto;min-width:145px}
 .cc-record{grid-template-columns:minmax(0,1fr) 205px;align-items:center;padding:20px}
 .cc-fields{grid-template-columns:repeat(2,minmax(0,1fr))}
 .cc-phys-form{padding:24px}
 .cc-save{width:auto;min-width:180px}
}

/* Physician OTP: mobile-first, RTL-friendly, no side-scrolling. */
.otp-auth { width:100%; max-width:460px; margin:1rem auto; }
.otp-auth form { display:flex; flex-direction:column; gap:.65rem; }
.otp-auth input.form-control { min-height:48px; width:100%; max-width:100%; }
.otp-auth button { min-height:48px; width:100%; touch-action:manipulation; }
.otp-auth .otp-code { font-size:1.4rem; letter-spacing:.45rem; text-align:center; }
.otp-auth .otp-hint { margin:1rem 0; }
.otp-auth .otp-resend { margin:1.1rem 0; }
.otp-auth .otp-development-code { padding:1rem; background:#e8f6f5; border-radius:.65rem; margin:1rem 0; }
.otp-auth .share-back-link { display:inline-flex; min-height:44px; align-items:center; }
@media(max-width:360px) { .otp-auth { padding:1rem !important; } .otp-auth .otp-code { letter-spacing:.25rem; } }

/* Physician case portal: touch-first, RTL, compact cards at 320px. */
.physician-portal-head{display:flex;flex-direction:column;align-items:stretch;gap:12px;margin-bottom:16px}
.physician-portal-head h1{margin:0}
.physician-portal-head .muted{margin:0}
.physician-portal-head button{min-height:44px;width:100%}
.physician-portal-stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin:16px 0}
.physician-portal-stats .app-card{padding:14px;display:grid;gap:7px;min-width:0}
.physician-portal-stats span{color:#52677b;font-size:.8rem}
.physician-portal-stats strong{color:var(--teal);font-size:1.65rem}
.physician-portal-centers{display:flex;gap:8px;overflow-x:auto;padding:7px 0 14px;scrollbar-width:thin}
.physician-portal-centers a{flex:0 0 auto;text-decoration:none;color:#204a62;border:1px solid #cfe0e9;background:white;border-radius:999px;padding:11px 15px;min-height:44px;font-weight:700;font-size:.87rem;max-width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.physician-portal-centers a.selected{background:#dbf5f5;color:#076778;border-color:#0e92a5}
.physician-portal-filter{padding:14px;display:grid;gap:16px;margin-bottom:22px}
.physician-portal-filter form{display:grid;grid-template-columns:minmax(0,1fr);gap:11px;min-width:0}
.physician-portal-filter form+form{border-top:1px solid #e2eaf0;padding-top:15px}
.physician-portal-filter label{display:block;font-size:.86rem;font-weight:750;margin-bottom:5px}
.physician-portal-filter input,.physician-portal-filter select{width:100%;min-width:0;min-height:48px}
.physician-portal-filter button{width:100%;min-height:48px;margin:0}
.physician-portal-results h2{font-size:1.13rem;font-weight:800;margin:0 0 15px}
.physician-portal-results small{font-size:.84rem;color:#657987;font-weight:500}
.physician-portal-list{display:grid;grid-template-columns:minmax(0,1fr);gap:11px}
.physician-portal-study{padding:16px;display:grid;gap:14px;min-width:0}
.physician-portal-study-main{min-width:0}
.physician-portal-study-heading{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin-bottom:8px}
.physician-portal-study h3{font-size:1.03rem;font-weight:800;margin:0;overflow-wrap:anywhere}
.physician-new-badge{font-size:.8rem;font-weight:800;background:#e1f6ed;color:#14674a;border-radius:999px;padding:5px 10px}
.physician-viewed-badge{font-size:.8rem;font-weight:700;background:#eef2f5;color:#566a7b;border-radius:999px;padding:5px 10px}
.physician-portal-study p{font-size:.9rem;line-height:1.85;color:#425e71;margin:0 0 10px;overflow-wrap:anywhere}
.physician-portal-meta{display:flex;flex-wrap:wrap;gap:6px 16px;font-size:.84rem;line-height:1.8;color:#536b7d}
.physician-portal-meta span{overflow-wrap:anywhere}
.physician-portal-study .admin-open-study{min-height:48px}
@media(min-width:768px){
 .physician-portal-head{flex-direction:row;justify-content:space-between;align-items:center}
 .physician-portal-head button{width:auto;min-width:160px}
 .physician-portal-stats{grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
 .physician-portal-filter{padding:20px}
 .physician-portal-filter form:first-child{grid-template-columns:repeat(2,minmax(0,1fr));align-items:end}
 .physician-portal-filter form:first-child > button{grid-column:1 / -1;justify-self:end;width:auto;min-width:160px}
 .physician-portal-filter form+form{grid-template-columns:minmax(0,1fr) 175px;align-items:end}
 .physician-portal-study{grid-template-columns:minmax(0,1fr) 210px;align-items:center;padding:20px}
}
@media(min-width:1200px){
 .physician-portal-filter form:first-child{grid-template-columns:minmax(130px,1fr) minmax(130px,1fr) minmax(176px,1.45fr) minmax(176px,1.45fr) auto}
 .physician-portal-filter form:first-child > button{grid-column:auto;justify-self:stretch;min-width:115px}
}
@media(max-width:359px){.physician-portal-stats .app-card{padding:10px}.physician-portal-stats strong{font-size:1.4rem}.physician-portal-study{padding:13px}}

/* Persian calendar for physician date filters: mobile-first, touch-sized controls. */
/* Give the full Persian date priority over its calendar trigger. */
.jalali-date-field{position:relative;display:grid;grid-template-columns:minmax(0,1fr) 44px;align-items:stretch;gap:6px;min-width:0;width:100%}
.jalali-date-field .form-control{width:100%;min-width:0;text-align:center;padding-inline:8px;font-size:1rem;letter-spacing:normal;font-variant-numeric:tabular-nums}
.physician-portal-filter .jalali-date-open{width:44px;min-width:44px;max-width:44px;min-height:48px;border-radius:10px;
 border:1px solid #bfd5df;background:#f0f9fa;color:#145f75;cursor:pointer;padding:0;font-size:.93rem;line-height:1;display:grid;place-items:center;touch-action:manipulation}
.jalali-picker-shade{position:fixed;inset:0;z-index:2100;display:flex;align-items:center;justify-content:center;
 background:rgba(11,30,44,.67);padding:12px;overflow:auto}
.jalali-picker{direction:rtl;width:min(100%,365px);max-height:min(92dvh,680px);overflow-y:auto;background:#fff;
 color:#19394c;border-radius:17px;padding:16px;box-shadow:0 24px 64px rgba(0,0,0,.3)}
.jalali-picker-heading{display:flex;align-items:center;justify-content:space-between;gap:5px;margin-bottom:14px}
.jalali-picker-heading strong{white-space:nowrap;font-size:1rem}
.jalali-picker-heading select{min-height:44px;max-width:86px;padding:4px;border:1px solid #cbdce3;border-radius:9px;background:white}
.jalali-picker-heading button{padding:4px 8px;min-height:44px;min-width:48px;border:1px solid #d5e3e8;
 border-radius:9px;background:#f3f9fa;color:#174c67;font-weight:700;font-size:.78rem;cursor:pointer}
.jalali-picker-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:2px;text-align:center}
.jalali-picker-grid .jalali-weekday{display:grid;place-items:center;min-height:36px;color:#577482;font-weight:750}
.jalali-picker-grid .jalali-day{display:grid;place-items:center;aspect-ratio:1;min-height:39px;min-width:0;padding:0;
 border:1px solid transparent;border-radius:10px;background:#f7fafb;color:#173d51;cursor:pointer}
.jalali-picker-grid .jalali-day.is-today{border-color:#0e94a3}
.jalali-picker-grid .jalali-day.is-selected{background:#097e94;color:white;font-weight:800}
.jalali-picker-actions{display:flex;gap:10px;margin-top:15px}
.jalali-picker-actions button{flex:1;min-height:44px;border:1px solid #a9cad6;border-radius:10px;
 background:#eff8fa;color:#14576c;cursor:pointer;font-weight:750}
@media(max-width:359px){.jalali-picker{padding:10px}.jalali-picker-heading{gap:2px}
 .jalali-picker-heading button{min-width:42px;padding:3px;font-size:.72rem}
 .jalali-picker-grid .jalali-day{min-height:36px}}

/* SuperAdmin control room — responsive, touch-first; scoped to dashboard only. */
.rh-dashboard{min-width:0;max-width:100%;display:grid;gap:23px;padding-bottom:32px;color:#172f44}
.rh-dashboard *{min-width:0}
.rh-dash-hero{position:relative;overflow:hidden;isolation:isolate;border-radius:24px;background:linear-gradient(117deg,#0c344c 2%,#126278 76%,#1594a4);color:white;display:grid;gap:18px;padding:23px 20px;box-shadow:0 20px 36px rgba(9,61,85,.14)}
.rh-dash-hero:before,.rh-dash-hero:after{content:"";position:absolute;z-index:-1;border-radius:50%;border:1px solid rgba(255,255,255,.14)}
.rh-dash-hero:before{width:250px;height:250px;left:-105px;top:-140px;background:rgba(255,255,255,.035)}
.rh-dash-hero:after{width:170px;height:170px;left:75px;bottom:-130px}
.rh-dash-overline{display:inline-flex;align-items:center;gap:8px;padding:6px 12px;background:rgba(255,255,255,.11);border:1px solid rgba(255,255,255,.16);border-radius:100px;color:#dcfafd;font-size:.77rem;font-weight:700}
.rh-live-dot{width:7px;height:7px;border-radius:50%;background:#62e6b7;box-shadow:0 0 0 4px rgba(98,230,183,.12)}
.rh-dash-hero h1{color:#fff;font-size:1.6rem;line-height:1.5;margin:13px 0 4px;font-weight:900}
.rh-dash-hero p{color:#e0f3f8;font-size:.84rem;line-height:1.9;margin:0}
.rh-dash-hero-meta{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin-top:16px}
.rh-dash-today{display:inline-flex;align-items:center;gap:6px;padding:9px 12px;border-radius:12px;background:rgba(5,40,60,.25);font-size:.85rem;font-weight:700;white-space:nowrap}
.rh-dash-hero-link{display:inline-flex;align-items:center;justify-content:center;gap:12px;min-height:44px;border-radius:12px;padding:10px 14px;background:#fff;color:#0c5c70;text-decoration:none;font-size:.85rem;font-weight:800}
.rh-dash-hero-link:hover{background:#e7fbff;color:#0a5164}
.rh-dash-hero-summary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.rh-dash-hero-summary>div{border-radius:16px;border:1px solid rgba(255,255,255,.24);background:rgba(4,37,51,.22);padding:15px 12px;display:flex;flex-direction:column;gap:3px}
.rh-dash-hero-summary span{color:#ddf2f5;font-size:.77rem}
.rh-dash-hero-summary strong{font-size:1.7rem;line-height:1.55;font-weight:900;color:#fff}
.rh-dash-section{display:grid;gap:13px}
.rh-dash-heading,.rh-dash-panel-heading{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap}
.rh-dash-caption{display:block;color:#13929f;font-size:.77rem;letter-spacing:.05px;font-weight:800;margin-bottom:1px}
.rh-dash-heading h2,.rh-dash-panel-heading h2{font-size:1.05rem;font-weight:900;margin:0;line-height:1.8}
.rh-dash-subtle{font-size:.74rem;color:#788797}
.rh-dash-text-link{display:inline-flex;align-items:center;gap:5px;color:#0c7d8d;font-size:.82rem;font-weight:800;text-decoration:none;min-height:44px}
.rh-dash-text-link:hover{color:#075566}
.rh-dash-metrics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px}
.rh-dash-metric{display:flex;flex-direction:column;align-items:flex-start;gap:5px;min-height:170px;background:#fff;border:1px solid #e3ecf2;border-radius:19px;padding:15px 13px;text-decoration:none;color:#1c354b;box-shadow:0 7px 24px rgba(22,45,65,.025);transition:transform .15s,box-shadow .15s}
.rh-dash-metric:hover{transform:translateY(-2px);box-shadow:0 10px 24px rgba(22,45,65,.09);color:#1c354b}
.rh-dash-metric-icon{width:41px;height:41px;display:grid;place-items:center;border-radius:13px;flex:none}
.rh-dash-metric-icon svg{width:23px;height:23px}
.rh-metric-a .rh-dash-metric-icon{background:#e5f7fa;color:#078b9d}
.rh-metric-b .rh-dash-metric-icon{background:#eaeefe;color:#586ccd}
.rh-metric-c .rh-dash-metric-icon{background:#ecf8ee;color:#22865e}
.rh-metric-d .rh-dash-metric-icon{background:#fff2e5;color:#d08c37}
.rh-dash-metric-label{font-size:.77rem;font-weight:700;color:#667a8c;line-height:1.6}
.rh-dash-metric strong{font-size:1.5rem;line-height:1.3;font-weight:900;font-variant-numeric:tabular-nums;white-space:nowrap}
.rh-dash-metric small{color:#83909c;font-size:.72rem;line-height:1.7;overflow-wrap:anywhere}
.rh-dash-resources{display:grid;gap:11px}
.rh-dash-resource{display:flex;align-items:center;gap:13px;padding:16px;background:#fff;border:1px solid #e2ebf1;border-radius:18px;box-shadow:0 6px 18px rgba(22,45,65,.025)}
.rh-dash-resource-icon{width:48px;height:48px;flex:none;display:grid;place-items:center;border-radius:14px}
.rh-dash-resource-icon svg{width:24px;height:24px}
.rh-storage-icon{background:#e8f6fa;color:#087f99}.rh-sms-icon{background:#f0efff;color:#7059a5}.rh-central-icon{background:#e9f8ee;color:#33845d}
.rh-dash-resource>div{display:flex;flex-direction:column;gap:3px;min-width:0}
.rh-dash-resource>div>span{font-size:.81rem;color:#607487}
.rh-dash-resource strong{font-weight:900;font-size:1.23rem;line-height:1.55;overflow-wrap:anywhere}
.rh-dash-resource strong em{font-size:.78rem;font-style:normal;color:#647687}
.rh-dash-resource small{font-size:.73rem;color:#8795a1}
.rh-dash-panels{display:grid;gap:14px;min-width:0}
.rh-dash-panel{min-width:0;padding:17px 15px;background:#fff;border:1px solid #e1eaf0;border-radius:20px;box-shadow:0 7px 22px rgba(22,45,65,.03)}
.rh-dash-panel-heading{margin-bottom:17px}
.rh-dash-panel-chip{white-space:nowrap;background:#e9f7fa;color:#097b8e;border-radius:999px;padding:6px 10px;font-size:.73rem;font-weight:800}
.rh-dash-chart{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px;align-items:end;height:195px;margin-top:2px}
.rh-dash-bar-col{min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:7px;height:100%}
.rh-dash-bar-count{font-size:.7rem;color:#5a6e80;font-variant-numeric:tabular-nums}
.rh-dash-bar-track{height:135px;width:100%;max-width:46px;border-radius:9px 9px 5px 5px;background:linear-gradient(180deg,#f8fbfd,#f0f7fa);display:flex;align-items:flex-end;overflow:hidden}
.rh-dash-bar-fill{width:100%;border-radius:9px 9px 4px 4px;background:linear-gradient(180deg,#2fabb6,#157687);transition:height .2s}
.rh-dash-bar-date{font-family:Tahoma,sans-serif;font-size:.64rem;color:#748495;white-space:nowrap;letter-spacing:-.5px}
.rh-dash-footnote{font-size:.74rem;color:#8191a0;line-height:1.8;margin:12px 0 0}
.rh-dash-alert-count{display:grid;place-items:center;min-width:32px;height:32px;padding:3px 8px;background:#fff1e4;color:#b36a2d;font-size:.83rem;font-weight:900;border-radius:11px}
.rh-dash-alert-summary{display:flex;flex-wrap:wrap;gap:8px 15px;margin-bottom:13px;font-size:.75rem;color:#627688}
.rh-dash-alert-summary>span{display:inline-flex;align-items:center;gap:6px}
.rh-dash-dot{display:inline-block;width:7px;height:7px;border-radius:50%;flex:none}
.rh-critical-dot{background:#db6566}.rh-warning-dot{background:#d69b45}
.rh-dash-alert-list{display:grid;gap:9px}
.rh-dash-alert-item{display:grid;gap:7px;padding:12px;border:1px solid #f1e9e3;border-radius:14px;background:#fffdfc;color:#1c354b;text-decoration:none}
.rh-dash-alert-item:hover{color:#1c354b;background:#fff9f6}
.rh-dash-alert-line{display:flex;justify-content:space-between;align-items:center;gap:6px}
.rh-dash-alert-line strong{font-size:.83rem;overflow-wrap:anywhere}
.rh-dash-alert-line small{font-size:.75rem;color:#768696}
.rh-dash-danger,.rh-dash-warning{font-size:.8rem;font-weight:900;white-space:nowrap}
.rh-dash-danger{color:#bd4d4e}.rh-dash-warning{color:#bd8937}
.rh-dash-alert-track{height:5px;border-radius:99px;overflow:hidden;background:#f0eee8}
.rh-dash-alert-track span{height:100%;display:block;border-radius:99px}
.rh-dash-fill-danger{background:#d45d5f}.rh-dash-fill-warning{background:#dfaa4b}
.rh-dash-see-all{min-height:44px;display:flex;align-items:center;justify-content:center;gap:8px;color:#087e91;text-decoration:none;font-weight:800;font-size:.81rem;margin-top:10px}
.rh-dash-empty{min-height:155px;display:flex;align-items:center;flex-direction:column;justify-content:center;text-align:center;gap:7px;color:#597e74;background:#f4fbf8;border:1px dashed #d4eae1;border-radius:15px;padding:15px}
.rh-dash-empty svg{width:33px;height:33px;color:#2d9a76}.rh-dash-empty strong{font-size:.86rem}.rh-dash-empty span{font-size:.74rem}
.rh-dash-shortcuts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.rh-dash-shortcuts>a{display:grid;grid-template-columns:32px minmax(0,1fr) auto;align-items:center;gap:7px;min-height:62px;padding:10px;background:#fff;border:1px solid #e2eaf1;border-radius:15px;text-decoration:none;color:#1b354b;font-weight:800;font-size:.81rem}
.rh-dash-shortcuts>a:hover{background:#f1fafa;color:#0c6677}
.rh-dash-shortcuts>a>span:last-child{color:#96a8b4}
.rh-dash-shortcut-icon{display:grid;place-items:center;width:32px;height:32px;border-radius:11px;background:#eff5f9;color:#0e8092;font-size:1.15rem}
.rh-dash-recent{margin-top:0}
.rh-dash-recent-list{display:grid;gap:2px}
.rh-dash-recent-item{display:flex;align-items:center;gap:12px;min-height:60px;padding:10px 2px;text-decoration:none;color:#19374c;border-bottom:1px solid #eef3f6}
.rh-dash-recent-item:last-child{border-bottom:0}
.rh-dash-recent-item:hover{color:#0c7e91}
.rh-dash-recent-mark{display:grid;place-items:center;flex:none;width:37px;height:37px;border-radius:12px;background:#e9f7f9;color:#0a8da0;font-size:1.1rem;font-weight:800}
.rh-dash-recent-info{display:flex;flex-direction:column;gap:4px;flex:1}
.rh-dash-recent-info strong{font-size:.83rem;overflow-wrap:anywhere}.rh-dash-recent-info small{color:#8293a0;font-size:.74rem}
.rh-dash-recent-go{color:#91a0ae}
.rh-dashboard a:focus-visible{outline:3px solid #0f92a5;outline-offset:3px}
@media(min-width:600px){
 .rh-dash-hero{grid-template-columns:minmax(0,1.5fr) minmax(220px,.8fr);align-items:center;padding:25px 30px}
 .rh-dash-hero-summary{grid-template-columns:1fr 1fr}
 .rh-dash-metrics{grid-template-columns:repeat(4,minmax(0,1fr))}
 .rh-dash-metric{padding:17px 14px;min-height:180px}
 .rh-dash-resources{grid-template-columns:repeat(3,minmax(0,1fr))}
 .rh-dash-resource{align-items:flex-start;flex-direction:column;gap:10px}
 .rh-dash-shortcuts{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(min-width:900px){
 .rh-dashboard{gap:28px}
 .rh-dash-hero{padding:32px 36px;grid-template-columns:minmax(0,1.7fr) minmax(280px,.7fr)}
 .rh-dash-hero h1{font-size:2rem}
 .rh-dash-hero-summary>div{padding:16px}
 .rh-dash-metric{min-height:187px;padding:18px 20px}
 .rh-dash-metric strong{font-size:1.85rem}
 .rh-dash-panels{grid-template-columns:minmax(0,1.18fr) minmax(0,1fr);align-items:stretch}
 .rh-dash-panel{padding:22px}
 .rh-dash-shortcuts{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:359px){
 .rh-dash-hero{padding:18px 15px}.rh-dash-hero h1{font-size:1.36rem}
 .rh-dash-metric{padding:12px 10px;min-height:161px}.rh-dash-metric strong{font-size:1.36rem}.rh-dash-metric-label{font-size:.73rem}
 .rh-dash-resource{padding:14px}.rh-dash-bar-date{font-size:.58rem;letter-spacing:-.7px}
 .rh-dash-shortcuts>a{grid-template-columns:30px minmax(0,1fr) auto;padding:9px 7px;font-size:.75rem}
 .rh-dash-shortcut-icon{width:30px;height:30px}
}

/* SuperAdmin floating glass navigation: mobile only. Desktop and other roles stay unchanged. */
@media (max-width:767px){
  .mobile-nav.admin-desktop-nav{display:none}
  body.has-admin-bottom-nav{padding-bottom:calc(104px + env(safe-area-inset-bottom))}
  .admin-bottom-nav{
    position:fixed;
    z-index:1050;
    inset-inline:0;
    bottom:calc(10px + env(safe-area-inset-bottom));
    margin-inline:auto;
    width:calc(100% - 24px);
    max-width:420px;
    padding:6px;
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:3px;
    direction:rtl;
    background:rgba(243,250,254,.78);
    -webkit-backdrop-filter:blur(20px) saturate(150%);
    backdrop-filter:blur(20px) saturate(150%);
    border:1px solid rgba(255,255,255,.84);
    border-radius:24px;
    box-shadow:0 12px 34px rgba(19,51,73,.18),inset 0 1px 0 rgba(255,255,255,.76);
    transition:transform .25s ease,opacity .25s ease;
    -webkit-tap-highlight-color:transparent;
  }
  .admin-bottom-nav.is-hidden{transform:translateY(calc(100% + 28px + env(safe-area-inset-bottom)));opacity:0;pointer-events:none}
  .admin-bottom-nav a{
    display:flex;
    flex-direction:column;
    justify-content:center;
    align-items:center;
    gap:4px;
    min-height:62px;
    min-width:0;
    padding:6px 2px;
    border-radius:18px;
    color:#2c5164;
    text-decoration:none;
    font-size:.74rem;
    line-height:1.2;
    font-weight:750;
    white-space:nowrap;
    touch-action:manipulation;
    transition:background .16s ease,color .16s ease;
  }
  .admin-bottom-nav a svg{display:block;width:21px;height:21px;flex:none}
  .admin-bottom-nav a.is-active{background:rgba(15,146,165,.16);color:#08697a}
  .admin-bottom-nav a:focus-visible{outline:3px solid #0e92a5;outline-offset:-2px}
  .admin-bottom-nav a:active{background:rgba(15,146,165,.22)}
}
@supports not ((backdrop-filter:blur(2px)) or (-webkit-backdrop-filter:blur(2px))){
  @media(max-width:767px){.admin-bottom-nav{background:rgba(244,250,253,.97)}}
}
@media(min-width:768px){
  body.has-admin-bottom-nav{padding-bottom:0}
  .admin-bottom-nav{display:none}
  .mobile-nav.admin-desktop-nav{display:flex}
}
@media(prefers-reduced-motion:reduce){
  .admin-bottom-nav,.admin-bottom-nav a{transition:none}
}
