 /*=========================================================*/
   /*VITALIS — SHARED STYLESHEET*/
   /*One file for the whole project. Every view links this —*/
   /*don't add page-specific \3c style> blocks in views.*/
   /*========================================================= */

 /*============ TOKENS ============ */
:root{
  --bg:#F6F2EA;
  --surface:#FFFFFF;
  --surface-2:#F1EADD;
  --surface-3:#E8DFCC;
  --border:#E2D8C4;
  --text:#211D16;
  --text-muted:#6E6656;
  --text-faint:#A29882;
  --primary:#0E4B43;
  --primary-dark:#092F2A;
  --primary-tint:#E4EFEB;
  --teal:#1C7A6C;
  --teal-tint:#E4F1EC;
  --green:#3F8F5B;
  --green-tint:#E8F3EA;
  --amber:#C97F1F;
  --amber-tint:#FAF0DD;
  --red:#B94A3B;
  --red-tint:#FAEAE6;
  --pulse:#DE9A3C;
  --shadow-sm:0 1px 2px rgba(33,26,15,.07);
  --shadow-md:0 6px 20px -6px rgba(33,26,15,.16), 0 2px 6px rgba(33,26,15,.07);
  --shadow-lg:0 20px 50px -14px rgba(33,26,15,.26);
  --radius:16px;
  --radius-sm:10px;
  --font-display:'Fraunces',serif;
  --font-body:'Inter',sans-serif;
  --font-mono:'IBM Plex Mono',monospace;
  --side-bg:#122019;
  --side-surface-2:rgba(255,255,255,.07);
  --side-border:rgba(255,255,255,.09);
  --side-text:#ECEAE2;
  --side-text-muted:rgba(236,234,226,.62);
  --side-text-faint:rgba(236,234,226,.4);
  --side-active-bg:rgba(222,154,60,.16);
  --side-active-text:#E8A947;
}

 /*============ RESET / BASE ============ */
*{box-sizing:border-box; margin:0; padding:0;}
body{
  font-family:var(--font-body);
  background:var(--bg);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}
