:root {
    --ink: #14263a;
    --muted: #607286;
    --green: #075ea8;
    --green2: #0785bd;
    --mint: #e8f5fb;
    --cream: #fbf8ee;
    --line: #d7e3ec;
    --amber: #9a6a12;
    --brand-green: #37a94b;
    --brand-gold: #c69a35;
    --shadow: 0 16px 50px rgba(12, 70, 116, .09);
}

body {
    background: linear-gradient(180deg, #f3f9fc 0, #f8fafb 260px, #f7f8f6 100%);
}

.topbar {
    height: 78px;
    background: linear-gradient(112deg, #054d8e 0%, #0878b6 62%, #219b77 100%);
    border-bottom: 3px solid rgba(198, 154, 53, .92);
    box-shadow: 0 8px 24px rgba(5, 73, 130, .18);
}

.brand {
    gap: 13px;
}

.brand-mark {
    width: 54px;
    height: 54px;
    padding: 3px;
    overflow: hidden;
    border-radius: 15px;
    background: #fff;
    border: 1px solid rgba(255, 255, 255, .9);
    box-shadow: 0 5px 14px rgba(1, 45, 82, .24);
}

.brand-mark img {
    display: block;
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 11px;
}

.brand-name {
    display: flex;
    align-items: baseline;
    gap: 7px;
    font-size: 19px;
    letter-spacing: .01em;
}

.brand-name small {
    margin: 0;
    padding: 3px 7px;
    border: 1px solid rgba(255, 255, 255, .34);
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    color: #fff7d7;
}

.userbox small {
    color: #d9f2fb;
}

.nav a:hover,
.nav a:focus-visible {
    color: #075ea8;
    background: #e8f5fb;
}
.nav{gap:2px;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;scrollbar-color:#8aa9b7 transparent;cursor:grab;overscroll-behavior-inline:contain}
.nav::-webkit-scrollbar{display:block;height:7px}
.nav::-webkit-scrollbar-track{background:transparent}
.nav::-webkit-scrollbar-thumb{background:#8aa9b7;border-radius:999px}
.nav.is-dragging{cursor:grabbing;user-select:none;scroll-behavior:auto}
.nav.is-dragging a{pointer-events:none}
.nav a{text-transform:uppercase;font-weight:800;letter-spacing:.04em;font-size:11px;padding:12px 10px}

.page-heading h1,
.card h2,
.stat strong {
    color: #103f69;
}

.stat,
.card {
    border-color: #d6e5ee;
}

.stat {
    border-top: 3px solid #28a5c9;
}

.stat:nth-child(2) { border-top-color: #37a94b; }
.stat:nth-child(3) { border-top-color: #075ea8; }
.stat:nth-child(4) { border-top-color: #c69a35; }

.sync {
    color: #156a3c;
    background: #e5f6e8;
}

.sync span {
    background: #37a94b;
    box-shadow: 0 0 0 4px rgba(55, 169, 75, .14);
}

.btn.primary,
.tabs a.active {
    background: linear-gradient(135deg, #075ea8, #0785bd);
    border-color: #075ea8;
    box-shadow: 0 5px 13px rgba(7, 94, 168, .17);
}

input:focus,
select:focus,
textarea:focus {
    outline-color: rgba(7, 133, 189, .16);
    border-color: #0785bd;
}

.edit-card {
    border-color: #8fc9df;
    box-shadow: 0 16px 50px rgba(7, 94, 168, .12);
}

.split > *,
.table-wrap {
    min-width: 0;
    max-width: 100%;
}

.notice {
    background: #fbf8ee;
    border-left-color: #c69a35;
}

.doctor-grid { display: grid; gap: 14px; }
.doctor-profile { display: grid; grid-template-columns: 54px 1fr; gap: 15px; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: linear-gradient(145deg,#fff,#f7fbfd); }
.doctor-avatar { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 15px; background: linear-gradient(135deg,#075ea8,#219b77); color: #fff; font: 700 24px Georgia,serif; box-shadow: 0 8px 18px rgba(7,94,168,.18); }
.doctor-main { min-width: 0; }
.doctor-title { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.doctor-title h3 { margin: 0; color: #103f69; font: 700 19px Georgia,serif; }
.doctor-title p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.profile-details { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin: 16px 0 0; }
.profile-details dt { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.profile-details dd { margin: 3px 0 0; color: var(--ink); font-weight: 650; overflow-wrap: anywhere; }
.profile-photo,.profile-photo-placeholder { width: 54px; height: 54px; border-radius: 15px; object-fit: cover; display: grid; place-items: center; background: linear-gradient(135deg,#075ea8,#219b77); color:#fff; font:700 22px Georgia,serif; }
.password-field { display:flex; gap:8px; align-items:center; }
.password-field input { flex:1; }
.btn.whatsapp{background:#e8f8ef;border-color:#8bd3aa;color:#126b3a}.btn.whatsapp:hover{background:#d8f2e3;border-color:#55b981;color:#0e5930}html[data-theme="dark"] .btn.whatsapp{background:#173f31;border-color:#347653;color:#92e6bc}
.pagination{display:flex;justify-content:center;align-items:center;gap:12px;margin-top:18px;padding-top:16px;border-top:1px solid var(--line)}.pagination span{color:var(--muted);font-size:13px;font-weight:700}
.duplicate-manager{border-color:#efc9a1}.duplicate-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.duplicate-actions form{padding:16px;border:1px solid var(--line);border-radius:12px;background:#fafcfd}.duplicate-actions h3,.duplicate-actions p{margin:0}html[data-theme="dark"] .duplicate-actions form{background:#172a34}@media(max-width:720px){.duplicate-actions{grid-template-columns:1fr}}
.remote-create summary,.dispatch-editor summary{display:flex;justify-content:space-between;align-items:center;gap:12px;cursor:pointer;list-style:none}.remote-create summary::-webkit-details-marker,.dispatch-editor summary::-webkit-details-marker{display:none}.remote-create summary span{color:var(--muted);font-size:12px}.remote-create[open] summary{margin-bottom:18px}.remote-list{display:grid;gap:14px}.remote-card{padding:16px;border:1px solid var(--line);border-radius:14px;background:#fafcfd}.remote-card-head{display:flex;justify-content:space-between;gap:12px}.remote-card-head>div{display:grid}.remote-card-head span:not(.badge){color:var(--muted);font-size:12px}.remote-card dl{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:14px 0}.remote-card dt{color:var(--muted);font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.06em}.remote-card dd{margin:3px 0 0}.dispatch-editor{margin-top:14px;padding-top:12px;border-top:1px solid var(--line)}.dispatch-editor[open] summary{margin-bottom:12px}html[data-theme="dark"] .remote-card{background:#172a34}@media(max-width:720px){.remote-card dl{grid-template-columns:1fr}.remote-card-head{align-items:flex-start}}
.availability { display:inline-flex; gap:7px; align-items:center; font-weight:750; }
.availability.in { color:#16703d; }.availability.out { color:#8a3d2b; }
.staff-identity { display:flex; align-items:center; gap:10px; }
.role-tab { display:inline-flex !important; align-items:center; min-height:34px; padding:6px 12px; border:1px solid rgba(255,255,255,.42); border-radius:999px; background:rgba(255,255,255,.14); color:#fff; font-size:12px; font-weight:750; letter-spacing:.03em; text-align:center; }
.signed-in-person { display:grid !important; min-width:110px; text-align:right; line-height:1.2; }
.signed-in-person small { font-size:10px; font-weight:600; opacity:.78; }
.signed-in-person strong { max-width:210px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; }
.profile-menu-link { display:flex; align-items:center; gap:9px; padding:4px 7px; border-radius:12px; color:#fff; }
.profile-menu-link:hover { background:rgba(255,255,255,.12); }
.profile-menu-link>img,.profile-menu-link>span:first-child { width:38px; height:38px; flex:0 0 38px; border-radius:50%; object-fit:cover; border:2px solid rgba(255,255,255,.72); }
.profile-menu-link>span:first-child { display:grid; place-items:center; background:#fff; color:#075ea8; font-weight:800; }
.user-menu { position:relative; }
.user-menu-trigger { display:flex; align-items:center; gap:10px; min-width:154px; padding:6px 10px 6px 6px; border:1px solid rgba(255,255,255,.46); border-radius:999px; background:rgba(255,255,255,.12); color:#fff; font:inherit; cursor:pointer; }
.user-menu-trigger:hover,.user-menu-trigger[aria-expanded="true"] { background:rgba(255,255,255,.22); }
.user-menu-trigger img,.user-menu-avatar { width:38px; height:38px; flex:0 0 38px; border-radius:50%; object-fit:cover; border:2px solid rgba(255,255,255,.76); }
.user-menu-avatar { display:grid; place-items:center; background:#d7f3f6; color:#075463; font-weight:800; }
.user-menu-trigger strong { max-width:150px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.user-menu-chevron { margin-left:auto; font-size:12px; transition:transform .18s ease; }
.user-menu-trigger[aria-expanded="true"] .user-menu-chevron { transform:rotate(180deg); }
.user-menu-popover { position:absolute; z-index:50; top:calc(100% + 11px); right:0; width:360px; overflow:hidden; border:1px solid var(--line); border-radius:17px; background:#fff; color:var(--ink); box-shadow:0 24px 70px rgba(9,45,72,.24); }
.user-menu-identity { display:grid; padding:20px 18px 17px; border-bottom:1px solid var(--line); }
.user-menu-identity strong { font-size:17px; }
.user-menu-identity span { color:var(--muted); }
.theme-picker { padding:16px 12px; border-bottom:1px solid var(--line); }
.theme-picker>small { display:block; margin:0 0 9px; color:var(--muted); font-weight:800; letter-spacing:.05em; }
.theme-picker>div { display:grid; grid-template-columns:repeat(3,1fr); gap:4px; padding:4px; border:1px solid var(--line); border-radius:12px; background:#eef5f7; }
.theme-picker button { border:0; border-radius:9px; padding:9px 7px; background:transparent; color:#415766; font:700 13px inherit; cursor:pointer; white-space:nowrap; }
.theme-picker button.active { background:#0d7180; color:#fff; box-shadow:0 3px 10px rgba(13,113,128,.22); }
.sound-picker{padding:14px 12px;border-bottom:1px solid var(--line)}.sound-picker>small{display:block;margin:0 0 9px;color:var(--muted);font-weight:800;letter-spacing:.05em}.sound-picker>div{display:grid;grid-template-columns:repeat(4,1fr);gap:4px;padding:4px;border:1px solid var(--line);border-radius:12px;background:#eef5f7}.sound-picker button{border:0;border-radius:8px;padding:8px 4px;background:transparent;color:#415766;font:700 11px/1.2 inherit;cursor:pointer}.sound-picker button.active{background:#0d7180;color:#fff;box-shadow:0 3px 10px rgba(13,113,128,.22)}.sound-picker .sound-test{width:100%;margin-top:8px;padding:7px;border:1px solid var(--line);color:var(--brand);background:var(--white)}
.user-menu-action { display:block; padding:15px 18px; border-bottom:1px solid var(--line); font-weight:700; }
.user-menu-action:hover { background:#f2f8fa; }
.user-menu-action.danger { color:#ba302c; border:0; }
html[data-theme="dark"] { color-scheme:dark; --ink:#e5eef5; --muted:#9eb0bf; --line:#314653; --white:#14232c; --mint:#183944; --cream:#2a2b25; }
html[data-theme="dark"] body { background:#0e1920; color:var(--ink); }
html[data-theme="dark"] .card,html[data-theme="dark"] .stat,html[data-theme="dark"] .nav,html[data-theme="dark"] .auth-card,html[data-theme="dark"] .consultation-steps,html[data-theme="dark"] .user-menu-popover { background:#14232c; color:var(--ink); }
html[data-theme="dark"] input,html[data-theme="dark"] select,html[data-theme="dark"] textarea { background:#0f1d25; color:var(--ink); border-color:#3d5461; }
html[data-theme="dark"] .theme-picker>div { background:#0e1b22; }
html[data-theme="dark"] .sound-picker>div{background:#0e1b22}html[data-theme="dark"] .sound-picker button{color:#d5e3ec}html[data-theme="dark"] .sound-picker .sound-test{background:#1b303b;border-color:#49616e;color:#8fdcff}
html[data-theme="dark"] .user-menu-action:hover,html[data-theme="dark"] .nav a:hover { background:#1b333d; }
@media(prefers-color-scheme:dark){html[data-theme="auto"]{color-scheme:dark;--ink:#e5eef5;--muted:#9eb0bf;--line:#314653;--white:#14232c;--mint:#183944;--cream:#2a2b25}html[data-theme="auto"] body{background:#0e1920;color:var(--ink)}html[data-theme="auto"] .card,html[data-theme="auto"] .stat,html[data-theme="auto"] .nav,html[data-theme="auto"] .auth-card,html[data-theme="auto"] .consultation-steps,html[data-theme="auto"] .user-menu-popover{background:#14232c;color:var(--ink)}html[data-theme="auto"] input,html[data-theme="auto"] select,html[data-theme="auto"] textarea{background:#0f1d25;color:var(--ink);border-color:#3d5461}html[data-theme="auto"] .theme-picker>div{background:#0e1b22}html[data-theme="auto"] .user-menu-action:hover,html[data-theme="auto"] .nav a:hover{background:#1b333d}}
@media(prefers-color-scheme:dark){html[data-theme="auto"] .sound-picker>div{background:#0e1b22}html[data-theme="auto"] .sound-picker button{color:#d5e3ec}html[data-theme="auto"] .sound-picker .sound-test{background:#1b303b;border-color:#49616e;color:#8fdcff}}
html[data-theme="dark"] :is(.page-heading p,.muted,label small,.privacy,.footer,.doctor-title p,.profile-details dt,.user-menu-identity span,.theme-picker>small){color:#b6c6d2}
html[data-theme="dark"] :is(.nav a,.consultation-steps a,.theme-picker button){color:#d5e3ec}
html[data-theme="dark"] :is(.btn,.tabs a){background:#1b303b;color:#e8f2f7;border-color:#49616e}
html[data-theme="dark"] .btn.primary{background:#087fb3;color:#fff;border-color:#28a5c9}
html[data-theme="dark"] .btn.danger{background:#3b2426;color:#ffb9b9;border-color:#744044}
html[data-theme="dark"] :is(.doctor-profile,.consultation-summary,.case-sections details){background:#172a34;color:#e8f2f7}
html[data-theme="dark"] :is(.data-table td,.data-table th,.summary-row,.user-menu-identity,.theme-picker,.user-menu-action){border-color:#314b58}
html[data-theme="dark"] .data-table th{color:#b7c9d4}
html[data-theme="dark"] :is(.badge,.badge.pending,.badge.waiting){background:#493b1f;color:#ffd98b}
html[data-theme="dark"] :is(.badge.paid,.badge.completed,.badge.waived){background:#173f31;color:#92e6bc}
html[data-theme="dark"] .badge.in-consultation{background:#20385a;color:#a9c9ff}
html[data-theme="dark"] .badge.free{background:#3d2e58;color:#d7baff}
html[data-theme="dark"] .notice{background:#342f22;color:#ffe2a1;border-color:#b88b39}
html[data-theme="dark"] .flash.success{background:#173b2b;color:#a8ecc5;border-color:#347653}
html[data-theme="dark"] .flash.error{background:#492526;color:#ffbabb;border-color:#985052}
html[data-theme="dark"] .queue-alert{background:#3b311b;color:#ffe0a0}
html[data-theme="dark"] .review-callout{background:#173b2b;color:#b3edca}
html[data-theme="dark"] .review-callout span{color:#a0cfb3}
html[data-theme="dark"] .step-number{background:#203d4b;color:#8ed9ee}
html[data-theme="dark"] input:disabled,html[data-theme="dark"] select:disabled{background:#263640;color:#aebdc6;opacity:1}
html[data-theme="dark"] ::placeholder{color:#8296a3;opacity:1}
html[data-theme="dark"] .sync{background:#183b35;color:#9fe0c1}
html[data-theme="dark"] :is(.page-heading h1,.card h2,.stat strong){color:#7ddcff}
html[data-theme="dark"] :is(.card h3,.name,.doctor-title h3){color:#eaf5fb}
html[data-theme="dark"] a:not(.btn):not(.brand):not(.user-menu-action){color:#8fdcff}
@media(prefers-color-scheme:dark){html[data-theme="auto"] :is(.page-heading p,.muted,label small,.privacy,.footer,.doctor-title p,.profile-details dt,.user-menu-identity span,.theme-picker>small){color:#b6c6d2}html[data-theme="auto"] :is(.nav a,.consultation-steps a,.theme-picker button){color:#d5e3ec}html[data-theme="auto"] :is(.btn,.tabs a){background:#1b303b;color:#e8f2f7;border-color:#49616e}html[data-theme="auto"] :is(.doctor-profile,.consultation-summary,.case-sections details){background:#172a34;color:#e8f2f7}html[data-theme="auto"] :is(.data-table td,.data-table th,.summary-row,.user-menu-identity,.theme-picker,.user-menu-action){border-color:#314b58}html[data-theme="auto"] .data-table th{color:#b7c9d4}html[data-theme="auto"] :is(.badge,.badge.pending,.badge.waiting){background:#493b1f;color:#ffd98b}html[data-theme="auto"] :is(.badge.paid,.badge.completed,.badge.waived){background:#173f31;color:#92e6bc}html[data-theme="auto"] .badge.in-consultation{background:#20385a;color:#a9c9ff}html[data-theme="auto"] .badge.free{background:#3d2e58;color:#d7baff}html[data-theme="auto"] .notice{background:#342f22;color:#ffe2a1;border-color:#b88b39}html[data-theme="auto"] .flash.success{background:#173b2b;color:#a8ecc5;border-color:#347653}html[data-theme="auto"] .flash.error{background:#492526;color:#ffbabb;border-color:#985052}html[data-theme="auto"] .queue-alert{background:#3b311b;color:#ffe0a0}html[data-theme="auto"] .review-callout{background:#173b2b;color:#b3edca}html[data-theme="auto"] .review-callout span{color:#a0cfb3}html[data-theme="auto"] .step-number{background:#203d4b;color:#8ed9ee}html[data-theme="auto"] input:disabled,html[data-theme="auto"] select:disabled{background:#263640;color:#aebdc6;opacity:1}html[data-theme="auto"] ::placeholder{color:#8296a3;opacity:1}html[data-theme="auto"] .sync{background:#183b35;color:#9fe0c1}}
@media(prefers-color-scheme:dark){html[data-theme="auto"] .btn.primary{background:#087fb3;color:#fff;border-color:#28a5c9}html[data-theme="auto"] .btn.danger{background:#3b2426;color:#ffb9b9;border-color:#744044}}
@media(prefers-color-scheme:dark){html[data-theme="auto"] :is(.page-heading h1,.card h2,.stat strong){color:#7ddcff}html[data-theme="auto"] :is(.card h3,.name,.doctor-title h3){color:#eaf5fb}html[data-theme="auto"] a:not(.btn):not(.brand):not(.user-menu-action){color:#8fdcff}}
.profile-page-grid { display:grid; grid-template-columns:340px minmax(0,1fr); gap:22px; align-items:start; }
.profile-overview { position:sticky; top:18px; text-align:center; }
.profile-hero-photo,.profile-hero-placeholder { width:132px; height:132px; margin:0 auto 14px; border-radius:50%; object-fit:cover; border:5px solid #e4f2f6; box-shadow:0 10px 30px rgba(7,94,168,.16); }
.profile-hero-placeholder { display:grid; place-items:center; background:linear-gradient(145deg,#075ea8,#1597ac); color:#fff; font:700 52px Georgia,serif; }
.profile-overview h2 { margin-bottom:8px; }
.profile-overview .profile-details { margin-top:22px; text-align:left; }
.profile-bio { margin-top:18px; padding-top:16px; border-top:1px solid var(--line); text-align:left; color:var(--muted); }
.profile-workspace{display:grid;grid-template-columns:minmax(260px,320px) minmax(0,1fr);gap:20px;align-items:start}.profile-workspace .profile-overview{position:sticky;top:18px;padding:22px;text-align:left}.profile-workspace .profile-hero-photo,.profile-workspace .profile-hero-placeholder{width:88px;height:88px;margin:0 0 14px;border-width:4px;font-size:34px}.profile-identity{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.profile-identity h2{margin:0;font-size:24px}.profile-facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 16px;margin:20px 0 0}.profile-facts dt{color:var(--muted);font-size:10px;font-weight:800;letter-spacing:.07em;text-transform:uppercase}.profile-facts dd{margin:4px 0 0;color:var(--ink);font-weight:650;overflow-wrap:anywhere}.profile-facts>div:nth-child(3){grid-column:1/-1}.profile-facts .badge{font-size:9px;padding:3px 7px}.profile-editor{padding:0;overflow:hidden}.profile-tabs{display:flex;gap:4px;padding:8px;border-bottom:1px solid var(--line);background:#f5f9fa}.profile-tabs button{min-height:40px;padding:9px 16px;border:0;border-radius:9px;background:transparent;color:var(--muted);font-weight:750;cursor:pointer}.profile-tabs button[aria-selected="true"]{background:#fff;color:var(--brand);box-shadow:0 2px 10px rgba(24,56,72,.1)}.profile-editor>[role="tabpanel"]{padding:22px}.section-heading{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:18px}.section-heading h2,.section-heading p{margin:0}.section-heading p{margin-top:4px}.compact-profile-form{display:grid;gap:15px}.compact-profile-form textarea{min-height:82px}.compact-profile-form .verified-email-control{margin:0;padding:12px 14px}.verified-email-control small{display:block;color:var(--muted);font-size:9px;font-weight:800;letter-spacing:.08em}.profile-photo-control{padding:12px 14px;border:1px dashed var(--line);border-radius:12px;background:#fafcfd}.profile-photo-control label{margin:0}.form-actions{display:flex;justify-content:flex-end;padding-top:2px}.form-actions .btn{min-width:150px}.security-status{padding:7px 10px;border-radius:99px;background:#e7f7ef;color:#16734a;font-size:12px;font-weight:750;white-space:nowrap}html[data-theme="dark"] :is(.profile-tabs,.profile-photo-control){background:#142731}html[data-theme="dark"] .profile-tabs button[aria-selected="true"]{background:#203843;color:#8ed9ee}html[data-theme="dark"] .security-status{background:#173f31;color:#92e6bc}
.password-card { max-width:620px; margin-inline:auto; }
.google-signin{background:#fff;color:#263238;border-color:#c8d3d8}.google-signin[aria-disabled="true"]{opacity:.55;cursor:not-allowed}.google-signin span{display:grid;place-items:center;width:23px;height:23px;border-radius:50%;color:#4285f4;font-size:18px;font-weight:900}.login-divider{display:flex;align-items:center;gap:10px;color:var(--muted);font-size:11px;text-align:center}.login-divider:before,.login-divider:after{content:"";height:1px;flex:1;background:var(--line)}html[data-theme="dark"] .google-signin{background:#1b303b;color:#edf6fa;border-color:#49616e}
.account-summary { display:flex; align-items:center; gap:12px; padding-bottom:16px; border-bottom:1px solid var(--line); }
.account-summary div { display:grid; }
.account-summary small { color:var(--muted); }
.verified-email-control{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:14px;border:1px solid var(--line);border-radius:12px}.verified-email-control>div{display:grid}.verified-email-control>div span{color:var(--muted);font-size:13px}
.delete-profile-form { display:flex; align-items:center; gap:7px; flex-wrap:wrap; }
.delete-profile-form input[type="password"] { width:150px; min-height:34px; padding:7px 9px; font-size:12px; }
.doctor-controls { display:grid; grid-template-columns:1fr auto; align-items:center; gap:16px; }
.doctor-controls .actions { grid-column:1/-1; align-items:center; }
.doctor-controls .actions form { display:flex; align-items:center; margin:0; }
.control-status { display:flex; align-items:center; gap:10px; }
.pause-form { display:flex; gap:8px; flex:1; max-width:560px; }
.pause-form input { flex:1; min-height:52px; }
.doctor-controls .actions .btn { min-height:52px; white-space:nowrap; }
.queue-alert { display:flex; justify-content:space-between; align-items:flex-start; gap:18px; padding:18px 20px; margin-bottom:20px; border:2px solid #d69423; border-radius:15px; background:#fff4d8; color:#663e08; box-shadow:0 14px 35px rgba(154,91,10,.16); }
.queue-alert strong { font-size:18px; }
.queue-alert p { margin:5px 0 0; }
.emergency-toggle{display:flex;grid-column:1/-1;grid-template-columns:auto 1fr;align-items:flex-start;gap:12px;padding:15px 16px;border:2px solid #efb0b0;border-radius:13px;background:#fff5f5;color:#7d1f1f;cursor:pointer}.emergency-toggle input{width:20px;height:20px;margin:2px 0 0;accent-color:#c62828}.emergency-toggle span{display:grid;gap:2px}.emergency-toggle strong{font-size:15px}.emergency-toggle small{color:#8f4747}.emergency-alert,.emergency-visit-notice{display:flex;justify-content:space-between;align-items:flex-start;gap:18px;padding:17px 20px;margin-bottom:20px;border:2px solid #cf3f3f;border-radius:15px;background:#fff0f0;color:#7f1d1d;box-shadow:0 14px 35px rgba(151,28,28,.14)}.emergency-alert strong,.emergency-visit-notice strong{font-size:18px}.emergency-alert p{margin:5px 0 0}.emergency-visit-notice span{margin-left:auto}.badge.emergency{background:#c62828;color:#fff}.emergency-row{background:#fff7f7}
.patient-progress{margin:0 0 20px;padding:20px;border:1px solid var(--line);border-radius:16px;background:var(--white);box-shadow:var(--shadow)}.patient-progress-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:14px}.patient-progress-head h2,.patient-progress-head p{margin:0}.patient-progress-head h2{font:700 21px/1.25 Georgia,serif}.patient-progress-head p{margin-top:4px;color:var(--muted);font-size:13px}.patient-counter-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.patient-counter{padding:14px 15px;border:1px solid var(--line);border-top:4px solid #168ab5;border-radius:13px;background:#f9fcfd}.patient-counter>small{display:block;margin-bottom:10px;color:var(--muted);font-size:11px;font-weight:800;letter-spacing:.06em;text-transform:uppercase}.patient-counter>div{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}.patient-counter span{display:grid}.patient-counter span+span{padding-left:10px;border-left:1px solid var(--line)}.patient-counter strong{color:var(--ink);font:800 27px/1 Georgia,serif}.patient-counter em{margin-top:4px;color:var(--muted);font-size:11px;font-style:normal}.patient-counter.emergency{border-color:#e9a4a4;border-top-color:#cf3131;background:#fff3f3}.patient-counter.emergency>small,.patient-counter.emergency strong{color:#a51f1f}.patient-counter.regular{border-top-color:#2ca76b}.patient-counter.remote{border-top-color:#7257c7}
html[data-theme="dark"] :is(.emergency-toggle,.emergency-alert,.emergency-visit-notice){background:#431f22;color:#ffc4c4;border-color:#a94a50}html[data-theme="dark"] .emergency-toggle small{color:#e9a9ad}html[data-theme="dark"] .emergency-row{background:#321d20}
html[data-theme="dark"] .patient-progress{background:#14232c}html[data-theme="dark"] .patient-counter{background:#172a34}html[data-theme="dark"] .patient-counter.emergency{background:#431f22;border-color:#a94a50}html[data-theme="dark"] .patient-counter.emergency>small,html[data-theme="dark"] .patient-counter.emergency strong{color:#ffb2b7}
@media(prefers-color-scheme:dark){html[data-theme="auto"] :is(.emergency-toggle,.emergency-alert,.emergency-visit-notice){background:#431f22;color:#ffc4c4;border-color:#a94a50}html[data-theme="auto"] .emergency-toggle small{color:#e9a9ad}html[data-theme="auto"] .emergency-row{background:#321d20}}
@media(prefers-color-scheme:dark){html[data-theme="auto"] .patient-progress{background:#14232c}html[data-theme="auto"] .patient-counter{background:#172a34}html[data-theme="auto"] .patient-counter.emergency{background:#431f22;border-color:#a94a50}html[data-theme="auto"] .patient-counter.emergency>small,html[data-theme="auto"] .patient-counter.emergency strong{color:#ffb2b7}}
@media(max-width:900px){.patient-counter-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:520px){.patient-progress{padding:15px}.patient-progress-head{align-items:flex-start}.patient-counter-grid{grid-template-columns:1fr}.patient-counter{padding:13px 14px}}
.outstanding-balance-alert{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin:0 0 18px;padding:15px 17px;border:2px solid #d79226;border-radius:13px;background:#fff7df;color:#70420a}.outstanding-balance-alert[hidden]{display:none}.outstanding-balance-alert>div:first-child{display:grid;gap:3px}.outstanding-balance-alert span{font-size:12px}.emergency-fee-note{display:flex;align-items:center;gap:8px}.billing-fee-field{max-width:440px}.billing-settings-actions{display:flex;justify-content:flex-end;padding-top:2px}.billing-settings-actions .btn{min-width:120px}.partial-collection-form input[name="collection_amount"]{font-size:18px;font-weight:800}
html[data-theme="dark"] .outstanding-balance-alert{background:#3c311a;color:#ffe1a1;border-color:#a97b2f}@media(prefers-color-scheme:dark){html[data-theme="auto"] .outstanding-balance-alert{background:#3c311a;color:#ffe1a1;border-color:#a97b2f}}
@media(max-width:620px){.outstanding-balance-alert{flex-direction:column}.outstanding-balance-alert .row-actions{width:100%}.emergency-fee-note{align-items:flex-start;flex-direction:column}}
.history-list { display:grid; gap:14px; }
.history-item { padding:16px 0; border-bottom:1px solid var(--line); }
.history-item:last-child { border-bottom:0; }
.history-item>div { display:flex; justify-content:space-between; gap:12px; }
.history-item p { margin:7px 0; }
.consultation-summary { display:flex; align-items:center; gap:18px; flex-wrap:wrap; padding:12px 16px; margin-bottom:18px; border:1px solid var(--line); border-radius:14px; background:#fff; }
.consultation-steps { position:sticky; top:0; z-index:5; display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:6px; padding:7px; margin-bottom:18px; border:1px solid var(--line); border-radius:14px; background:rgba(255,255,255,.96); box-shadow:0 8px 24px rgba(7,94,168,.08); }
.consultation-steps a { display:flex; align-items:center; justify-content:center; min-height:50px; padding:8px 6px; border-radius:9px; text-align:center; white-space:nowrap; line-height:1.2; font-size:clamp(.78rem,1.2vw,1rem); font-weight:700; color:#31516b; }
.consultation-steps a:hover { background:#e8f6fa; color:#075ea8; }
.consultation-workspace { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; align-items:start; }
.consultation-workspace>.card { margin:0; padding:18px; scroll-margin-top:80px; }
.consultation-workspace #prescribe,.consultation-workspace .patient-history-panel,.consultation-workspace .repertory-panel { grid-column:1/-1; }
.consultation-workspace .patient-history-panel{grid-row:1}
.consultation-workspace .patient-history-panel{display:none}
.consultation-workspace .follow-up-panel{grid-column:1/-1;grid-row:6;padding-top:14px;padding-bottom:14px}
.follow-up-controls{display:grid;grid-template-columns:minmax(220px,1fr) minmax(220px,1fr) auto;gap:12px;align-items:end}
.follow-up-controls label{margin:0}
.follow-up-controls>[hidden]{display:none}
.follow-up-controls>span{margin-bottom:11px;white-space:nowrap}
.consultation-workspace #symptoms{grid-column:1;grid-row:2}
.consultation-workspace #investigations{grid-column:1;grid-row:3}
.consultation-workspace #case-taking{grid-column:2;grid-row:2/span 2;align-self:stretch;box-sizing:border-box}
.consultation-workspace .repertory-panel{grid-row:4}
.consultation-workspace #prescribe{grid-row:5}
.consultation-workspace .card-head{margin-bottom:12px}
.consultation-workspace .card-head h2{margin-bottom:2px}
.consultation-workspace .card-head p{margin:2px 0 0}
.consultation-workspace #symptoms textarea{min-height:78px}
.consultation-workspace .investigation-row{gap:9px;padding:10px 0}
.consultation-workspace .investigation-row textarea{min-height:70px}
.consultation-workspace #case-taking{display:flex;flex-direction:column;padding-bottom:14px}
.consultation-workspace #case-taking>label:last-child{flex:1;display:flex;flex-direction:column}
.consultation-workspace #case-taking>label:last-child textarea{flex:1;min-height:62px}
.consultation-workspace #case-taking .case-sections{gap:6px;margin-bottom:9px}
.consultation-workspace #case-taking .case-sections summary{padding:8px 11px;font-size:.9rem;line-height:1.2}
.consultation-workspace #case-taking .case-sections textarea{width:calc(100% - 18px);margin:0 9px 8px;min-height:60px;padding:8px 10px}
.consultation-workspace #case-taking>label{margin-top:7px;gap:4px}
.consultation-workspace #case-taking>label textarea{min-height:62px;padding:8px 10px}
.history-medicines ul { margin:6px 0 10px; padding-left:22px; }
.case-sections { display:grid; gap:10px; margin-bottom:16px; }
.case-sections details { border:1px solid var(--line); border-radius:11px; background:#f8fbfc; }
.case-sections summary { cursor:pointer; padding:12px 14px; font-weight:700; color:#214f64; }
.case-sections textarea { width:calc(100% - 24px); margin:0 12px 12px; min-height:105px; }
.rubric-row { display:grid; grid-template-columns:minmax(0,1fr) 180px auto; gap:12px; align-items:end; padding:12px 0; border-bottom:1px solid var(--line); }
.review-callout { display:flex; gap:10px; align-items:center; margin-top:20px; padding:13px 15px; border-radius:11px; background:#eaf7ee; color:#215e3d; }
.review-callout span { color:#46725a; }
.consultation-draft-notice{display:flex;align-items:center;gap:12px;margin:0 0 14px;background:#edf5ff;border-color:#91b8e7;color:#244f7d}
.consultation-draft-notice span{color:#526d87}
.consultation-save-actions{position:sticky;bottom:10px;z-index:3;padding:12px;border:1px solid var(--line);border-radius:13px;background:rgba(255,255,255,.94);box-shadow:0 10px 28px rgba(15,55,76,.12);backdrop-filter:blur(8px)}
html[data-theme="dark"] .consultation-draft-notice{background:#1c3448;color:#b8dcff;border-color:#3c678a}
html[data-theme="dark"] .consultation-draft-notice span{color:#a9bfd1}
html[data-theme="dark"] .consultation-save-actions{background:rgba(23,42,52,.94)}
.medicine-row { grid-template-columns:1.4fr .7fr .9fr .9fr 1fr .8fr 1.3fr auto; }
.step-number { display:grid; place-items:center; width:34px; height:34px; border-radius:50%; background:#e3f4f8; color:#075ea8; font-weight:800; }
.case-notes { min-height:210px; }
.investigation-row { display:grid; grid-template-columns:1fr 1.2fr 1fr; gap:12px; padding:14px 0; border-bottom:1px solid var(--line); }
.investigation-row .span-2 { grid-column:span 2; }
.investigation-row>button { align-self:end; margin-bottom:4px; }
.prescription-charges { margin-top:20px; padding-top:18px; border-top:1px solid var(--line); }
.collection-panels { margin-top:20px; }
.prescription-body { background:#edf4f6; }
.print-toolbar { max-width:794px; margin:24px auto 12px; display:flex; justify-content:flex-end; gap:10px; }
.prescription-sheet { width:min(794px,calc(100% - 28px)); min-height:1123px; margin:0 auto 30px; padding:64px 72px; background:#fff; color:#1d2d35; box-shadow:0 18px 60px rgba(24,53,65,.14); }
.rx-header { display:grid; grid-template-columns:minmax(0,1fr) minmax(180px,28%); align-items:start; gap:18px; padding-bottom:6px; border-bottom:2px solid var(--rx-accent,#176c7d); }
.rx-brand-images { display:flex; align-items:center; gap:16px; }
.rx-header .rx-round-logo { width:82px; height:82px; flex:0 0 82px; border-radius:14px; object-fit:cover; }
.rx-header .rx-wordmark { width:min(590px,calc(100% - 98px)); height:112px; object-fit:contain; object-position:left center; }
.rx-header-details { align-self:start; padding-top:10px; text-align:right; }
.rx-header-details p:last-child{margin-top:8px;color:var(--rx-accent,#155b6a);font-size:14px;line-height:1.35}.rx-header-details p:last-child strong{font-size:16px}
.rx-header h1 { margin:0 0 8px; color:var(--rx-accent,#155b6a); font:700 25px Georgia,serif; text-transform:uppercase; }
.rx-header-details h1,.preview-head h3 { display:none; }
.settings-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(360px,.75fr); gap:22px; align-items:start; }
.check-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; }
.check { display:flex; align-items:center; gap:8px; padding:10px; border:1px solid var(--line); border-radius:10px; }
.check input { width:auto; }
.format-preview { position:sticky; top:18px; min-height:600px; background:#fff; }
.preview-label{display:flex;align-items:center;justify-content:space-between}.preview-label>span{padding:4px 8px;border-radius:99px;background:#e7f3f6;color:#155b6a;font-size:10px;font-weight:800}.format-preview.preview-paper-a5{width:78%;justify-self:center}.preview-patient>div{display:grid;gap:3px}.preview-patient small{color:#65767e;font-size:11px}.preview-identifiers{text-align:right}.preview-identifiers span{display:block}.preview-identifiers [data-preview-toggle-target="show_appointment_id"],.check:has([data-preview-toggle="show_appointment_id"]){display:none!important}.preview-follow-up{margin-top:28px;padding-top:10px;border-top:1px solid #ccd7da;color:#334d57}
.custom-block-builder{margin-top:10px;padding-top:20px;border-top:1px solid var(--line)}.custom-block-row{display:grid;gap:12px;margin:12px 0;padding:14px;border:1px solid var(--line);border-radius:12px;background:#f8fbfc}.custom-block-head{display:flex;align-items:center;justify-content:space-between;gap:10px}.custom-block-row textarea{min-height:76px}.preview-custom-block,.rx-custom-block{margin:16px 0;padding:10px 12px;border-left:3px solid var(--preview-accent,var(--rx-accent,#155b6a));background:#f4f8f9}.preview-custom-block strong,.rx-custom-block strong{display:block;color:var(--preview-accent,var(--rx-accent,#155b6a))}.preview-custom-block p,.rx-custom-block p{margin:4px 0 0;white-space:pre-line;font-size:12px}html[data-theme="dark"] .custom-block-row{background:#172a34}
.layout-order-builder{margin-top:20px;padding-top:20px;border-top:1px solid var(--line)}.layout-section-list{display:grid;gap:8px;margin-top:12px}.layout-section-item{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:10px;padding:11px 12px;border:1px solid var(--line);border-radius:11px;background:#f8fbfc;cursor:grab}.layout-section-item:active{cursor:grabbing}.layout-section-item.is-dragging{opacity:.45;border-color:var(--brand)}.drag-handle{border:0;background:transparent;color:var(--brand);font-size:24px;line-height:1;cursor:grab;touch-action:none}.format-preview>:is([data-preview-section="header"],[data-preview-section="medicines"],[data-preview-section="footer"]){display:block}html[data-theme="dark"] .layout-section-item{background:#172a34}
.format-preview>small { color:#71828a; letter-spacing:.1em; }
.preview-head { display:grid; grid-template-columns:minmax(0,1fr) minmax(130px,34%); align-items:start; gap:12px; margin:24px 0 16px; padding-bottom:6px; border-bottom:2px solid var(--preview-accent); }
.preview-brand-images { display:flex; align-items:center; gap:10px; }
.preview-brand-images .preview-round-logo { width:54px; height:54px; flex:0 0 54px; border-radius:10px; object-fit:cover; }
.preview-brand-images .preview-wordmark { width:calc(100% - 64px); height:78px; object-fit:contain; object-position:left center; }
.preview-head h3 { color:var(--preview-accent); text-transform:uppercase; }
.preview-head p { margin:2px 0; font-size:12px; color:#65767e; }
.preview-head>div:last-child{padding-top:6px;text-align:right}.preview-head>div:last-child p:last-child{margin-top:7px;color:var(--preview-accent);font-size:11px;line-height:1.35}.preview-head>div:last-child p:last-child strong{font-size:13px}
.paper-a5 .rx-header{grid-template-columns:minmax(0,1fr) minmax(145px,31%);gap:12px}.paper-a5 .rx-header-details{padding-top:5px}.paper-a5 .rx-header-details p:last-child strong{font-size:14px}
.preview-patient { display:flex; justify-content:space-between; padding:10px 0; border-bottom:1px solid #ccd7da; }
.preview-rx { margin:22px 0 8px; color:var(--preview-accent); font-size:34px; }
.format-preview li span { display:block; color:#5e6e75; }
.format-preview footer { margin-top:220px; padding-top:12px; border-top:1px solid #d8e0e2; text-align:center; font-size:11px; color:#718087; }
.paper-a5 .prescription-sheet { width:min(559px,calc(100% - 28px)); min-height:794px; padding:42px; }
.rx-header p { margin:0; }
.rx-patient { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:start; gap:5px 20px; padding:18px 0; border-bottom:1px solid #a9bcc2; }
.rx-patient>div{display:grid;gap:3px}.rx-patient small { color:#52666e;font-weight:400 }.rx-patient-uhid{text-align:right;white-space:nowrap}
.rx-symbol { margin:24px 0 10px; font:700 30px Georgia,serif; }
.rx-list { display:grid; gap:22px; padding-left:28px; }
.rx-list li { padding-left:8px; }
.rx-list strong,.rx-list span { display:block; }
.rx-list strong { font-size:18px; color:#173f48; }
.rx-footer { margin-top:80px; padding-top:18px; border-top:1px solid #a9bcc2; text-align:center; font-size:12px; color:#5b6d73; }

/* Appointment calendar and clinic performance */
.appointment-toolbar{display:flex;justify-content:space-between;align-items:center;gap:14px;margin-bottom:18px}.view-switch{display:flex;padding:4px;border:1px solid var(--line);border-radius:12px;background:var(--white)}.view-switch a{padding:9px 18px;border-radius:9px;font-weight:750;color:var(--muted)}.view-switch a.active{background:#0d7180;color:#fff}.date-nav,.date-nav form{display:flex;align-items:center;gap:8px}.date-nav input{min-width:170px}.performance-stats{margin-bottom:20px}.performance-grid{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(280px,.7fr);gap:20px}.trend-chart{height:220px;display:flex;align-items:stretch;gap:4px;padding:15px 4px 0;border-bottom:1px solid var(--line)}.trend-chart a{height:100%;min-width:5px;flex:1;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:7px}.trend-chart a span{width:100%;max-width:22px;min-height:3px;border-radius:6px 6px 2px 2px;background:linear-gradient(180deg,#18a2bb,#075ea8);transition:.18s}.trend-chart a:hover span{filter:brightness(1.18);transform:translateY(-2px)}.trend-chart small{font-size:9px;color:var(--muted)}.status-card{display:grid;align-content:start}.status-visual{display:grid;grid-template-columns:140px 1fr;align-items:center;gap:20px;margin-top:22px}.donut{width:140px;height:140px;border-radius:50%;display:grid;place-items:center;position:relative}.donut:after{content:"";position:absolute;inset:25px;border-radius:50%;background:var(--white)}.donut>span{z-index:1;display:grid;text-align:center;font:800 24px Georgia,serif}.donut small{font:500 10px Inter,sans-serif;color:var(--muted);text-transform:uppercase}.status-visual ul{display:grid;gap:10px;margin:0;padding:0;list-style:none}.status-visual li{display:grid;grid-template-columns:10px 1fr auto;align-items:center;gap:7px;font-size:12px}.status-visual li>span{width:9px;height:9px;border-radius:50%}.status-completed>span{background:#27a669}.status-active>span{background:#1a8dbe}.status-cancelled>span{background:#d49a27}.status-no-show>span{background:#cf5151}.month-calendar{overflow:auto}.weekday-row,.calendar-grid{min-width:760px;display:grid;grid-template-columns:repeat(7,1fr)}.weekday-row strong{padding:8px;text-align:center;color:var(--muted);font-size:11px;text-transform:uppercase}.calendar-day{min-height:116px;padding:10px;border:1px solid var(--line);margin:-1px 0 0 -1px;background:var(--white)}.calendar-day:not(.outside):hover{position:relative;background:#eef8fa;border-color:#64b7c6}.calendar-day b{display:grid;place-items:center;width:27px;height:27px;border-radius:50%}.calendar-day.today b{background:#0d7180;color:#fff}.calendar-day span{display:block;margin-top:13px;padding:7px;border-radius:8px;background:#e5f4f7;color:#0b6170;font-size:11px;font-weight:750}.calendar-day.outside{background:transparent}.day-timeline{display:grid}.day-timeline article{display:grid;grid-template-columns:110px minmax(220px,1fr) auto auto;gap:14px;align-items:center;padding:14px 4px;border-top:1px solid var(--line)}.day-timeline time{color:#0d7180;font-weight:800}.day-timeline article>div{display:grid}.day-timeline article>div span{color:var(--muted);font-size:12px}
html[data-theme="dark"] :is(.view-switch,.calendar-day){background:#14232c}html[data-theme="dark"] .calendar-day:not(.outside):hover{background:#1b3540}html[data-theme="dark"] .calendar-day span{background:#153843;color:#8fe3ef}html[data-theme="dark"] .donut:after{background:#14232c}html[data-theme="dark"] .day-timeline time{color:#7ddcff}
@media(prefers-color-scheme:dark){html[data-theme="auto"] :is(.view-switch,.calendar-day){background:#14232c}html[data-theme="auto"] .calendar-day:not(.outside):hover{background:#1b3540}html[data-theme="auto"] .calendar-day span{background:#153843;color:#8fe3ef}html[data-theme="auto"] .donut:after{background:#14232c}html[data-theme="auto"] .day-timeline time{color:#7ddcff}}

@media (max-width: 600px) {
    .topbar { height: 70px; }
    .brand-mark { width: 46px; height: 46px; border-radius: 13px; }
    .brand-mark img { width: 40px; height: 40px; border-radius: 9px; }
    .brand-name { font-size: 16px; }
    .brand-name small { font-size: 9px; padding: 2px 5px; }
    .doctor-profile { grid-template-columns: 44px 1fr; padding: 14px; }
    .doctor-avatar { width: 44px; height: 44px; border-radius: 12px; font-size: 20px; }
    .profile-details { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .userbox { gap:7px; }
    .profile-menu-link .signed-in-person { display:none !important; }
    .user-menu-trigger { min-width:0; }
    .user-menu-trigger strong { display:none; }
    .user-menu-popover { position:fixed; top:72px; right:10px; width:min(360px,calc(100vw - 20px)); }
    .userbox .signed-in-person { display:grid !important; min-width:0; }
    .signed-in-person small { display:none; }
    .signed-in-person strong { max-width:120px; font-size:11px; }
    .userbox .role-tab { display:inline-flex !important; padding:6px 9px; font-size:10px; }
    .doctor-controls { grid-template-columns:1fr; }
    .doctor-controls .actions { grid-column:auto; }
    .pause-form { flex-direction:column; }
    .queue-alert,.emergency-alert,.emergency-visit-notice { flex-direction:column; }
    .consultation-steps { grid-template-columns:repeat(2,1fr); position:static; }
    .consultation-workspace { grid-template-columns:1fr; }
    .consultation-workspace>:is(.card,#symptoms,#investigations,#case-taking,.patient-history-panel,.repertory-panel,#prescribe) { grid-column:auto; grid-row:auto; }
    .consultation-workspace .follow-up-panel{grid-column:auto;grid-row:auto;order:6}
    .follow-up-controls{grid-template-columns:1fr}
    .follow-up-controls>span{margin-bottom:0}
    .investigation-row { grid-template-columns:1fr; }
    .rubric-row { grid-template-columns:1fr; }
    .investigation-row .span-2 { grid-column:auto; }
    .prescription-sheet { min-height:0; padding:30px 24px; }
    .settings-layout { grid-template-columns:1fr; }
    .format-preview { position:static; }
    .profile-page-grid { grid-template-columns:1fr; }
    .profile-overview { position:static; }
    .profile-workspace{grid-template-columns:1fr}.profile-workspace .profile-overview{position:static}.profile-workspace .profile-overview{display:grid;grid-template-columns:auto 1fr;column-gap:16px}.profile-workspace .profile-hero-photo,.profile-workspace .profile-hero-placeholder{grid-row:1/3;margin:0}.profile-facts,.profile-workspace .profile-bio{grid-column:1/-1}.profile-editor>[role="tabpanel"]{padding:18px}.section-heading{align-items:flex-start}
    .rx-header { grid-template-columns:minmax(0,1fr) minmax(132px,34%); align-items:flex-start; gap:10px; }
    .rx-brand-images { gap:9px; }
    .rx-header .rx-round-logo { width:58px; height:58px; flex-basis:58px; }
    .rx-header .rx-wordmark { width:calc(100% - 67px); height:82px; }
    .rx-header h1 { font-size:19px; }
    .appointment-toolbar{align-items:stretch;flex-direction:column}.view-switch{justify-content:center}.view-switch a{flex:1;text-align:center;padding-inline:8px}.date-nav{justify-content:space-between}.date-nav form{flex:1}.date-nav input{min-width:0}.performance-grid{grid-template-columns:1fr}.status-visual{grid-template-columns:120px 1fr}.donut{width:120px;height:120px}.trend-chart{height:180px;gap:2px}.trend-chart small:nth-child(even){visibility:hidden}.day-timeline article{grid-template-columns:76px 1fr auto}.day-timeline article>.btn{grid-column:2/-1}.calendar-card{padding:10px}
}

@media print {
    @page { size:A4; margin:12mm; }
    .no-print { display:none !important; }
    .prescription-body { background:#fff; }
    .prescription-sheet { width:auto; min-height:0; margin:0; padding:8mm 10mm; box-shadow:none; }
}
.login-attempt-status{display:flex;justify-content:space-between;gap:.75rem;flex-wrap:wrap;margin-top:.55rem;font-size:.9rem}
.dose-period-selector{grid-column:1/-1;display:flex;align-items:stretch;gap:8px;flex-wrap:wrap;padding:8px 0 13px;border-bottom:1px solid var(--line)}
.dose-period-title{display:flex;align-items:center;min-width:130px;font-size:.82rem;font-weight:750;color:var(--muted)}
.dose-period-selector button{display:flex;align-items:center;gap:7px;min-width:112px;padding:7px 10px;border:1px solid var(--line);border-radius:10px;background:#fff;color:var(--ink);cursor:pointer}
.dose-period-selector button i{display:grid;place-items:center;width:26px;height:26px;border-radius:50%;background:#eef5f8;color:#506577;font-size:18px;font-style:normal}
.dose-period-selector button span{display:grid;text-align:left;font-weight:700;line-height:1.05}.dose-period-selector button small{margin-top:3px;color:var(--muted);font-size:.72rem}
.dose-period-selector button.active{border-color:#1689ac;background:#e8f7fb;box-shadow:0 0 0 2px rgba(22,137,172,.1)}.dose-period-selector button.active i{background:#ffdc73;color:#795600}.dose-period-selector button[data-dose-period="night"].active i{background:#253b73;color:#fff}
.rx-dose-visual{display:flex;gap:7px;margin-top:8px}.rx-dose-visual>div{display:grid;grid-template-columns:24px auto;grid-template-rows:auto auto;align-items:center;min-width:90px;padding:5px 7px;border:1px solid #ccd8de;border-radius:7px;color:#9aa7ad;opacity:.48}.rx-dose-visual>div i{grid-row:1/3;font-size:18px;font-style:normal}.rx-dose-visual>div strong{font-size:10px}.rx-dose-visual>div span{font-size:9px}.rx-dose-visual>div.selected{color:#173d50;border-color:#678c9b;opacity:1}.rx-dose-visual>div.selected i{color:#c38700}.rx-dose-visual>div.selected:last-child i{color:#283c78}.rx-food-timing{margin-top:7px!important;font-weight:700;color:#204f61}
html[data-theme="dark"] .dose-period-selector button{background:#132630;border-color:#3a5260}html[data-theme="dark"] .dose-period-selector button.active{background:#17404d;border-color:#55b5cf}
.auth-shell{position:relative;isolation:isolate;place-items:center end;min-height:calc(100vh - 170px);padding:36px clamp(0px,4vw,56px);overflow:hidden;border-radius:24px;background:radial-gradient(circle at 22% 46%,rgba(62,157,187,.11),transparent 46%)}
.auth-shell::before{content:"";position:absolute;z-index:0;inset:0 43% 0 0;background:url('hahnemann-login.jpg') -58px center/contain no-repeat;opacity:.3;filter:grayscale(1) contrast(.9);pointer-events:none;-webkit-mask-image:linear-gradient(90deg,#000 64%,transparent 100%);mask-image:linear-gradient(90deg,#000 64%,transparent 100%)}
.auth-shell::after{content:"";position:absolute;z-index:0;inset:0;background:linear-gradient(90deg,transparent 34%,rgba(247,248,246,.7) 55%,rgba(247,248,246,.96) 72%);pointer-events:none}
.auth-shell .auth-card{position:relative;z-index:1;width:min(460px,100%);margin:0;border-color:rgba(117,164,183,.38);box-shadow:0 24px 70px rgba(15,55,76,.16);backdrop-filter:blur(7px)}
.opd-payment-card{margin:2px 0 0;padding:18px;border:1px solid #a8cbd7;border-radius:14px;background:linear-gradient(135deg,#f3fbfd,#f8fbf7);box-shadow:inset 4px 0 0 #1689ac}.opd-payment-head{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin-bottom:15px}.opd-payment-head h3{margin:3px 0 4px;font:700 20px/1.25 Georgia,serif}.opd-payment-head p{margin:0;color:var(--muted);font-size:13px}.opd-payment-head output{flex:0 0 auto;min-width:142px;padding:10px 13px;border-radius:10px;background:#dff2f7;color:#075d78;text-align:center;font-size:19px;font-weight:850}.opd-payment-head output.pending{background:#fff0cf;color:#81500d}.opd-payment-card>label{max-width:460px}.appointment-register-actions{justify-content:flex-end}.appointment-register-actions .btn.primary{min-width:220px}html[data-theme="dark"] .opd-payment-card{background:linear-gradient(135deg,#142c35,#172b25);border-color:#376674}html[data-theme="dark"] .opd-payment-head output{background:#173f4c;color:#9ee4f4}@media(prefers-color-scheme:dark){html[data-theme="auto"] .opd-payment-card{background:linear-gradient(135deg,#142c35,#172b25);border-color:#376674}html[data-theme="auto"] .opd-payment-head output{background:#173f4c;color:#9ee4f4}}
.required-field-label{display:inline-flex;align-items:baseline;gap:2px}.required-marker,.required-fields-note span{color:#c62828;font-weight:900}.required-fields-note{margin:-3px 0 13px;text-align:right;color:var(--muted);font-size:12px;font-weight:650}
.vitals-entry{min-width:0;margin:0;padding:11px 13px 13px;border:1px solid #b7d0d8;border-radius:12px;background:#f6fbfc}.vitals-entry legend{padding:0 7px;color:#174a5d;font-size:13px;font-weight:850}.vitals-entry legend span{margin-left:6px;color:var(--muted);font-size:10px;font-weight:650;text-transform:uppercase;letter-spacing:.04em}.vitals-entry-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.vitals-entry-grid label{position:relative}.vitals-entry-grid label>small{position:absolute;right:9px;top:1px;font-size:10px}.visit-vitals{display:grid;grid-template-columns:minmax(150px,1.2fr) repeat(3,minmax(125px,1fr));gap:1px;margin:-7px 0 18px;overflow:hidden;border:1px solid #a9c8d2;border-radius:13px;background:#c7dce2}.visit-vitals>div{display:grid;align-content:center;min-height:62px;padding:9px 13px;background:#f5fbfc}.visit-vitals-title{background:#e1f3f6!important}.visit-vitals-title>span{color:#075e78;font-size:15px;font-weight:900}.visit-vitals small,.visit-vitals>div>span{color:var(--muted);font-size:10px;font-weight:750;text-transform:uppercase;letter-spacing:.045em}.visit-vitals strong{margin-top:3px;color:#15364a;font-size:16px}.visit-vitals-title small{margin-top:3px;text-transform:none;letter-spacing:0}.visit-vitals strong:only-child{margin:0}
html[data-theme="dark"] .vitals-entry{background:#142a33;border-color:#42616d}html[data-theme="dark"] .vitals-entry legend{color:#9edce9}html[data-theme="dark"] .visit-vitals{background:#344e59;border-color:#496974}html[data-theme="dark"] .visit-vitals>div{background:#152a34}html[data-theme="dark"] .visit-vitals-title{background:#183c47!important}html[data-theme="dark"] .visit-vitals strong{color:#e8f4f8}@media(prefers-color-scheme:dark){html[data-theme="auto"] .vitals-entry{background:#142a33;border-color:#42616d}html[data-theme="auto"] .vitals-entry legend{color:#9edce9}html[data-theme="auto"] .visit-vitals{background:#344e59;border-color:#496974}html[data-theme="auto"] .visit-vitals>div{background:#152a34}html[data-theme="auto"] .visit-vitals-title{background:#183c47!important}html[data-theme="auto"] .visit-vitals strong{color:#e8f4f8}}
@media(max-width:700px){.vitals-entry-grid{grid-template-columns:1fr}.visit-vitals{grid-template-columns:repeat(3,1fr)}.visit-vitals-title{grid-column:1/-1}.visit-vitals>div{min-height:54px}}
.compact-workspace-card{padding:18px}.compact-workspace-card .card-head{margin-bottom:10px}.compact-walkin-form{gap:10px 12px}.compact-walkin-form :is(input,select,textarea){padding:8px 10px}.compact-walkin-form textarea{min-height:62px}.compact-walkin-form label{gap:4px;font-size:12px}.compact-walkin-form label small{line-height:1.3}.compact-walkin-form .emergency-toggle{padding:10px 12px;gap:9px;border-width:1px}.compact-walkin-form .emergency-toggle input{width:18px;height:18px}.compact-walkin-form .emergency-toggle strong{font-size:13px}.compact-walkin-form .opd-payment-card{padding:12px 14px}.compact-walkin-form .opd-payment-head{align-items:center;gap:12px;margin-bottom:9px}.compact-walkin-form .opd-payment-head h3{font-size:16px;margin:1px 0 2px}.compact-walkin-form .opd-payment-head p{font-size:11px;line-height:1.35}.compact-walkin-form .opd-payment-head output{min-width:124px;padding:7px 10px;font-size:16px}.compact-walkin-form .appointment-register-actions{grid-column:1/-1;padding-top:2px}.compact-walkin-form .appointment-register-actions .btn{padding-block:8px}
@media(min-width:1101px){.compact-walkin-form{grid-template-columns:repeat(4,minmax(0,1fr))}.compact-walkin-form .span-2{grid-column:span 2}.compact-walkin-form .emergency-toggle{grid-column:span 2}.compact-walkin-form .appointment-register-actions{grid-column:1/-1}.compact-walkin-form .opd-payment-card{display:grid;grid-template-columns:minmax(0,1fr) 205px;align-items:end;gap:12px}.compact-walkin-form .opd-payment-head{display:grid;grid-template-columns:minmax(0,1fr) auto;margin:0}.compact-walkin-form .opd-payment-head p{display:none}.compact-walkin-form .opd-payment-head output{min-width:108px}.compact-walkin-form .opd-payment-card>label{align-self:end}.compact-walkin-form .required-fields-note{grid-column:1/-1}}
.profile-workspace{grid-template-columns:minmax(220px,255px) minmax(0,1fr);gap:14px}.profile-workspace .profile-overview{padding:16px}.profile-workspace .profile-hero-photo,.profile-workspace .profile-hero-placeholder{width:68px;height:68px;margin-bottom:10px;border-width:3px;font-size:27px}.profile-identity h2{font-size:20px}.profile-facts{gap:9px 12px;margin-top:13px}.profile-facts dd{margin-top:2px;font-size:13px}.profile-workspace .profile-bio{margin-top:12px;padding-top:11px;font-size:12px}.profile-tabs{padding:5px}.profile-tabs button{min-height:34px;padding:7px 13px}.profile-editor>[role="tabpanel"]{padding:16px}.section-heading{margin-bottom:12px}.compact-profile-form{gap:10px}.compact-profile-form .form-grid{gap:10px}.compact-profile-form :is(input,select,textarea){padding:8px 10px}.compact-profile-form textarea{min-height:62px}.compact-profile-form .verified-email-control{padding:9px 11px}.profile-photo-control{padding:9px 11px}.form-actions .btn{min-width:132px;padding-block:8px}
.edit-card{padding:18px}.edit-card>.card-head{margin-bottom:10px}.edit-card>form.stack{grid-template-columns:repeat(2,minmax(0,1fr));gap:11px 12px;margin-top:0}.edit-card>form.stack>[data-profile-section]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-column:1/-1;gap:11px 12px}.edit-card>form.stack>.btn:last-child{grid-column:1/-1;justify-self:end;min-width:160px}.edit-card>form.stack :is(input,select,textarea){padding:8px 10px}.doctor-grid{gap:10px}.doctor-profile{padding:14px;gap:12px}.profile-details{gap:8px 10px;margin-top:10px}.doctor-profile .row-actions{margin-top:10px}
@media(max-width:1100px){.compact-walkin-form{grid-template-columns:repeat(2,minmax(0,1fr))}.compact-walkin-form .span-2,.compact-walkin-form .emergency-toggle{grid-column:span 2}}
@media(max-width:700px){.compact-workspace-card{padding:14px}.compact-walkin-form{grid-template-columns:1fr}.compact-walkin-form .span-2,.compact-walkin-form .emergency-toggle{grid-column:auto}.compact-walkin-form .opd-payment-head{display:grid}.compact-walkin-form .opd-payment-head output{justify-self:start}.profile-workspace{grid-template-columns:1fr}.profile-workspace .profile-overview{padding:14px}.profile-editor>[role="tabpanel"]{padding:14px}.edit-card>form.stack,.edit-card>form.stack>[data-profile-section]{grid-template-columns:1fr}.edit-card>form.stack>.btn:last-child{width:100%}}
html[data-theme="dark"] .auth-shell{background:radial-gradient(circle at 22% 46%,rgba(41,139,169,.14),transparent 48%)}
html[data-theme="dark"] .auth-shell::before{filter:invert(1) grayscale(1) contrast(.85);opacity:.13}
html[data-theme="dark"] .auth-shell::after{background:linear-gradient(90deg,transparent 34%,rgba(14,25,32,.72) 55%,rgba(14,25,32,.97) 72%)}
@media(prefers-color-scheme:dark){html[data-theme="auto"] .auth-shell{background:radial-gradient(circle at 22% 46%,rgba(41,139,169,.14),transparent 48%)}html[data-theme="auto"] .auth-shell::before{filter:invert(1) grayscale(1) contrast(.85);opacity:.13}html[data-theme="auto"] .auth-shell::after{background:linear-gradient(90deg,transparent 34%,rgba(14,25,32,.72) 55%,rgba(14,25,32,.97) 72%)}}
.international-phone-field{display:grid;grid-template-columns:minmax(180px,.42fr) minmax(220px,1fr);gap:12px}.international-phone-field label{min-width:0}.country-code-label b{color:#c62828}.country-code-control{position:relative;display:block}.country-code-flag{position:absolute;z-index:1;left:13px;top:50%;width:24px;height:18px;transform:translateY(-50%);object-fit:cover;border-radius:2px;box-shadow:0 0 0 1px rgba(15,43,67,.18);pointer-events:none}.international-phone-field select{font-variant-numeric:tabular-nums}.country-code-control select{padding-left:48px}@media(max-width:700px){.international-phone-field{grid-template-columns:145px minmax(0,1fr)}}@media(max-width:480px){.international-phone-field{grid-template-columns:1fr}}
@media(max-width:800px){.auth-shell{place-items:center;padding:24px 0;background:none}.auth-shell::before{inset:0;background-position:center;background-size:cover;opacity:.075;-webkit-mask-image:none;mask-image:none}.auth-shell::after{background:rgba(247,248,246,.7)}html[data-theme="dark"] .auth-shell::after{background:rgba(14,25,32,.76)}@media(prefers-color-scheme:dark){html[data-theme="auto"] .auth-shell::after{background:rgba(14,25,32,.76)}}.auth-shell .auth-card{width:min(460px,100%)}.opd-payment-head{display:grid}.opd-payment-head output{justify-self:start}.appointment-register-actions{justify-content:stretch}.appointment-register-actions .btn{flex:1}.appointment-register-actions .btn.primary{min-width:0}}