h1,h2,h3,h4,.display{font-family:var(--font-display); letter-spacing:-0.01em;}
.mono{font-family:var(--font-mono);}
button{font-family:inherit; cursor:pointer;}
a{color:inherit; text-decoration:none;}
::selection{background:var(--primary); color:#fff;}
/*02 oct 26*/
svg{display:block;}
img,video,canvas{max-width:100%; height:auto; display:block;}
html{-webkit-text-size-adjust:100%; text-size-adjust:100%;}

 /*============ SIGNATURE PULSE LINE ============ */
.pulse-line{width:100%; height:22px; overflow:hidden;}
.pulse-line svg{width:100%; height:100%;}
.pulse-path{stroke:var(--pulse); stroke-width:2; fill:none; stroke-linecap:round; stroke-linejoin:round;
  stroke-dasharray: 520; stroke-dashoffset:520; animation:drawPulse 2.6s ease-in-out infinite;}
@keyframes drawPulse{ 0%{stroke-dashoffset:520;} 55%{stroke-dashoffset:0;} 100%{stroke-dashoffset:-520;} }

 /*============ BRAND ============ */
.brand{display:flex; align-items:center; gap:10px; padding:8px 10px 20px 10px;}
.brand-mark{width:34px; height:34px; border-radius:10px; background:linear-gradient(150deg,var(--pulse),var(--primary)); display:flex; align-items:center; justify-content:center; flex-shrink:0;}
.brand-name{font-family:var(--font-display); font-weight:600; font-size:18px;}
.brand-sub{font-size:10.5px; color:var(--text-faint); font-weight:600; letter-spacing:.06em; text-transform:uppercase; margin-top:-1px;}

 /*============ SHELL (sidebar/topbar — for later dashboard pages) ============ */
.app{display:grid; grid-template-columns:248px 1fr; min-height:100vh;}
.sidebar{
  background:var(--side-bg); border-right:1px solid var(--side-border);
  padding:20px 14px; display:flex; flex-direction:column; gap:4px;
  position:sticky; top:0; height:100vh; overflow-y:auto;
}
.sidebar .brand-name{color:var(--side-text);}
.nav-group-label{font-size:10.5px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--side-text-faint); padding:16px 12px 6px;}
.nav-item{
  display:flex; align-items:center; gap:11px; padding:9px 12px; border-radius:10px;
  color:var(--side-text-muted); font-size:13.5px; font-weight:600; border:none; background:none; width:100%; text-align:left;
  transition:background .15s, color .15s;
}
.nav-item svg{flex-shrink:0; opacity:.85;}
.nav-item:hover{background:var(--side-surface-2); color:var(--side-text);}
.nav-item.active{background:var(--side-active-bg); color:var(--side-active-text);}
.nav-item.active svg{opacity:1;}
.nav-badge{margin-left:auto; background:var(--pulse); color:#1C1305; font-size:10px; font-weight:700; padding:1px 6px; border-radius:20px;}

.main{display:flex; flex-direction:column; min-width:0;}
.topbar{
  height:66px; background:var(--surface); border-bottom:1px solid var(--border);
  display:flex; align-items:center; gap:16px; padding:0 24px; position:sticky; top:0; z-index:20;
  backdrop-filter:blur(10px); background:color-mix(in srgb, var(--surface) 90%, transparent);
}
.crumb{font-size:12.5px; color:var(--text-faint); font-weight:600; display:flex; align-items:center; gap:6px;}
.crumb b{color:var(--text); font-weight:700;}
.search-bar{
  flex:1; max-width:380px; display:flex; align-items:center; gap:9px; background:var(--surface-2);
  border:1px solid var(--border); border-radius:11px; padding:8px 12px; color:var(--text-faint); font-size:13px;
}
.topbar-actions{display:flex; align-items:center; gap:10px; margin-left:auto;}
.icon-btn{
  width:38px; height:38px; border-radius:11px; border:1px solid var(--border); background:var(--surface);
  display:flex; align-items:center; justify-content:center; color:var(--text-muted); position:relative;
}
.icon-btn:hover{background:var(--surface-2);}
.dot-badge{position:absolute; top:7px; right:7px; width:7px; height:7px; border-radius:50%; background:var(--red); border:2px solid var(--surface);}
.profile-chip{display:flex; align-items:center; gap:9px; padding:5px 10px 5px 5px; border-radius:30px; border:1px solid var(--border); background:var(--surface);}
.avatar{width:30px; height:30px; border-radius:50%; background:linear-gradient(150deg,var(--teal),var(--primary)); display:flex; align-items:center; justify-content:center; color:#fff; font-weight:700; font-size:12px;}
.profile-chip .who{font-size:12px; line-height:1.25;}
.profile-chip .who b{display:block; font-size:12.5px;}
.profile-chip .who span{color:var(--text-faint); font-size:10.5px;}

.content{padding:26px 28px 60px; flex:1;}
.page-head{display:flex; align-items:flex-end; justify-content:space-between; margin-bottom:20px; flex-wrap:wrap; gap:14px;}
.page-head h1{font-size:23px; font-weight:600;}
.page-head p{color:var(--text-muted); font-size:13px; margin-top:3px;}

 /*============ BUTTONS ============ */
.btn{
  display:inline-flex; align-items:center; gap:7px; padding:10px 16px; border-radius:11px; font-size:13px; font-weight:700;
  border:1px solid transparent; transition:transform .1s, box-shadow .15s;
}
.btn:active{transform:scale(.97);}
.btn-primary{background:var(--primary); color:#fff; box-shadow:0 6px 16px -6px color-mix(in srgb, var(--primary) 60%, transparent);}
.btn-primary:hover{background:var(--primary-dark);}
.btn-ghost{background:var(--surface); border-color:var(--border); color:var(--text);}
.btn-ghost:hover{background:var(--surface-2);}
.btn-sm{padding:7px 12px; font-size:12px; border-radius:9px;}

 /*============ GRID / CARDS ============ */
.grid{display:grid; gap:18px;}
.g-5{grid-template-columns:repeat(5,1fr);}
.g-4{grid-template-columns:repeat(4,1fr);}
.g-3{grid-template-columns:repeat(3,1fr);}
.g-2{grid-template-columns:repeat(2,1fr);}
.card{
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius);
  padding:18px; box-shadow:var(--shadow-sm);
}
.card-title-row{display:flex; align-items:center; justify-content:space-between; margin-bottom:14px;}
.card-title-row h3{font-size:14px; font-weight:700;}
.card-title-row .link{font-size:12px; color:var(--primary); font-weight:700;}

.kpi{display:flex; flex-direction:column; gap:10px; position:relative; overflow:hidden;}
.kpi .top{display:flex; align-items:center; justify-content:space-between;}
.kpi-icon{width:36px; height:36px; border-radius:10px; display:flex; align-items:center; justify-content:center;}
.kpi .value{font-family:var(--font-display); font-size:28px; font-weight:600; letter-spacing:-.01em;}
.kpi .label{font-size:12px; color:var(--text-muted); font-weight:600;}
.trend{display:inline-flex; align-items:center; gap:3px; font-size:11.5px; font-weight:700; padding:2px 7px; border-radius:20px;}
.trend.up{color:var(--green); background:var(--green-tint);}

.badge{display:inline-flex; align-items:center; gap:5px; font-size:11px; font-weight:700; padding:3px 9px; border-radius:20px;}
.badge.blue{color:var(--primary); background:var(--primary-tint);}
.badge.teal{color:var(--teal); background:var(--teal-tint);}
.badge.green{color:var(--green); background:var(--green-tint);}
.badge.amber{color:var(--amber); background:var(--amber-tint);}
.badge.red{color:var(--red); background:var(--red-tint);}
.badge.gray{color:var(--text-muted); background:var(--surface-2);}
.badge-dot{width:6px; height:6px; border-radius:50%; background:currentColor;}

 /*============ TABLE ============ */
.table-wrap{overflow-x:auto;}
table{width:100%; border-collapse:collapse; font-size:13px;}
th{text-align:left; font-size:11px; text-transform:uppercase; letter-spacing:.05em; color:var(--text-faint); font-weight:700; padding:10px 12px; border-bottom:1px solid var(--border); white-space:nowrap;}
td{padding:12px; border-bottom:1px solid var(--border); vertical-align:middle; white-space:nowrap;}
tr:last-child td{border-bottom:none;}
tbody tr:hover{background:var(--surface-2);}
.cell-person{display:flex; align-items:center; gap:10px;}
.cell-person .a2{width:32px; height:32px; border-radius:9px; background:var(--surface-3); display:flex; align-items:center; justify-content:center; font-weight:700; font-size:11px; color:var(--text-muted);}
.cell-person .name{font-weight:700; font-size:13px;}
.cell-person .sub{font-size:11.5px; color:var(--text-faint);}
.row-actions{display:flex; gap:6px;}
.icon-sm{width:30px; height:30px; border-radius:8px; border:1px solid var(--border); display:flex; align-items:center; justify-content:center; color:var(--text-muted); background:var(--surface);}
.icon-sm:hover{background:var(--surface-2);}

 /*============ PROGRESS / OCCUPANCY ============ */
.bar-track{height:8px; border-radius:20px; background:var(--surface-3); overflow:hidden;}
.bar-fill{height:100%; border-radius:20px;}
.donut{width:120px; height:120px; border-radius:50%; display:flex; align-items:center; justify-content:center; position:relative; flex-shrink:0;}
.donut .center{position:absolute; text-align:center;}
.donut .center b{font-family:var(--font-display); font-size:20px; font-weight:600; display:block;}
.donut .center span{font-size:10px; color:var(--text-faint); font-weight:600;}

 /*============ TIMELINE (recent activity feed) ============ */
.timeline{position:relative; padding-left:20px;}
.timeline::before{content:''; position:absolute; left:5px; top:4px; bottom:4px; width:2px; background:var(--border);}
.t-item{position:relative; padding-bottom:18px;}
.t-item:last-child{padding-bottom:0;}
.t-dot{position:absolute; left:-20px; top:2px; width:12px; height:12px; border-radius:50%; background:var(--surface); border:2px solid var(--primary);}
.t-item .time{font-size:11px; color:var(--text-faint); font-weight:600;}
.t-item .txt{font-size:13px; font-weight:600; margin-top:1px;}

 /*============ PATIENT DETAIL CARD ============ */
.avatar-lg{width:44px; height:44px; border-radius:50%; background:linear-gradient(150deg,var(--teal),var(--primary)); display:flex; align-items:center; justify-content:center; color:#fff; font-weight:700; font-size:15px; flex-shrink:0;}
.info-tile{background:var(--surface-2); border-radius:12px; padding:12px 14px;}
.info-tile .k{font-size:10px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:var(--text-faint); margin-bottom:4px;}
.info-tile .v{font-size:15px; font-weight:700;}
.doc-row{display:flex; align-items:center; justify-content:space-between; background:var(--surface-2); border-radius:11px; padding:10px 13px; font-size:12.5px; font-weight:600;}
.doc-row .left{display:flex; align-items:center; gap:9px; color:var(--text);}
.section-label{font-size:10.5px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--text-faint); margin:18px 0 8px;}
.section-label:first-of-type{margin-top:0;}

 /*============ PATIENT PORTAL — spec tiles, doctor cards, slot picker ============ */
.spec-tile{background:var(--surface); border:1px solid var(--border); border-radius:14px; padding:16px; text-align:center; cursor:pointer; transition:border-color .15s;}
.spec-tile:hover{border-color:var(--primary);}
.spec-tile.active{border-color:var(--primary); box-shadow:0 0 0 1px var(--primary);}
.spec-tile .icon{width:44px; height:44px; border-radius:11px; background:var(--primary-tint); color:var(--primary); display:flex; align-items:center; justify-content:center; margin:0 auto 10px;}
.spec-tile .name{font-weight:700; font-size:13.5px;}
.spec-tile .count{font-size:11.5px; color:var(--text-faint); margin-top:2px;}

.doctor-row{display:flex; align-items:center; justify-content:space-between; gap:16px; padding:16px 0; border-bottom:1px solid var(--border);}
.doctor-row:last-child{border-bottom:none;}

 /*============ PATIENT HEADER (no sidebar — consumer-style top nav) ============ */


.patient-header{height:66px; background:var(--surface); border-bottom:1px solid var(--border); display:flex; align-items:center; padding:0 28px; gap:20px; position:sticky; top:0; z-index:20;}
.patient-header .brand{padding:0;}
.ph-brand-name{font-size:15px;}
.patient-nav{display:flex; gap:6px; margin-left:24px;}
.patient-nav a{padding:8px 14px; border-radius:10px; font-size:13px; font-weight:700; color:var(--text-muted); white-space:nowrap;}
.patient-nav a.active, .patient-nav a:hover{background:var(--primary-tint); color:var(--primary);}
.ph-right{margin-left:auto; display:flex; align-items:center; gap:12px;}
.ph-user{font-size:13px; font-weight:700; color:var(--text-muted); max-width:180px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.patient-content{padding:28px; max-width:960px; margin:0 auto;}

/* ---------- Hamburger (hidden on desktop) ---------- */
.ph-burger{
  display:none; margin-left:auto; width:42px; height:42px; border-radius:11px;
  border:1px solid var(--border); background:var(--surface);
  flex-direction:column; align-items:center; justify-content:center; gap:4px; flex-shrink:0;
}
.ph-burger span{display:block; width:18px; height:2px; border-radius:2px; background:var(--text); transition:transform .25s, opacity .25s;}
.ph-burger:hover{background:var(--surface-2);}
.ph-burger:focus-visible, .ph-close:focus-visible, .ph-drawer-nav a:focus-visible{outline:2px solid var(--primary); outline-offset:2px;}

/* ---------- Mobile drawer ---------- */
.ph-backdrop{position:fixed; inset:0; z-index:60; background:rgba(18,32,25,.45); opacity:0; transition:opacity .25s ease;}
.ph-backdrop.show{opacity:1;}
.ph-drawer{
  position:fixed; top:0; right:0; z-index:70; height:100vh; height:100dvh; width:min(320px, 86vw);
  background:var(--surface); border-left:1px solid var(--border); box-shadow:var(--shadow-lg);
  display:flex; flex-direction:column; padding:16px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  transform:translateX(100%); visibility:hidden; transition:transform .28s ease, visibility .28s;
  overflow-y:auto;
}
.ph-drawer.open{transform:translateX(0); visibility:visible;}
.ph-drawer-head{display:flex; align-items:center; justify-content:space-between; padding-bottom:14px; border-bottom:1px solid var(--border);}
.ph-drawer-head .brand{padding:0;}
.ph-close{width:38px; height:38px; border-radius:11px; border:1px solid var(--border); background:var(--surface); color:var(--text-muted); display:flex; align-items:center; justify-content:center;}
.ph-close:hover{background:var(--surface-2);}
.ph-drawer-user{display:flex; align-items:center; gap:10px; padding:14px 12px; margin-top:14px; background:var(--surface-2); border-radius:12px;}
.ph-drawer-user b{display:block; font-size:13.5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:190px;}
.ph-drawer-user small{font-size:11px; color:var(--text-faint); font-weight:600;}
.ph-drawer-nav{display:flex; flex-direction:column; gap:4px; margin-top:14px;}
.ph-drawer-nav a{padding:12px 14px; border-radius:10px; font-size:14px; font-weight:700; color:var(--text-muted);}
.ph-drawer-nav a.active, .ph-drawer-nav a:hover{background:var(--primary-tint); color:var(--primary);}
.ph-drawer-foot{margin-top:auto; padding-top:16px; border-top:1px solid var(--border); display:flex; flex-direction:column; gap:10px;}
.ph-drawer-foot .btn{justify-content:center; width:100%; padding:12px 16px;}

/* ---------- Responsive ---------- */
@media (min-width:1600px){
  .patient-header{padding:0 40px;}
}
@media (max-width:1024px){
  .patient-content{padding:24px 20px;}
}
@media (max-width:768px){
  .patient-nav, .ph-right{display:none;}
  .ph-burger{display:flex;}
  .patient-header{padding:0 16px; gap:12px;}
  .patient-content{padding:20px 16px;}
}
@media (max-width:480px){
  .patient-header{height:58px; padding:0 14px;}
  .patient-content{padding:16px 14px;}
}
@media (max-width:340px){
  .patient-header{padding:0 10px;}
  .ph-burger{width:38px; height:38px;}
  .patient-content{padding:14px 10px;}
}
@media (min-width:769px){
  .ph-drawer, .ph-backdrop{display:none !important;}
}
@media (prefers-reduced-motion:reduce){
  .ph-drawer, .ph-backdrop, .ph-burger span{transition:none;}
}

 /*============ AUTH (LOGIN / FORGOT / OTP / RESET) ============ */
.auth-wrap{min-height:100vh; background:
  radial-gradient(1000px 600px at 85% -10%, color-mix(in srgb, var(--teal) 18%, transparent), transparent),
  radial-gradient(900px 500px at -10% 110%, color-mix(in srgb, var(--primary) 16%, transparent), transparent),
  var(--bg);
  display:grid; align-items:stretch; grid-template-columns:1fr 460px;}
.auth-visual{display:flex; flex-direction:column; justify-content:space-between; padding:48px; position:relative; overflow:hidden;}
.auth-visual .brand{padding:0;}
.auth-copy h2{font-family:var(--font-display); font-size:36px; font-weight:600; max-width:460px; line-height:1.18; letter-spacing:-.01em;}
.auth-copy p{color:var(--text-muted); margin-top:12px; max-width:420px; font-size:14.5px;}
.floaty-card{position:absolute; background:var(--surface); border:1px solid var(--border); border-radius:14px; box-shadow:var(--shadow-lg); padding:14px 16px;}
.auth-panel{background:var(--surface); border-left:1px solid var(--border); display:flex; flex-direction:column; justify-content:center; padding:48px;}
.auth-panel h1{font-size:24px; font-weight:600; margin-bottom:6px;}
.auth-panel .hint{color:var(--text-muted); font-size:13.5px; margin-bottom:26px;}
.field{margin-bottom:16px;}
.field label{display:block; font-size:12.5px; font-weight:700; margin-bottom:6px;}
.field input{
  width:100%; padding:11px 13px; border-radius:11px; border:1px solid var(--border); background:var(--surface-2);
  font-size:14px; color:var(--text); font-family:inherit;
}
.field input:focus{outline:2px solid var(--primary); outline-offset:1px; background:var(--surface);}
.otp-row{display:flex; gap:10px;}
.otp-row input{text-align:center; font-family:var(--font-mono); font-size:14px; font-weight:500; width:100%; padding:12px 0;}
.auth-foot{display:flex; justify-content:space-between; align-items:center; font-size:12.5px; margin-top:2px; color:var(--text-muted);}
.auth-error{background:var(--red-tint); color:var(--red); font-size:13px; font-weight:600; padding:10px 13px; border-radius:11px; margin-bottom:18px;}

/* ============ RESPONSIVE ============ */
/*}*/
/*}*/
/*}*/




/* ============ RESPONSIVE ============ */

/* Mobile menu button + sidebar backdrop (hidden on desktop) */
.menu-toggle{display:none;}

/* ---------- Extra large screens (2K / 4K / ultrawide) ---------- */
@media (min-width:1600px){
  .content{padding:32px 40px 70px;}
  .topbar{padding:0 40px;}
  .search-bar{max-width:460px;}
  .patient-content{max-width:1140px;}
}
@media (min-width:1920px){
  .content{max-width:1760px; width:100%; margin:0 auto;}
  .grid{gap:22px;}
  .card{padding:22px;}
}
@media (min-width:2560px){
  .content{max-width:2200px;}
  .patient-content{max-width:1320px;}
}

/* ---------- Laptop / small desktop ---------- */
@media (max-width:1180px){
  .g-5{grid-template-columns:repeat(3,1fr);}
  .g-4{grid-template-columns:repeat(2,1fr);}
  .auth-wrap{grid-template-columns:1fr;}
  .auth-visual{display:none;}
  .auth-panel{border-left:none; max-width:520px; width:100%; margin:0 auto; background:transparent;}
  .auth-panel > *{background:transparent;}
}

/* ---------- Tablet landscape ---------- */
@media (max-width:1024px){
  .content{padding:22px 22px 50px;}
  .topbar{padding:0 20px; gap:12px;}
  .search-bar{max-width:280px;}
  .patient-header{padding:0 20px;}
  .patient-nav{margin-left:8px;}
}

/* ---------- Tablet portrait (sidebar off-canvas) ---------- */
@media (max-width:880px){
  .app{grid-template-columns:1fr;}
  .sidebar{
    position:fixed; left:-270px; top:0; z-index:50; width:250px; height:100vh;
    transition:left .25s ease; box-shadow:var(--shadow-lg);
  }
  .sidebar.open{left:0;}
  .menu-toggle{display:flex;}

  .g-3{grid-template-columns:repeat(2,1fr);}
  .g-5, .g-4{grid-template-columns:repeat(2,1fr);}

  .patient-header{gap:12px;}
  .patient-nav{
    overflow-x:auto; scrollbar-width:none; -webkit-overflow-scrolling:touch; flex:1; min-width:0;
  }
  .patient-nav::-webkit-scrollbar{display:none;}
  .patient-nav a{white-space:nowrap;}
  .patient-content{padding:22px 20px;}
}

/* ---------- Large phones / small tablets ---------- */
@media (max-width:768px){
  .g-2{grid-template-columns:1fr;}
  .crumb{display:none;}
  .search-bar{max-width:none;}
  .auth-panel{padding:40px 28px;}
  .auth-copy h2{font-size:30px;}
  .card-title-row{flex-wrap:wrap; gap:8px;}
}

/* ---------- Phones ---------- */
@media (max-width:560px){
  .g-3,.g-5,.g-4{grid-template-columns:1fr;}
  .grid{gap:14px;}
  .profile-chip{padding:3px;}
  .profile-chip .who{display:none;}
  .topbar{height:58px; padding:0 14px; gap:10px;}
  .content{padding:14px 14px 40px;}
  .page-head{flex-direction:column; align-items:flex-start; margin-bottom:16px;}
  .page-head h1{font-size:20px;}
  .page-head > div:last-child{width:100%; display:flex; flex-wrap:wrap; gap:8px;}

  .card{padding:14px; border-radius:14px;}
  .kpi .value{font-size:24px;}
  .icon-btn{width:36px; height:36px;}

  th{padding:9px 10px;}
  td{padding:10px;}

  .patient-header{height:58px; padding:0 14px;}
  .patient-nav{margin-left:0;}
  .patient-nav a{padding:7px 11px; font-size:12.5px;}
  .patient-content{padding:16px 14px;}
  .doctor-row .btn{width:100%; justify-content:center;}

  .auth-panel{padding:32px 18px;}
  .auth-panel h1{font-size:21px;}
  .otp-row{gap:7px;}
  /* prevent iOS auto-zoom on input focus */
  .field input, .search-bar input{font-size:16px;}
}

/* ---------- Small phones (iPhone SE, 360px Android) ---------- */
@media (max-width:380px){
  .content{padding:12px 12px 36px;}
  .topbar{padding:0 10px; gap:8px;}
  .search-bar{display:none;}
  .brand-sub{display:none;}
  .btn{padding:9px 13px;}
  .kpi .value{font-size:22px;}
  .donut{width:100px; height:100px;}
  .info-tile{padding:10px 12px;}
  .info-tile .v{font-size:14px;}
  .otp-row input{font-size:17px; padding:10px 0;}
  .auth-panel{padding:26px 14px;}
}

/* ---------- Very small (Galaxy Fold ~280px) ---------- */
@media (max-width:320px){
  .otp-row{gap:4px;}
  .page-head h1{font-size:18px;}
}

/* ---------- Landscape phones (short height) ---------- */
@media (max-height:500px) and (orientation:landscape){
  .auth-panel{justify-content:flex-start; padding-top:24px; padding-bottom:24px;}
  .topbar, .patient-header{position:static;}
}

/* ---------- Notch / safe-area (iPhone) ---------- */
@supports (padding:max(0px)){
  .topbar, .patient-header{
    padding-left:max(14px, env(safe-area-inset-left));
    padding-right:max(14px, env(safe-area-inset-right));
  }
}

/* ---------- Touch devices: hover effects should not stick on mobile ---------- */
@media (hover:none){
  tbody tr:hover{background:transparent;}
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion:reduce){
  .pulse-path{animation:none; stroke-dashoffset:0;}
  .sidebar{transition:none;}
}



/*patient filter*/

/* ===== Patients page — filters + row select ===== */
.patient-filters { display:flex; flex-wrap:wrap; gap:10px; margin-bottom:14px; }
.pf-search { position:relative; flex:1 1 220px; }
.pf-search svg { position:absolute; left:12px; top:50%; transform:translateY(-50%); color:var(--text-faint); pointer-events:none; }
.pf-input {
  height:40px; padding:0 12px; font:inherit; font-size:13px; color:inherit;
  background:var(--surface, #fff); border:1px solid var(--border, #E6DFD2); border-radius:10px;
}
.pf-search .pf-input { width:100%; padding-left:36px; }
select.pf-input { min-width:170px; cursor:pointer; }
.pf-input:focus { outline:none; border-color:#0E4B43; box-shadow:0 0 0 3px rgba(14,75,67,.12); }
.pf-reset {
  height:40px; padding:0 16px; font:inherit; font-size:13px; font-weight:600; cursor:pointer;
  color:#0E4B43; background:transparent; border:1px solid var(--border, #E6DFD2); border-radius:10px;
}
.pf-reset:hover { background:rgba(14,75,67,.06); }

.p-row { cursor:pointer; transition:background .15s; }
.p-row:hover { background:rgba(222,154,60,.07); }
.p-row.is-selected { background:var(--surface-2); }
.p-row:focus-visible { outline:2px solid #0E4B43; outline-offset:-2px; }
.p-row[hidden] { display:none; }
.pf-empty td { text-align:center; padding:30px 0; color:var(--text-faint); }

@media (max-width: 640px) {
  select.pf-input, input[type="date"].pf-input { flex:1 1 140px; min-width:0; }
}

/*dr filters*/

/* ===== Doctors page — filter hide + empty state ===== */
.doc-card[hidden], .df-empty[hidden] { display:none !important; }
.df-empty { text-align:center; padding:40px 20px; color:var(--text-faint); }


/*appointment filter*/
/* ===== Appointments — week navigation ===== */











/* =====================================================================
   SACHICARE — DOCTOR WORKSPACE (fully responsive)
   In style.css, remove the old block from "DOCTOR WORKSPACE v2" to the END of the file
   and paste this instead.

   Breakpoints:
     ≥1920  extra large monitor     1440–1919  desktop (3 columns)
     1200–1439  laptop (history below)   992–1199  small laptop (icon sidebar)
     768–991  tablet (top nav, 1 column)  576–767  large phone
     <576  phone        <360  very small phone
   Palette: bg #F6F2EA · primary #0E4B43 · accent #DE9A3C
   ===================================================================== */

/* ---------- base ---------- */
.dws-shell, .dws-shell *, .rxp-body, .rxp-body * { box-sizing: border-box; }
.dw-hide { display: none !important; }
.dw-mono { font-family: 'IBM Plex Mono', monospace; }
.dw-amber { color: #A5651A !important; }

/* =====================================================================
   SHELL: sidebar + topbar
   ===================================================================== */
.dws-shell { display: flex; min-height: 100vh; background: #F6F2EA; font-family: 'Inter', sans-serif; color: #1d2a26; }

.dws-sidebar { width: 260px; flex-shrink: 0; background: #122019; color: #dfe7e3; padding: 24px 16px; display: flex; flex-direction: column; gap: 24px; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 30; }
.dws-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; font-family: 'Fraunces', serif; font-weight: 600; font-size: 21px; color: #fff; text-decoration: none; white-space: nowrap; }
.dws-logo { width: 38px; height: 38px; flex-shrink: 0; border-radius: 10px; background: #DE9A3C; color: #122019; display: flex; align-items: center; justify-content: center; }
.dws-nav { display: flex; flex-direction: column; gap: 4px; }
.dws-nav-label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #7f8f88; padding: 0 12px 6px; }
.dws-link { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 10px; color: #c9d4cf; text-decoration: none; font-size: 15px; cursor: pointer; white-space: nowrap; }
.dws-link svg { flex-shrink: 0; }
.dws-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.dws-link.active { background: rgba(222, 154, 60, .16); color: #F0B865; font-weight: 600; }
.dws-link:focus-visible { outline: 2px solid #DE9A3C; outline-offset: 2px; }
.dws-toggle-row { position: relative; }
.dws-switch-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.dws-switch { margin-left: auto; width: 40px; height: 22px; flex-shrink: 0; border-radius: 999px; background: #3a4a44; padding: 3px; }
.dws-switch span { display: block; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.dws-switch-input:checked + .dws-switch { background: #DE9A3C; }
.dws-switch-input:checked + .dws-switch span { transform: translateX(18px); }
.dws-switch-input:focus-visible + .dws-switch { box-shadow: 0 0 0 2px #DE9A3C; }

.dws-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dws-topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 14px 28px; border-bottom: 1px solid #e6ddcd; background: #F6F2EA; position: sticky; top: 0; z-index: 20; }
.dws-crumb { font-size: 14px; color: #7a8783; white-space: nowrap; }
.dws-crumb strong { color: #1d2a26; }
.dws-search { flex: 1 1 240px; max-width: 460px; min-width: 0; display: flex; align-items: center; gap: 8px; background: #EFE7D9; border: 1px solid #e2d7c4; border-radius: 10px; padding: 10px 14px; color: #8a948f; }
.dws-search input { border: 0; background: transparent; outline: none; flex: 1; min-width: 0; font-size: 14px; color: #1d2a26; font-family: inherit; }
.dws-search:focus-within { border-color: #0E4B43; }
.dws-top-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.dws-icon-btn { width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px; border: 1px solid #e2d7c4; background: #fff; color: #1d2a26; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.dws-profile { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid #e2d7c4; border-radius: 999px; padding: 5px 16px 5px 5px; min-width: 0; }
.dws-avatar { width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; background: #0E4B43; color: #fff; font-weight: 600; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.dws-profile-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.dws-profile-text strong, .dws-profile-text small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.dws-profile-text strong { font-size: 14px; }
.dws-profile-text small { font-size: 12px; color: #7a8783; }

/* =====================================================================
   PAGE
   ===================================================================== */
.dw-page { width: 100%; max-width: 1680px; margin: 0 auto; padding: 24px 28px 40px; display: flex; flex-direction: column; gap: 20px; font-family: 'Inter', sans-serif; color: #1d2a26; }
.dw-title { margin: 0; font-family: 'Fraunces', serif; font-weight: 600; font-size: clamp(22px, 1.4vw + 14px, 34px); line-height: 1.15; color: #1d2a26; }

/* ---------- buttons ---------- */
.dw-btn { min-height: 44px; padding: 0 18px; border-radius: 12px; font-family: inherit; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; border: 1px solid transparent; text-align: center; transition: background .15s, border-color .15s; }
.dw-btn:disabled { opacity: .55; cursor: not-allowed; }
.dw-btn:focus-visible { outline: 3px solid rgba(14, 75, 67, .35); outline-offset: 2px; }
.dw-btn-primary { background: #0E4B43; color: #fff; }
.dw-btn-primary:hover:not(:disabled) { background: #0a3a34; }
.dw-btn-outline { background: #fff; border-color: #d9cfbd; color: #1d2a26; }
.dw-btn-outline:hover { border-color: #0E4B43; }
.dw-btn-warn { background: #FBEBD3; border-color: #DE9A3C; color: #7a4810; }
.dw-btn-soft { background: #F6F2EA; border-color: #d9cfbd; color: #0E4B43; min-height: 40px; font-size: 13px; }
.dw-btn-dashed { background: #fff; border: 1px dashed #b9ab92; color: #0E4B43; min-height: 40px; }
.dw-btn-grow { flex: 1 1 240px; min-height: 48px; font-size: 15px; }

/* ---------- stats (cards + filters) ---------- */
.dw-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.dw-stat { min-width: 0; background: #fff; border: 1px solid #ece4d6; display: flex; flex-direction: column; }
.dw-stat span { display: block; font-weight: 600; text-transform: uppercase; color: #6b7a75; line-height: 1.3; }
.dw-stat b { font-family: 'Fraunces', serif; font-size: clamp(22px, 1vw + 16px, 32px); font-weight: 600; color: #0E4B43; line-height: 1.1; }
.dw-stat-btn { width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s; }
.dw-stat-btn:hover { border-color: #0E4B43; }
.dw-stat-btn:focus-visible { outline: 3px solid rgba(14, 75, 67, .35); outline-offset: 2px; }
.dw-stat-btn.active { border-color: #0E4B43; box-shadow: 0 0 0 2px #0E4B43 inset; background: #F4F9F7; }

/* ---------- 2 columns: queue | consultation (history inside consultation) ---------- */
.dw-cols { display: grid; grid-template-columns: minmax(260px, 320px) minmax(0, 1fr); gap: 20px; align-items: start; }
.dw-card { min-width: 0; background: #fff; border: 1px solid #ece4d6; border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.dw-queue { position: sticky; top: 88px; max-height: calc(100vh - 104px); overflow-y: auto; overscroll-behavior: contain; }
.dw-consult { padding: 22px; gap: 18px; }
#cBody { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.dw-card-head, .dw-row-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.dw-card-title { margin: 0; font-family: 'Fraunces', serif; font-weight: 600; font-size: 18px; }
.dw-label { display: block; font-size: 12px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: #6b7a75; margin-bottom: 8px; }
.dw-hint { font-size: 12px; color: #6b7a75; display: inline-flex; align-items: center; gap: 6px; }
.dw-pill { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.dw-pill-green { background: #E3F0EC; color: #0E4B43; }
.dw-pill-amber { background: #FBEBD3; color: #8a5414; }
.dw-pill-grey { background: #ECE8E0; color: #4f5d58; }
.dw-empty { text-align: center; padding: 60px 16px; color: #6b7a75; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.dw-empty p { margin: 0; }
.dw-note { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; background: #FBEBD3; color: #6b4210; border-radius: 12px; padding: 10px 14px; font-size: 13px; }
.dw-note span { flex: 1 1 240px; }

/* ---------- form fields ---------- */
.dw-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #4f5d58; min-width: 0; }
.dw-field-lg { font-size: 12px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: #6b7a75; gap: 6px; }
.dw-input { width: 100%; min-width: 0; border: 1px solid #e2d7c4; background: #FAF7F1; border-radius: 10px; padding: 10px; font-size: 14px; font-family: 'Inter', sans-serif; font-weight: 400; letter-spacing: 0; text-transform: none; color: #1d2a26; }
.dw-input:focus { outline: none; border-color: #0E4B43; box-shadow: 0 0 0 3px rgba(14, 75, 67, .12); background: #fff; }
textarea.dw-input { resize: vertical; min-height: 64px; }
.dw-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.vitals-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }

/* ---------- queue ---------- */
.q-sec { display: flex; flex-direction: column; gap: 8px; }
.q-showall { align-self: flex-start; border: 0; background: none; color: #0E4B43; font-family: inherit; font-weight: 600; font-size: 13px; cursor: pointer; padding: 4px 0; }
.q-showall:hover { text-decoration: underline; }
.q-now { background: #0E4B43; color: #fff; border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.q-now-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 16px; min-width: 0; }
.q-now-top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-now-top .dw-mono { color: #F0B865; font-size: 13px; flex-shrink: 0; }
.q-now-sub { font-size: 13px; color: #c7ddd7; }
.q-list { display: flex; flex-direction: column; gap: 8px; }
.q-item { min-width: 0; border: 1px solid #ece4d6; border-radius: 12px; padding: 12px; display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; }
.q-item > div:first-child { min-width: 0; }
.q-item strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-type { font-size: 12px; color: #6b7a75; }
.q-right { flex-shrink: 0; text-align: right; font-size: 13px; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.q-slot { font-size: 12px; color: #A5651A; font-weight: 600; }
.q-call { margin-top: 4px; min-height: 32px; border: 0; background: #0E4B43; color: #fff; border-radius: 8px; padding: 4px 14px; font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.q-done-list { display: flex; flex-direction: column; gap: 4px; }
.q-done { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: #6b7a75; padding: 6px 8px; border-radius: 8px; border: 1px solid transparent; }
.q-none { font-size: 13px; color: #8a948f; padding: 6px 0; }
.q-error { font-size: 13px; color: #8f2f26; background: #fbe4e1; border-radius: 10px; padding: 10px 12px; }
.q-open { cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s; }
.q-open:focus-visible { outline: 3px solid rgba(14, 75, 67, .35); outline-offset: 2px; }
.q-item.q-active { border-color: #0E4B43; box-shadow: 0 0 0 2px #0E4B43 inset; background: #F4F9F7; }
.q-now.q-active { box-shadow: 0 0 0 3px #DE9A3C; }
.q-done.q-active { border-color: #0E4B43; background: #F4F9F7; color: #1d2a26; }
@media (hover: hover) {
  .q-item.q-open:hover, .q-done.q-open:hover { border-color: #0E4B43; background: #F4F9F7; }
}

/* ---------- patient strip ---------- */
.pt-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding-bottom: 16px; border-bottom: 1px solid #efe7da; }
.pt-avatar { width: 50px; height: 50px; flex-shrink: 0; border-radius: 50%; background: #0E4B43; color: #fff; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.pt-meta { flex: 1 1 200px; min-width: 0; }
.pt-name { font-family: 'Fraunces', serif; font-weight: 600; font-size: clamp(18px, .6vw + 15px, 23px); overflow-wrap: anywhere; }
.pt-sub { font-size: 13px; color: #6b7a75; overflow-wrap: anywhere; }

/* ---------- prescription rows ---------- */
.rx-list { display: flex; flex-direction: column; gap: 8px; }
.rx-row { background: #F6F2EA; border-radius: 12px; padding: 10px 12px; display: grid; grid-template-columns: minmax(0, 1fr) 100px 92px auto 36px; grid-template-areas: "med freq days switch del"; align-items: center; gap: 10px; }
.rx-row .dw-input { background: #fff; padding: 8px 10px; font-size: 13px; }
.rx-med { grid-area: med; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.rx-med .rx-name { font-weight: 600; font-size: 14px; }
.rx-sub { display: flex; gap: 6px; min-width: 0; }
.rx-sub .rx-dose { flex: 1 1 90px; }
.rx-sub .rx-food { flex: 1 1 130px; }
.rx-freq { grid-area: freq; width: 100%; font-weight: 600; font-size: 14px !important; }
.rx-days { grid-area: days; display: flex; align-items: center; gap: 4px; font-size: 12px; color: #4f5d58; }
.rx-days-in { width: 100%; min-width: 0; }
.rx-switch { grid-area: switch; display: flex; align-items: center; gap: 8px; cursor: pointer; min-width: 134px; position: relative; }
.rx-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rx-track { width: 46px; height: 28px; border-radius: 999px; background: #cfc6b6; padding: 3px; transition: background .15s; flex-shrink: 0; }
.rx-knob { display: block; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .15s; }
.rx-switch input:checked + .rx-track { background: #0E4B43; }
.rx-switch input:checked + .rx-track .rx-knob { transform: translateX(18px); }
.rx-switch input:disabled + .rx-track { opacity: .5; cursor: not-allowed; }
.rx-switch input:focus-visible + .rx-track { box-shadow: 0 0 0 3px rgba(14, 75, 67, .25); }
.rx-switch-text { font-size: 12px; font-weight: 600; color: #4f5d58; white-space: nowrap; }
.rx-del { grid-area: del; width: 36px; height: 36px; border: 0; background: transparent; color: #a64a42; font-size: 20px; cursor: pointer; border-radius: 8px; justify-self: end; }
.rx-del:hover { background: #f3dcd8; }
.rx-add { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; }

/* ---------- labs ---------- */
.lab-box { background: #F6F2EA; border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.lab-box .dw-input { background: #fff; }
.lab-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.lab-chips:empty { display: none; }
.lab-chip { max-width: 100%; background: #fff; border: 1px solid #e2d7c4; border-radius: 999px; padding: 5px 10px 5px 12px; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; overflow-wrap: anywhere; }
.lab-chip em { font-style: normal; font-weight: 600; }
.lab-req { color: #A5651A; }
.lab-done { color: #2f7a52; }
.lab-chip button { border: 0; background: none; color: #a64a42; font-size: 16px; cursor: pointer; min-width: 24px; min-height: 24px; }
.lab-quick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lab-q { min-height: 34px; border: 1px solid #d9cfbd; background: #fff; border-radius: 999px; padding: 5px 12px; font-family: inherit; font-size: 13px; cursor: pointer; }
.lab-q:hover { border-color: #0E4B43; }

/* ---------- follow-up ---------- */
.fu-box { display: flex; flex-direction: column; }
.fu-box .dw-input { background: #fff; border-color: #cfdcd7; }
.fu-hint { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: #0E4B43; }
.fu-hint svg { flex-shrink: 0; margin-top: 1px; }

.dw-actions { padding-top: 4px; }

/* ---------- history ---------- */

/* ---------- loading skeleton (no flash while the page opens) ---------- */
@keyframes dw-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.dw-skel { background: linear-gradient(90deg, #EFE8DB 25%, #F8F4EC 50%, #EFE8DB 75%); background-size: 200% 100%; animation: dw-shimmer 1.2s ease-in-out infinite; border-radius: 10px; }
.dw-stat b:empty { display: block; margin-top: 2px; border-radius: 8px; background: linear-gradient(90deg, #EFE8DB 25%, #F8F4EC 50%, #EFE8DB 75%); background-size: 200% 100%; animation: dw-shimmer 1.2s ease-in-out infinite; }
.dw-skel-now { height: 72px; border-radius: 14px; }
.dw-skel-item { height: 58px; border-radius: 12px; }
.dw-skel-line { height: 14px; width: 70%; }
.dw-loading { display: flex; flex-direction: column; gap: 18px; padding: 4px 0; }
.dw-skel-row { display: flex; align-items: center; gap: 14px; }
.dw-skel-col { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.dw-skel-avatar { width: 50px; height: 50px; border-radius: 50%; flex-shrink: 0; }
.dw-skel-title { height: 20px; width: 45%; }
.dw-skel-block { height: 64px; }
.dw-skel-tall { height: 160px; }

/* =====================================================================
   CONSULTATION v3: Manual/Digital · history · uploads · voice
   ===================================================================== */

/* ---------- mode: manual / digital ---------- */
#cBody.is-manual .only-digital { display: none !important; }
#cBody.is-digital .only-manual { display: none !important; }
#cBody.is-manual .dx-row { grid-template-columns: minmax(0, 1fr); }
.dw-optional { font-weight: 400; text-transform: none; letter-spacing: 0; color: #8a948f; }

.pt-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dw-btn-mode { min-height: 36px; padding: 0 14px; font-size: 13px; background: #fff; border: 1.5px solid #0E4B43; color: #0E4B43; border-radius: 999px; }
.dw-btn-mode:hover { background: #F4F9F7; }
#cBody.is-manual .dw-btn-mode .ic-to-manual { display: none; }
#cBody.is-digital .dw-btn-mode .ic-to-digital { display: none; }

/* ---------- visit reason ---------- */
.pt-reason { font-size: 14px; line-height: 1.45; }
.pt-reason svg { flex-shrink: 0; margin-top: 2px; color: #A5651A; }
.pt-reason.is-empty { color: #6b7a75; }
.pt-reason.is-empty svg, .pt-reason.is-empty .pt-reason-label { color: #8a948f; }

/* ---------- patient history (visit-wise) ---------- */
.vh { display: flex; flex-direction: column; gap: 10px; }
.vh-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.vh-head .dw-label { margin-bottom: 0; }
.vh-none { font-size: 13px; color: #6b7a75; background: #F6F2EA; border-radius: 12px; padding: 12px 14px; }
.vh-card { border: 1px solid #ece4d6; border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: #fff; min-width: 0; }
.vh-card.vh-last { border-color: #0E4B43; box-shadow: 0 0 0 1px #0E4B43 inset; background: #FBFDFC; }
.vh-card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 12px; padding-bottom: 8px; border-bottom: 1px dashed #e6ddcd; }
.vh-when { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vh-tag { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; background: #0E4B43; color: #fff; border-radius: 999px; padding: 3px 9px; }
.vh-date { font-size: 13px; font-weight: 600; color: #A5651A; }
.vh-doc { font-size: 13px; font-weight: 600; color: #1d2a26; }
.vh-doc em { font-style: normal; font-weight: 500; color: #6b7a75; }
.vh-row { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px; font-size: 13.5px; line-height: 1.45; }
.vh-row > span:last-child { overflow-wrap: anywhere; }
.vh-k { font-size: 12px; font-weight: 600; color: #6b7a75; }
.vh-block { display: flex; flex-direction: column; gap: 6px; }
.vh-files { display: flex; flex-wrap: wrap; gap: 8px; }
.vh-file { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 36px; padding: 6px 10px; border: 1px solid #d9cfbd; border-radius: 10px; background: #fff; color: #1d2a26; text-decoration: none; font-size: 13px; }
.vh-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vh-file em { font-style: normal; font-size: 11px; background: #FBEBD3; color: #8a5414; padding: 1px 6px; border-radius: 999px; }
.vh-file b { display: inline-flex; align-items: center; gap: 3px; color: #0E4B43; font-size: 12px; }
.vh-file:hover { border-color: #0E4B43; background: #F4F9F7; }
.vh-file:focus-visible { outline: 3px solid rgba(14, 75, 67, .35); outline-offset: 2px; }
.vh-med { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.vh-med .dw-mono { color: #4f5d58; white-space: nowrap; }
.vh-adh { font-size: 12px; color: #2f7a52; font-weight: 600; }
.vh-repeat { align-self: flex-start; }
.vh-advice { margin: 0; font-size: 13.5px; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.vh-audio { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; background: #F6F2EA; border-radius: 10px; padding: 8px 10px; }
.vh-audio-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #4f5d58; }
.vh-audio audio { flex: 1 1 220px; min-width: 0; height: 36px; }
.vh-audio-open { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; color: #0E4B43; text-decoration: none; }
.vh-empty { font-size: 13px; color: #8a948f; }
.vh-toggle { align-self: flex-start; min-height: 40px; border: 1px dashed #b9ab92; background: #fff; color: #0E4B43; border-radius: 10px; padding: 0 14px; font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.vh-toggle:hover { border-color: #0E4B43; }
.vh-all { display: flex; flex-direction: column; gap: 10px; max-height: 640px; overflow-y: auto; padding-right: 2px; }

/* ---------- prescription / report upload ---------- */
.att { display: flex; flex-direction: column; gap: 10px; }
.att-box { display: flex; flex-direction: column; transition: border-color .15s, background .15s; }
.att-cats { display: flex; flex-wrap: wrap; }
.att-cat { border-radius: 999px; border: 1px solid #d9cfbd; font-family: inherit; font-size: 13px; font-weight: 600; color: #1d2a26; cursor: pointer; }
.att-cat.active { background: #0E4B43; border-color: #0E4B43; color: #fff; }
.att-pick { position: relative; display: flex; align-items: center; gap: 12px; cursor: pointer; }
.att-pick:focus-within { outline: 3px solid rgba(14, 75, 67, .35); outline-offset: 2px; }
.att-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.att-pick span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.att-pick small { font-size: 12px; color: #6b7a75; }
.att-progress { display: flex; flex-direction: column; gap: 6px; }
.att-progress:empty { display: none; }
.att-up { display: flex; align-items: center; gap: 10px; font-size: 12px; color: #4f5d58; }
.att-up span { flex: 0 1 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-bar { flex: 1; height: 6px; background: #ece4d6; border-radius: 999px; overflow: hidden; }
.att-bar i { display: block; width: 0; height: 100%; background: #0E4B43; transition: width .2s; }
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.att-none { grid-column: 1 / -1; font-size: 13px; color: #8a948f; }
.att-item { display: flex; align-items: flex-start; border: 1px solid #ece4d6; min-width: 0; background: #fff; }
.att-thumb { flex-shrink: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; color: #A5651A; text-decoration: none; }
.att-thumb img { width: 100%; height: 100%; object-fit: cover; }
.att-icon { display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 10px; font-weight: 700; }
.att-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.att-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-meta span { font-size: 11.5px; color: #6b7a75; }
.att-by { font-style: normal; font-size: 11.5px; color: #8a5414; font-weight: 600; }
.att-actions { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.att-view { display: inline-flex; align-items: center; gap: 3px; min-height: 30px; font-size: 12.5px; font-weight: 600; color: #0E4B43; text-decoration: none; padding: 4px 8px; margin-left: -8px; border-radius: 6px; }
.att-view:hover { background: #F4F9F7; }
.att-del { width: 30px; height: 30px; border: 0; background: transparent; color: #a64a42; font-size: 18px; border-radius: 8px; cursor: pointer; }
.att-del:hover { background: #f3dcd8; }

/* ---------- advice + voice recording ---------- */
.adv { display: flex; flex-direction: column; gap: 10px; }

@media (max-width: 767.98px) {
  .pt-badges { flex: 1 1 100%; }
  .dw-btn-mode { margin-left: auto; }
  .vh-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .vh-all { max-height: none; }
  .att-grid { grid-template-columns: minmax(0, 1fr); }
}

/* =====================================================================
   PATIENT PORTAL: my visits
   ===================================================================== */
.pv-page { max-width: 920px; margin: 0 auto; padding: 24px 16px 40px; font-family: 'Inter', sans-serif; color: #1d2a26; display: flex; flex-direction: column; gap: 16px; }
.pv-page *, .pv-page *::before, .pv-page *::after { box-sizing: border-box; }
.pv-title { margin: 0; font-family: 'Fraunces', serif; font-weight: 600; font-size: clamp(22px, 2vw + 14px, 30px); color: #0E4B43; }
.pv-sub { margin: 4px 0 0; color: #6b7a75; font-size: 14px; }
.pv-list { display: flex; flex-direction: column; gap: 14px; }
.pv-card { background: #fff; border: 1px solid #ece4d6; border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.pv-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; align-items: flex-start; padding-bottom: 10px; border-bottom: 1px dashed #e6ddcd; }
.pv-date { font-family: 'IBM Plex Mono', monospace; font-size: 13px; font-weight: 600; color: #A5651A; }
.pv-doc { font-weight: 600; font-size: 15px; }
.pv-hosp { font-size: 13px; color: #6b7a75; }
.pv-upload { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: #FDFBF7; border: 1.5px dashed #c9bda6; border-radius: 12px; padding: 10px; }
.pv-upload select { min-height: 40px; border: 1px solid #e2d7c4; border-radius: 10px; padding: 0 10px; font-family: inherit; font-size: 16px; background: #fff; }
.pv-pick { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 10px; background: #0E4B43; color: #fff; font-weight: 600; font-size: 14px; cursor: pointer; }
.pv-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.pv-pick:focus-within { outline: 3px solid rgba(14, 75, 67, .35); outline-offset: 2px; }
.pv-status { font-size: 12px; color: #6b7a75; }
.pv-empty, .pv-error { background: #fff; border: 1px solid #ece4d6; border-radius: 16px; padding: 28px 16px; text-align: center; color: #6b7a75; }
.pv-error { color: #8f2f26; background: #fbe4e1; border-color: #f0c9c4; }
.pv-del { border: 0; background: none; color: #a64a42; font-size: 16px; cursor: pointer; min-width: 28px; min-height: 28px; border-radius: 6px; }
.pv-del:hover { background: #f3dcd8; }
@media (max-width: 575.98px) {
  .pv-upload > * { flex: 1 1 100%; }
  .pv-pick { justify-content: center; }
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */

/* ---------- ≥1920: extra large monitors ---------- */
@media (min-width: 1920px) {
  .dw-page { max-width: 1840px; padding: 32px 40px 48px; gap: 24px; }
  .dw-cols { grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); gap: 24px; }
  .dw-card { padding: 22px; }
  .dw-consult { padding: 28px; }
  .dw-stat { padding: 18px 22px; }
}

/* ---------- <1440: laptop ---------- */
@media (max-width: 1439.98px) {
  .dws-sidebar { width: 232px; }
  .dw-cols { grid-template-columns: minmax(250px, 300px) minmax(0, 1fr); }
  .vitals-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- <1200: icon-only sidebar ---------- */
@media (max-width: 1199.98px) {
  .dws-sidebar { width: 76px; padding: 20px 12px; align-items: center; gap: 20px; }
  .dws-brand { font-size: 0; padding: 0; gap: 0; justify-content: center; }
  .dws-nav { width: 100%; align-items: center; }
  .dws-nav-label { display: none; }
  .dws-link { font-size: 0; gap: 0; width: 48px; padding: 0; justify-content: center; }
  .dws-toggle-row { flex-direction: column; height: auto; padding: 8px 0; gap: 6px; }
  .dws-switch { margin-left: 0; }
  .dws-topbar { padding: 12px 20px; }
  .dw-page { padding: 20px 20px 32px; }
  .dw-stats { gap: 10px; }
  .dw-stat { padding: 12px 14px; }
  .rx-row { grid-template-columns: minmax(0, 1fr) 96px 84px; grid-template-areas: "med med med" "freq days del" "switch switch switch"; }
}

/* ---------- <992: tablet — top nav, 1 column ---------- */
@media (max-width: 991.98px) {
  .dws-shell { flex-direction: column; }
  .dws-sidebar { width: 100%; height: auto; position: sticky; top: 0; flex-direction: row; align-items: center; gap: 12px; padding: 8px 16px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .dws-sidebar::-webkit-scrollbar { display: none; }
  .dws-brand { font-size: 18px; gap: 10px; flex-shrink: 0; }
  .dws-logo { width: 34px; height: 34px; }
  .dws-nav { flex-direction: row; width: auto; flex-shrink: 0; gap: 4px; }
  .dws-nav:last-child { margin-left: auto; }
  .dws-link { font-size: 14px; gap: 8px; width: auto; min-height: 40px; padding: 0 12px; }
  .dws-toggle-row { flex-direction: row; padding: 0 12px; gap: 8px; }
  .dws-switch { margin-left: 4px; }
  .dws-topbar { position: static; padding: 12px 16px; }
  .dws-crumb { display: none; }
  .dws-search { max-width: none; }

  .dw-page { padding: 16px 16px 28px; gap: 16px; }
  .dw-cols { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .dw-queue { position: static; max-height: none; overflow: visible; }
  .dw-queue .q-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); max-height: 340px; overflow-y: auto; padding: 2px; }
  .dw-queue .q-done-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 12px; }

  .rx-row { grid-template-columns: minmax(0, 1fr) 100px 92px auto 36px; grid-template-areas: "med freq days switch del"; }
}

/* ---------- <768: large phone ---------- */
@media (max-width: 767.98px) {
  /* disable iOS zoom-on-focus: inputs 16px */
  .dw-input, .rx-row .dw-input, .dws-search input { font-size: 16px; }

  .dws-profile { padding: 4px; }
  .dws-profile-text { display: none; }
  #btnPause { width: 100%; }

  .dw-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .dw-stats > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .dw-stat { padding: 12px 14px; }

  .dw-card { padding: 16px; border-radius: 16px; }
  .dw-consult { padding: 16px; gap: 16px; }
  #cBody { gap: 16px; }
  .dw-two { grid-template-columns: minmax(0, 1fr); }
  .vitals-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .rx-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 40px; grid-template-areas: "med med med" "freq days del" "switch switch switch"; padding: 12px; }
  .rx-sub { flex-wrap: wrap; }
  .rx-switch { min-width: 0; }
  .rx-del { width: 40px; height: 40px; }

  /* actions: main button on top full width, other 2 below */
  .dw-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dw-actions .dw-btn-grow { grid-column: 1 / -1; order: -1; }

  .dw-queue .q-list, .dw-queue .q-done-list { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- <576: phone ---------- */
@media (max-width: 575.98px) {
  .dws-topbar { gap: 10px; }
  .dws-search { order: 3; flex-basis: 100%; }
  .dw-page { padding: 12px 12px 24px; gap: 14px; }
  .dw-card { padding: 14px; gap: 12px; }
  .dw-consult { padding: 14px; }
  .pt-avatar { width: 42px; height: 42px; font-size: 14px; }
  .dw-empty { padding: 36px 8px; }
  .dw-hint { font-size: 11.5px; }
  .lab-box, .fu-box { padding: 10px; }
}

/* ---------- <700: phones — Dark mode / Sign out become icons so the top nav fits without scrolling ---------- */
@media (max-width: 699.98px) {
  .dws-sidebar { gap: 8px; padding: 8px 12px; }
  .dws-nav:last-child { gap: 2px; }
  .dws-nav:last-child .dws-link { font-size: 0; gap: 6px; padding: 0 8px; }
  .dws-nav:last-child .dws-switch { margin-left: 0; }
}
@media (max-width: 479.98px) {
  .dws-brand { font-size: 0; gap: 0; }
}
@media (max-width: 359.98px) {
  .dws-nav:first-of-type .dws-link { padding: 0 10px; font-size: 13px; gap: 6px; }
}

/* ---------- <360: very small phones ---------- */
@media (max-width: 359.98px) {
  .dws-brand { font-size: 0; gap: 0; }
  .dw-stat span { font-size: 11px; letter-spacing: .02em; }
  .vitals-grid { grid-template-columns: minmax(0, 1fr); }
  .dw-actions { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .dws-shell *, .rxp-body * { transition: none !important; }
  .dw-skel, .dw-stat b:empty { animation: none; }
}

/* =====================================================================
   PRINT Rx PAGE
   ===================================================================== */
.rxp-body { background: #F6F2EA; margin: 0; font-family: 'Inter', sans-serif; color: #1d2a26; }
.rxp-toolbar { max-width: 820px; margin: 20px auto 0; display: flex; justify-content: flex-end; padding: 0 16px; }
.rxp-page { max-width: 820px; margin: 12px auto 40px; background: #fff; padding: 40px; border-radius: 12px; }
.rxp-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 20px; border-bottom: 2px solid #0E4B43; padding-bottom: 16px; }
.rxp-hospital { font-family: 'Fraunces', serif; font-size: 24px; font-weight: 700; color: #0E4B43; }
.rxp-doctor { font-family: 'Fraunces', serif; font-size: 18px; font-weight: 600; }
.rxp-right { text-align: right; }
.rxp-muted { color: #5b6b66; font-size: 13px; }
.rxp-small { font-size: 11px; margin-top: 6px; }
.rxp-patient, .rxp-vitals { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 14px; padding: 12px 0; border-bottom: 1px solid #ece4d6; }
.rxp-block { margin-top: 16px; }
.rxp-label { font-size: 12px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: #5b6b66; margin-bottom: 4px; }
.rxp-text { font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.rxp-rx { font-family: 'Fraunces', serif; font-size: 28px; font-weight: 700; color: #0E4B43; margin-bottom: 6px; }
.rxp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.rxp-table th { text-align: left; font-size: 12px; color: #5b6b66; border-bottom: 1px solid #d9cfbd; padding: 8px 6px; }
.rxp-table td { border-bottom: 1px solid #f0e9dd; padding: 8px 6px; vertical-align: top; }
.rxp-mono { font-family: 'IBM Plex Mono', monospace; font-weight: 500; white-space: nowrap; }
.rxp-follow { margin-top: 20px; padding: 12px 14px; border: 1.5px solid #0E4B43; border-radius: 10px; font-size: 14px; }
.rxp-sign { margin-top: 60px; display: flex; flex-direction: column; align-items: flex-end; font-size: 14px; }
.rxp-sign-line { width: 200px; max-width: 60%; border-top: 1px solid #1d2a26; margin-bottom: 6px; }

@media (max-width: 767.98px) {
  .rxp-page { margin: 8px 8px 24px; padding: 20px 16px; }
  .rxp-head { flex-direction: column; }
  .rxp-right { text-align: left; }
  .rxp-hospital { font-size: 20px; }
  .rxp-table { display: block; overflow-x: auto; white-space: nowrap; }
  .rxp-table td:nth-child(2) { white-space: normal; min-width: 160px; }
  .rxp-sign { margin-top: 36px; }
}

@media print {
  .rxp-body { background: #fff; }
  .rxp-toolbar { display: none; }
  .rxp-page { margin: 0; padding: 0; max-width: none; border-radius: 0; }
  .rxp-table { display: table; white-space: normal; }
}

/* helpers */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.vh-file-wrap { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; }

/* =====================================================================
   DOCTOR WORKSPACE: greeting hero (time of day) + compact stat boxes
   ===================================================================== */
.dw-hero { position: relative; overflow: hidden; isolation: isolate; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px;
  padding: 24px 28px; border-radius: 20px; color: #1d2a26;
  background: linear-gradient(120deg, #FFF4DF 0%, #FCE1B4 55%, #F7C985 100%); box-shadow: 0 14px 34px -24px rgba(14, 75, 67, .45); }
.dw-hero::before, .dw-hero::after { content: ""; position: absolute; border-radius: 50%; z-index: -1; pointer-events: none; }
.dw-hero::before { width: 320px; height: 320px; right: -70px; top: -150px; background: radial-gradient(circle, rgba(255,255,255,.55), rgba(255,255,255,0) 70%); }
.dw-hero::after { width: 200px; height: 200px; left: -60px; bottom: -130px; background: radial-gradient(circle, rgba(255,255,255,.35), rgba(255,255,255,0) 70%); }
.dw-hero-art { position: absolute; right: 270px; top: 50%; transform: translateY(-50%); z-index: -1; opacity: .9; }
.dw-hero-art svg { display: block; }
.dw-hero .art { display: none; }
.dw-hero.is-morning .art-morning, .dw-hero.is-afternoon .art-afternoon, .dw-hero.is-evening .art-evening, .dw-hero.is-night .art-night { display: block; }
.dw-hero-main { min-width: 0; max-width: 640px; }
.dw-hero-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: rgba(255,255,255,.6); color: #5A4523; }
.dw-hero-chip svg { flex: none; }
.dw-hero .dw-title { margin: 10px 0 0; color: inherit; }
.dw-hero-sub { margin: 6px 0 0; font-size: 15px; color: #4A4334; }
.dw-hero #btnPause { box-shadow: 0 8px 18px -12px rgba(14, 75, 67, .6); }

.dw-hero.is-afternoon { background: linear-gradient(120deg, #EAF5F1 0%, #D3EAE2 55%, #B9DDD1 100%); }
.dw-hero.is-afternoon .dw-hero-chip { color: #1F5A50; }
.dw-hero.is-afternoon .dw-hero-sub { color: #33504A; }
.dw-hero.is-evening { color: #fff; background: linear-gradient(115deg, #0E4B43 0%, #2F5D58 48%, #B56F52 100%); }
.dw-hero.is-night { color: #fff; background: linear-gradient(130deg, #0A2230 0%, #0E3A40 55%, #0E4B43 100%); }
.dw-hero.is-evening .dw-hero-chip, .dw-hero.is-night .dw-hero-chip { background: rgba(255,255,255,.14); color: #F7E6CC; }
.dw-hero.is-evening .dw-hero-sub, .dw-hero.is-night .dw-hero-sub { color: rgba(255,255,255,.82); }
.dw-hero.is-evening .dw-btn-outline, .dw-hero.is-night .dw-btn-outline { border-color: #fff; }
.dw-hero.is-evening::before, .dw-hero.is-night::before { background: radial-gradient(circle, rgba(242,201,138,.28), rgba(242,201,138,0) 70%); }
.dw-hero.is-evening::after, .dw-hero.is-night::after { background: radial-gradient(circle, rgba(255,255,255,.1), rgba(255,255,255,0) 70%); }

/* compact stat boxes */
.dw-stats { gap: 10px; }
.dw-stat { padding: 10px 14px; border-radius: 12px; gap: 2px; }
.dw-stat span { font-size: 11px; letter-spacing: .04em; }
.dw-stat b { font-size: clamp(18px, .6vw + 14px, 24px); }
.dw-stat b:empty { width: 44px; height: 22px; }

@media (max-width: 991.98px) {
  .dw-hero-art { right: 16px; top: 14px; transform: none; opacity: .5; }
  .dw-hero-art svg { width: 90px; height: 90px; }
}
@media (max-width: 767.98px) {
  .dw-hero { padding: 20px; border-radius: 18px; }
  .dw-hero #btnPause { width: 100%; }
  .dw-hero-art { opacity: .3; }
  .dw-hero-art svg { width: 76px; height: 76px; }
}

/* =====================================================================
   DOCTOR WORKSPACE v3: visit reason, upload box, follow-up
   ===================================================================== */
.dw-page .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* visit reason */
.pt-reason { display: flex; gap: 14px; align-items: flex-start; background: #F4F9F7; color: #1d2a26; border: 1px solid #D3E6DF; border-left: 4px solid #0E4B43; border-radius: 14px; padding: 14px 16px; }
.pt-reason-ic { width: 36px; height: 36px; flex: none; border-radius: 10px; display: grid; place-items: center; background: #0E4B43; color: #fff; }
.pt-reason-ic svg { margin: 0; color: inherit; }
.pt-reason div { display: flex; flex-direction: column; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.pt-reason-label { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #2E6B61; }
.pt-reason-label em { font-style: normal; font-weight: 500; letter-spacing: 0; text-transform: none; color: #6b7a75; }
.pt-reason-text { font-size: 15.5px; line-height: 1.5; font-weight: 500; color: #1d2a26; }
.pt-reason.is-empty { background: #FAF7F1; border-color: #ECE4D6; border-left-color: #CDBFA6; }
.pt-reason.is-empty .pt-reason-ic { background: #ECE4D6; color: #8a948f; }
.pt-reason.is-empty .pt-reason-label { color: #8a948f; }
.pt-reason.is-empty .pt-reason-text { color: #6b7a75; font-weight: 400; font-style: italic; font-size: 14px; }

/* upload box */
.att-box { border: 1.5px dashed #CDBFA6; border-radius: 16px; padding: 16px; background: #FFFDF8; gap: 16px; }
.att-box.is-drag { border-color: #0E4B43; background: #EEF6F3; box-shadow: 0 0 0 4px rgba(14, 75, 67, .08); }
.att-step { display: flex; flex-direction: column; gap: 8px; }
.att-step-label { font-size: 12px; font-weight: 700; color: #4f5d58; }
.att-cats { gap: 8px; }
.att-cat { min-height: 36px; padding: 0 14px; background: #fff; border-color: #E2D7C4; }
.att-cat:hover { border-color: #0E4B43; }
.att-btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.att-pick { min-height: 72px; padding: 12px 14px; border-radius: 14px; border: 1px solid #E2D7C4; background: #fff; color: #1d2a26; transition: border-color .15s, box-shadow .15s, transform .15s; }
.att-pick:hover { border-color: #0E4B43; box-shadow: 0 8px 18px -14px rgba(14, 75, 67, .6); transform: translateY(-1px); }
.att-pick-ic { width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid !important; place-items: center; background: #EEF6F3; color: #0E4B43; }
.att-pick-cam { background: #0E4B43; border-color: #0E4B43; color: #fff; }
.att-pick-cam .att-pick-ic { background: rgba(255,255,255,.14); color: #fff; }
.att-pick-cam small { color: rgba(255,255,255,.75) !important; }
.att-pick strong { font-size: 14.5px; }
.att-drop-hint { margin: 0; text-align: center; font-size: 12.5px; color: #8a948f; }

/* uploaded files: photo tiles */
.att-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.att-item { flex-direction: column; gap: 0; padding: 0; overflow: hidden; border-radius: 14px; border-color: #ECE4D6; }
.att-thumb { width: 100%; height: auto; aspect-ratio: 4 / 3; border-radius: 0; background: #F6F2EA; }
.att-meta { padding: 8px 10px 6px; gap: 1px; width: 100%; }
.att-meta strong { font-size: 12.5px; }
.att-actions { margin-top: 4px; }
.att-none { padding: 14px; text-align: center; border-radius: 12px; background: #FAF7F1; }

/* follow-up */
.fu { display: flex; flex-direction: column; gap: 10px; }
.fu-box { border: 1px solid #D3E6DF; border-radius: 16px; padding: 16px; gap: 14px; background: #F4F9F7; }
.fu-switch { display: inline-flex; align-self: flex-start; padding: 4px; gap: 4px; border-radius: 12px; background: #fff; border: 1px solid #D3E6DF; }
.fu-opt { position: relative; cursor: pointer; }
.fu-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.fu-opt span { display: inline-flex; align-items: center; min-height: 38px; padding: 0 16px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: #4f5d58; }
.fu-opt input:checked + span { background: #0E4B43; color: #fff; }
.fu-opt input:focus-visible + span { outline: 3px solid rgba(14, 75, 67, .35); outline-offset: 2px; }
.fu-after { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.fu-after-label { font-size: 14px; font-weight: 600; color: #1d2a26; }
.fu-stepper { display: inline-flex; align-items: center; border: 1px solid #cfdcd7; border-radius: 12px; background: #fff; overflow: hidden; }
.fu-step { width: 40px; height: 44px; border: 0; background: transparent; font-size: 20px; font-weight: 600; color: #0E4B43; cursor: pointer; }
.fu-step:hover { background: #EEF6F3; }
#fuN { width: 56px; height: 44px; border: 0; border-left: 1px solid #E6EEEA; border-right: 1px solid #E6EEEA; text-align: center; font-size: 18px; font-weight: 600; color: #1d2a26; background: #fff; -moz-appearance: textfield; }
#fuN::-webkit-outer-spin-button, #fuN::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
#fuUnit { width: auto; min-width: 110px; }
.fu-eq { color: #8a948f; font-weight: 600; }
.fu-date .dw-input { width: auto; min-width: 160px; }
.fu-note { max-width: 520px; }
.fu-box.is-none .fu-after, .fu-box.is-none .fu-note { opacity: .4; pointer-events: none; }
.fu-box.is-none { background: #FAF7F1; border-color: #ECE4D6; }
.fu-box.is-none .fu-hint { color: #8a948f; }

@media (max-width: 767.98px) {
  .att-btns { grid-template-columns: minmax(0, 1fr); }
  .fu-switch { align-self: stretch; }
  .fu-opt { flex: 1; }
  .fu-opt span { width: 100%; justify-content: center; padding: 0 8px; white-space: nowrap; font-size: 13px; }
  .fu-after-label { flex-basis: 100%; }
  #fuUnit { flex: 1; }
  .fu-eq { display: none; }
  .fu-date, .fu-date .dw-input { width: 100%; }
}

/* Complete / Call next: two separate buttons */
.dw-btn-next { background: #fff; border: 1.5px solid #0E4B43; color: #0E4B43; }
.dw-btn-next:hover:not(:disabled) { background: #EEF6F3; }
.dw-btn-next:disabled { opacity: 1; background: #F6F2EA; border-color: #E2D7C4; color: #8a948f; cursor: not-allowed; }

/* Action bar: Complete + Call next always side by side in one line */
.dw-actions { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; }
.dw-main-actions { flex: 1 1 320px; display: flex; gap: 10px; min-width: 0; }
.dw-main-actions .dw-btn-grow { flex: 1 1 0; min-width: 0; order: 0; grid-column: auto; white-space: nowrap; }
.dw-main-actions .dw-btn-grow svg { flex: none; }
.nx-short { display: none; }
@media (max-width: 575.98px) {
  .dw-main-actions { flex-basis: 100%; }
  .dw-main-actions .dw-btn-grow { font-size: 14px; padding: 0 10px; gap: 6px; }
  .nx-long { display: none; }
  .nx-short { display: inline; }
}

/* "Consultation complete" popup */
.dw-modal { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; }
.dw-modal[hidden] { display: none; }
.dw-modal-backdrop { position: absolute; inset: 0; background: rgba(18, 32, 28, .45); backdrop-filter: blur(2px); animation: dw-fade .15s ease-out; }
.dw-modal-card { position: relative; width: min(420px, 100%); background: #FFFDF8; border: 1px solid #ECE4D6; border-radius: 20px; padding: 26px 24px 22px;
  box-shadow: 0 30px 60px -24px rgba(14, 75, 67, .45); display: flex; flex-direction: column; gap: 16px; font-family: Inter, system-ui, sans-serif; animation: dw-pop .18s ease-out; }
.dw-done-top { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.dw-done-ic { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: #DDEBE6; color: #0E4B43; box-shadow: 0 0 0 8px #EEF6F3; margin-bottom: 6px; }
.dw-done-top h2 { margin: 0; font-family: 'Fraunces', Georgia, serif; font-size: 24px; font-weight: 600; color: #1d2a26; }
.dw-done-top p { margin: 0; font-size: 14px; color: #6b7a75; }
.dw-done-next { border: 1px solid #D3E6DF; background: #F4F9F7; border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.dw-done-next[hidden] { display: none; }
.dw-done-label { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #2E6B61; }
.dw-done-pt { display: flex; align-items: center; gap: 12px; }
.dw-done-pt > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dw-done-pt strong { font-size: 16px; color: #1d2a26; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dw-done-pt span { font-size: 12.5px; color: #6b7a75; }
.dw-done-av { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; background: #0E4B43; color: #fff !important; font-size: 14px !important; font-weight: 700; }
.dw-done-token { font-size: 15px !important; font-weight: 600; color: #A5651A !important; }
.dw-done-empty { margin: 0; text-align: center; font-size: 14px; color: #4f5d58; background: #FAF7F1; border-radius: 12px; padding: 12px; }
.dw-done-actions { display: flex; flex-direction: column; gap: 8px; }
.dw-done-actions .dw-btn { width: 100%; min-height: 48px; font-size: 15px; }
@keyframes dw-fade { from { opacity: 0; } }
@keyframes dw-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@media (prefers-reduced-motion: reduce) { .dw-modal-backdrop, .dw-modal-card { animation: none; } }

/* Very large screens (2K / 4K at 100% scaling): scale the whole UI up so text and controls are not tiny
   zoom also scales vh units, so --vh100 (= one real screen height) is used for full-height parts. */
@media (min-width: 2200px) { html { zoom: 1.25; --vh100: 80vh; } }
@media (min-width: 3000px) { html { zoom: 1.6; --vh100: 62.5vh; } }
@media (min-width: 2200px) {
  .app, .dws-shell, .auth-wrap { min-height: var(--vh100); }
  .sidebar, .dws-sidebar, .ph-drawer { height: var(--vh100); }
  .dw-queue { max-height: calc(var(--vh100) - 104px); }
}
