* {
    box-sizing: border-box;
}

:root {
    --x2-page-max-width: 1540px;
    --x2-page-inline-space: 18px;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: "Tajawal", Arial, sans-serif;
    color: #f8fbff;
    background: #dff8f8 url("../img/background.png") center / cover fixed no-repeat;
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -2;
    content: "";
    background:
        linear-gradient(135deg, rgba(2, 20, 28, .38), rgba(50, 143, 154, .16) 48%, rgba(255, 255, 255, .2)),
        radial-gradient(circle at 22% 16%, rgba(163, 250, 245, .34), transparent 32%),
        radial-gradient(circle at 86% 72%, rgba(255, 255, 255, .34), transparent 34%);
}

body::after {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    content: "";
    background-image:
        linear-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .08) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .8), transparent);
}

a {
    color: inherit;
}

.patients-patient-link { color: var(--clinic-primary-strong); font-weight: 900; text-decoration: none; }
.patients-patient-link:hover { text-decoration: underline; }
.patient-profile-page { direction: ltr; width: min(var(--x2-page-max-width), calc(100% - var(--x2-page-inline-space))); margin: 0 auto; padding: 18px 0 100px; text-align: left; }
.patient-profile-header { display: grid; grid-template-columns: 48px minmax(0,1fr) auto; min-height: 78px; padding: 12px 18px; align-items: center; gap: 12px; border-radius: 18px; }
.patient-profile-header-icon { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 13px; color: #fff; background: var(--clinic-secondary); box-shadow: 0 7px 16px rgba(var(--clinic-secondary-rgb),.25); font-style: normal; }
.patient-profile-header-icon .visit-ui-icon { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.patient-profile-header .visit-patient-main { display: flex; min-width: 0; align-items: center; gap: 9px; }
.patient-profile-header .visit-live-dot { color: #087344; }
.patient-profile-header .visit-patient-main h1 { display: block; min-width: 0; margin: 0; overflow: hidden; direction: rtl; unicode-bidi: isolate; color: #19313c; font-size: clamp(1.25rem,2vw,1.6875rem); line-height: 1.15; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.patient-profile-header .secondary-btn { min-height: 0; padding: 10px 18px; border-radius: 12px; }
.patient-profile-tabs { margin-top: 12px; }
.patient-profile-page [data-patient-profile-panel][hidden] { display: none !important; }
.patient-profile-personal > .patient-profile-form-title,.patient-profile-personal > .patient-profile-fields { display: none; }
.patient-profile-personal { margin-top: 14px; padding: 18px; border-radius: 18px; }
.patient-profile-embedded-title { margin-bottom: 14px; }
.patient-profile-save { min-height: 40px; padding: 7px 16px; border: 0; border-radius: 10px; color: #fff; background: var(--clinic-primary); cursor: pointer; font: inherit; font-weight: 900; }
.patient-profile-edit-summary { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.patient-profile-edit-summary span > input,.patient-profile-edit-summary span > select { grid-column: 2; min-width: 0; min-height: 32px; padding: 2px 4px; border: 0; color: #19313c; background: transparent; font: inherit; font-size: 1.0625rem; font-weight: 900; }
.patient-profile-edit-summary span > input:focus,.patient-profile-edit-summary span > select:focus { outline: 3px solid var(--clinic-accent-strong); outline-offset: 2px; border-radius: 5px; }
.patient-profile-edit-summary span > input[name="full_name"],.patient-profile-edit-summary span > input[name="job_title"],.patient-profile-edit-summary span > input[name="address"] { direction: rtl; text-align: right; }
.patient-profile-edit-summary span > input[name="phone"],.patient-profile-edit-summary span > input[name="birth_date"] { direction: ltr; text-align: left; }
.patient-profile-extra-fields { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.patient-profile-extra-fields [data-visit-field="education"] { grid-column: span 6; }
.patient-profile-extra-fields [data-visit-field="marital_status"] { grid-column: span 4; }
.patient-profile-extra-fields [data-visit-field="children_count"] { grid-column: span 2; }
.patient-profile-note-field { display: grid; gap: 7px; margin-top: 13px; padding: 11px; border-radius: 10px; background: #fff; }
.patient-profile-note-field > span { color: #526771; font-weight: 900; }
.patient-profile-note-field textarea { width: 100%; box-sizing: border-box; min-height: 92px; padding: 10px 12px; border: 1px solid #c8d8df; border-radius: 10px; color: #263e49; background: #fff; resize: vertical; font: inherit; }
.patient-profile-form,.patient-profile-visits { margin-top: 14px; padding: 18px; border-radius: 18px; color: #263e49; background: rgba(247,252,255,.9); }
.patient-profile-form-title,.patient-profile-visits > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.patient-profile-form-title h2,.patient-profile-visits h2 { margin: 0; color: var(--clinic-primary-strong); }
.patient-profile-form-title button { min-height: 42px; padding: 7px 18px; border: 0; border-radius: 11px; color: #fff; background: var(--clinic-primary); cursor: pointer; font: inherit; font-weight: 900; }
.patient-profile-fields { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 8px; margin-top: 15px; }
.patient-profile-fields label { display: grid; gap: 6px; padding: 10px; border-radius: 11px; background: #fff; }
.patient-profile-fields label > span { margin: 0; color: #62747c; font-size: 0.8125rem; font-weight: 800; }
.patient-profile-fields input,.patient-profile-fields select { min-height: 42px; padding: 7px 10px; border: 1px solid #c8d8df; border-radius: 10px; color: #263e49; background: #fff; }
.patient-profile-fields input[name="full_name"],.patient-profile-fields input[name="job_title"],.patient-profile-fields input[name="address"] { direction: rtl; text-align: right; }
.patient-profile-fields input[name="phone"],.patient-profile-fields input[name="birth_date"] { direction: ltr; text-align: left; }
.patient-profile-visits > header > span { padding: 6px 11px; border-radius: 15px; color: #fff; background: var(--clinic-primary); font-weight: 900; }
.patient-profile-visits > div { display: grid; gap: 8px; margin-top: 14px; }
.patient-profile-visit { overflow: hidden; border: 1px solid #d2dfe4; border-radius: 10px; background: #fff; }
.patient-profile-visit > summary { display: grid; grid-template-columns: 120px 1fr auto; gap: 10px; padding: 12px; align-items: center; cursor: pointer; list-style: none; }
.patient-profile-visit > summary::-webkit-details-marker { display: none; }
.patient-profile-visit > summary strong { color: var(--clinic-primary-strong); }
.patient-profile-visit > summary small { color: #6e7f87; }
.patient-visit-summary { display: grid; gap: 0; margin: 0 7px; border: 1px solid #d8e2e6; border-inline-start: 3px solid var(--clinic-primary); }
.patient-visit-summary > div { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 6px; padding: 7px; border-bottom: 1px solid #dde5e9; text-align: left; }
.patient-visit-summary > div:last-child { border-bottom: 0; }
.patient-visit-summary > div > strong { color: #304650; font-size: 0.75rem; white-space: nowrap; }
.patient-visit-summary > div > span { display: flex; flex-wrap: wrap; gap: 5px; }
.patient-visit-summary > div b { padding: 5px 8px; border: 1px solid #d1dce2; border-radius: 6px; color: var(--clinic-primary-strong); background: #fff; font-size: 0.6875rem; }
.patient-profile-visit > footer { display: grid; gap: 5px; padding: 11px; color: #526771; }
.patient-profile-visit > footer b { display: inline-grid; min-width: 22px; height: 22px; place-items: center; border-radius: 50%; color: #fff; background: #249765; }
.patient-profile-scans { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill,minmax(230px,1fr)); }
.patient-profile-scans > p { grid-column: 1 / -1; }
.patient-profile-scans > article { display: grid; gap: 6px; padding: 9px; border: 1px solid #d2dfe4; border-radius: 10px; background: #fff; }
.patient-profile-scans > article > a { display: flex; min-width: 0; align-items: center; gap: 10px; color: #304650; text-decoration: none; }
.patient-profile-scans > article > a > img,.patient-profile-scans > article > a > b { width: 62px; height: 62px; flex: 0 0 62px; border-radius: 8px; object-fit: cover; }
.patient-profile-scans > article > a > b { display: grid; place-items: center; color: #fff; background: var(--clinic-primary); font-size: 0.75rem; }
.patient-profile-scans > article > a > span { display: grid; min-width: 0; gap: 3px; }
.patient-profile-scans > article > a strong { overflow: hidden; color: var(--clinic-primary-strong); text-overflow: ellipsis; white-space: nowrap; }
.patient-profile-scans > article > a small,.patient-profile-scans > article > a em { color: #667981; font-style: normal; }
.patient-inline-lab-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; margin: 14px 0; padding: 12px; border: 1px solid #cbdbe2; border-radius: 11px; background: rgba(255,255,255,.72); }
.patient-inline-lab-form label { display: grid; gap: 5px; color: #526771; font-weight: 800; }
.patient-inline-lab-form input,.patient-inline-lab-form textarea { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid #c8d8df; border-radius: 8px; background: #fff; }
.patient-inline-lab-form small { color: #71838b; font-weight: 500; }
.patient-inline-lab-actions { display: grid; align-content: center; gap: 5px; }
.patient-inline-lab-actions button,.patient-inline-lab-delete { min-height: 36px; padding: 6px 12px; border: 0; border-radius: 8px; color: #fff; background: var(--clinic-primary); cursor: pointer; font: inherit; font-weight: 900; }
.patient-inline-lab-delete { width: 100%; color: #a83245; background: #ffe4e8; }
.patient-inline-lab-actions span { min-height: 16px; color: #2a8b65; font-size: 0.75rem; }
.patient-profile-scans-panel { direction: rtl; }
.patient-profile-scans-panel .patient-inline-lab-form { grid-template-columns: 1fr; gap: 10px; margin-top: 14px; }
.patient-inline-lab-file,.patient-inline-lab-notes { width: 100%; }
.patient-inline-lab-file > span,.patient-inline-lab-notes > span { color: #40515b; font-weight: 900; }
.patient-inline-lab-file input { min-height: 50px; padding: 8px 12px; border-radius: 15px; background: rgba(255,255,255,.9); }
.patient-inline-lab-preview { min-height: 130px; align-items: start; }
.patient-inline-lab-actions { grid-template-columns: 1fr 1fr; direction: rtl; gap: 12px; }
.patient-inline-lab-actions button { min-height: 54px; font-size: 1rem; }
.patient-inline-lab-actions .patient-inline-lab-close { color: #fff; background: #eb6268; }
.patient-inline-lab-actions span { grid-column: 1 / -1; text-align: center; }
.patient-inline-lab-history-wrap { margin-top: 18px; }
.patient-profile-page .patient-profile-edit-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.patient-profile-page .patient-profile-extra-fields { grid-template-columns: repeat(12, minmax(0, 1fr)); }
@media (max-width: 1050px) { .patient-profile-fields { grid-template-columns: repeat(3,minmax(0,1fr)); } }
@media (max-width: 760px) { .patient-profile-header { align-items: stretch; flex-direction: column; gap: 12px; } .patient-profile-fields { grid-template-columns: 1fr; } .patient-profile-visit > summary { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .patient-inline-lab-form { grid-template-columns: 1fr; } .patient-profile-page .patient-profile-edit-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } .patient-profile-page .patient-profile-extra-fields { grid-template-columns: 1fr; } .patient-profile-extra-fields [data-visit-field] { grid-column: auto; } }
@media (max-width: 760px) { .patient-profile-header { grid-template-columns: 1fr; } .patient-profile-header-icon { display: none; } }

button,
input,
select {
    font: inherit;
}

.auth-shell {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
}

.glass-panel {
    border: 1px solid rgba(255, 255, 255, .48);
    background: linear-gradient(145deg, rgba(255, 255, 255, .34), rgba(255, 255, 255, .16));
    box-shadow: 0 24px 70px rgba(5, 35, 43, .22), inset 0 1px 0 rgba(255, 255, 255, .42);
    backdrop-filter: blur(22px);
}

.auth-card {
    width: min(calc(100vw - 48px), 460px);
    padding: 34px;
    border-radius: 28px;
    text-align: center;
}

.register-card {
    width: min(calc(100vw - 48px), 720px);
}

.brand-mark {
    display: grid;
    width: 74px;
    height: 74px;
    margin: 0 auto 16px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .45);
    border-radius: 24px;
    color: #06333d;
    background: linear-gradient(135deg, #ffffff, var(--clinic-primary-soft));
    box-shadow: 0 14px 34px rgba(var(--clinic-primary-rgb), .22);
    font-size: 1.625rem;
    font-weight: 900;
}

.eyebrow {
    margin: 0 0 8px;
    color: #aef6f2;
    font-size: 0.875rem;
    font-weight: 800;
    letter-spacing: 0;
}

h1,
h2,
p {
    margin-top: 0;
}

.auth-card h1 {
    margin-bottom: 10px;
    font-size: clamp(1.875rem, 6vw, 2.625rem);
    font-weight: 900;
}

.subtitle {
    margin-bottom: 24px;
    color: rgba(248, 251, 255, .78);
    line-height: 1.8;
}

.auth-form {
    display: grid;
    gap: 15px;
    text-align: right;
}

.auth-form.two-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.full-row {
    grid-column: 1 / -1;
}

label span {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    color: rgba(248, 251, 255, .9);
    font-size: 0.875rem;
    font-weight: 800;
}

small {
    color: rgba(248, 251, 255, .62);
    font-size: 0.75rem;
}

input,
select {
    width: 100%;
    min-height: 52px;
    padding: 0 16px;
    border: 1px solid rgba(255, 255, 255, .38);
    border-radius: 16px;
    outline: none;
    color: #f8fbff;
    background: rgba(4, 36, 46, .26);
}

select option {
    color: #0a1d25;
}

input:focus,
select:focus {
    border-color: var(--clinic-accent-strong);
    box-shadow: 0 0 0 4px rgba(var(--clinic-accent-rgb), .14);
}

input[readonly] {
    cursor: not-allowed;
    color: #dffafa;
    background: rgba(255, 255, 255, .14);
}

.primary-btn {
    min-height: 54px;
    border: 0;
    border-radius: 16px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--clinic-primary), var(--clinic-secondary));
    box-shadow: 0 18px 36px rgba(var(--clinic-primary-rgb), .22);
    cursor: pointer;
    font-weight: 900;
}

.switch-link {
    margin: 22px 0 0;
    color: rgba(248, 251, 255, .78);
}

.switch-link a {
    color: #aef6f2;
    font-weight: 900;
    text-decoration: none;
}

.alert {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 14px;
    line-height: 1.7;
    text-align: right;
}

.alert-error {
    border: 1px solid rgba(255, 158, 158, .34);
    color: #ffe4e4;
    background: rgba(116, 20, 33, .28);
}

.alert-success {
    border: 1px solid rgba(143, 245, 194, .42);
    color: #eafff4;
    background: rgba(22, 120, 84, .3);
}

.dashboard-shell {
    width: min(var(--x2-page-max-width), calc(100% - var(--x2-page-inline-space)));
    margin: 0 auto;
    padding: 24px 0;
}

.dashboard-page {
    min-height: 100vh;
    overflow-x: hidden;
    background-image: url("../img/background-hero.png");
}

.dashboard-canvas {
    min-height: 100vh;
    padding-bottom: 92px;
}

.reception-body {
    height: 100vh;
    overflow: hidden;
}

.reception-body .dashboard-canvas {
    height: 100vh;
    min-height: 0;
    overflow: hidden;
    padding-bottom: 0;
}

.reception-body .bottom-dock {
    display: none;
}

.bottom-dock {
    position: fixed;
    right: 50%;
    bottom: 18px;
    z-index: 10;
    display: grid;
    grid-template-columns: 64px repeat(5, minmax(90px, 100px)) 64px;
    gap: 5px;
    width: min(780px, calc(100% - 28px));
    align-items: center;
    min-height: 50px;
    padding: 3px 10px;
    border: 1px solid rgba(255, 255, 255, .44);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(24, 55, 132, .72), rgba(19, 139, 164, .56)),
        rgba(255, 255, 255, .22);
    box-shadow: 0 16px 44px rgba(3, 31, 48, .24), inset 0 1px 0 rgba(255, 255, 255, .38);
    backdrop-filter: blur(24px);
    transform: translateX(50%);
}

.dock-chat-toggle { display:grid; min-height:44px; padding:3px 5px; place-items:center; gap:0; border:0; border-radius:14px; color:rgba(255,255,255,.86); background:rgba(17,67,129,.2); font:inherit; font-size:0.75rem; font-weight:900; cursor:pointer; }
.dock-chat-toggle svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.dock-chat-toggle:hover,.dock-chat-toggle.is-active { color:var(--clinic-primary-strong); background:linear-gradient(135deg,#fff,var(--clinic-primary-soft)); box-shadow:0 6px 18px rgba(var(--clinic-primary-rgb),.2); }
.dock-notifications-toggle,.dock-chat-toggle { position:relative; }
.dock-chat-toggle > b { position:absolute; top:2px; right:2px; display:grid; min-width:18px; height:18px; padding:0 4px; place-items:center; border:2px solid #fff; border-radius:12px; color:#fff; background:#ed4f67; font-size:0.5625rem; }
.dock-chat-toggle > b[hidden] { display:none !important; }
.dock-chat-panel[hidden] { display:none !important; }
.dock-chat-panel { position:fixed; right:18px; bottom:18px; z-index:20; display:flex; width:min(360px,calc(100vw - 24px)); height:430px; overflow:hidden; flex-direction:column; border:1px solid rgba(255,255,255,.65); border-radius:20px; background:rgba(244,251,255,.96); box-shadow:0 22px 60px rgba(4,34,52,.3); backdrop-filter:blur(24px); }
.dock-chat-panel > header { display:flex; align-items:center; justify-content:space-between; padding:13px 15px; color:#fff; background:linear-gradient(135deg,var(--clinic-secondary),var(--clinic-accent-strong)); }
.dock-chat-panel > header div { display:flex; min-width:0; align-items:center; gap:10px; }
.dock-chat-panel > header strong { flex:0 0 auto; font-size:1.0625rem; }
.dock-chat-panel > header small { max-width:170px; overflow:hidden; color:rgba(255,255,255,.86); font-size:0.6875rem; text-overflow:ellipsis; white-space:nowrap; }
.dock-chat-panel > header button { display:grid; width:30px; height:30px; padding:0; place-items:center; border:0; border-radius:50%; color:#fff; background:rgba(255,255,255,.15); font-size:1.375rem; line-height:1; cursor:pointer; }
.dock-chat-messages { display:flex; flex:1; gap:8px; padding:14px; overflow:auto; flex-direction:column; background:linear-gradient(180deg,#edf7fb,#fff); }
.dock-chat-partner { display:flex; min-width:0; max-width:210px; padding:0; align-items:center; gap:5px; border:0; color:rgba(255,255,255,.9); background:transparent; font-size:0.6875rem; font-weight:800; }
.dock-chat-partner[hidden] { display:none !important; }
.dock-chat-partner > span { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; }
.dock-chat-partner select { width:auto; min-width:0; max-width:100%; height:21px; padding:0 2px; flex:1 1 auto; border:0; color:#e9fdff; background:transparent; font:inherit; font-size:0.6875rem; outline:none; cursor:pointer; }
.dock-chat-partner select option { color:#29434e; background:#fff; }
.dock-chat-partner > b { flex:0 0 auto; padding:2px 6px; border-radius:9px; color:#fff; background:#ef5570; font-size:0.5rem; white-space:nowrap; }
.dock-chat-partner > b[hidden] { display:none !important; }
.dock-chat-messages p { width:max-content; max-width:82%; margin:0; padding:9px 12px; border-radius:14px; color:#29434e; background:#fff; box-shadow:0 3px 10px rgba(26,62,77,.08); line-height:1.5; overflow-wrap:break-word; word-break:normal; }
.dock-chat-messages .dock-chat-empty { width:auto; max-width:none; margin:auto; color:#71828a; background:transparent; box-shadow:none; text-align:center; }
.dock-chat-messages .is-sent { align-self:flex-start; color:#fff; background:var(--clinic-primary); border-bottom-left-radius:4px; }
.dock-chat-messages .is-received { align-self:flex-end; border-bottom-right-radius:4px; }
.dock-chat-message { display:flex; width:fit-content; max-width:100%; align-items:flex-end; gap:5px; }
.dock-chat-message.is-sent-row { align-self:flex-start; }
.dock-chat-message.is-received-row { align-self:flex-end; flex-direction:row-reverse; }
.dock-chat-message > p { width:max-content; max-width:min(260px,calc(100vw - 120px)); }
.dock-chat-sender { display:block; margin-bottom:2px; color:inherit; opacity:.7; font-size:0.5625rem; }
.dock-chat-message-meta { display:inline-flex; align-items:center; gap:3px; padding-bottom:2px; color:#718088; white-space:nowrap; }
.dock-chat-message-time { display:inline-block; margin:0; color:inherit; opacity:.82; font-size:0.5625rem; font-weight:700; white-space:nowrap; }
.dock-chat-status { display:inline-block; margin:0 5px 0 0; padding:0; border:0; color:rgba(255,255,255,.72); background:transparent; font:inherit; font-size:0.6875rem; font-weight:900; letter-spacing:-3px; vertical-align:middle; cursor:default; }
.dock-chat-status { color:rgba(255,255,255,.72); }
.dock-chat-status.is-read { color:#70e3ff; }
.dock-chat-quick { display:flex; gap:5px; padding:6px 10px 0; background:#fff; }
.dock-chat-quick button { min-width:0; padding:4px 10px; border:1px solid #d3dce8; border-radius:12px; color:var(--clinic-primary-strong); background:var(--clinic-primary-soft); font:inherit; font-size:0.6875rem; font-weight:900; cursor:pointer; }
.dock-chat-quick button:hover { color:#fff; border-color:var(--clinic-primary); background:var(--clinic-primary); }
.dock-chat-form { display:grid; grid-template-columns:1fr 42px; gap:7px; padding:10px; border-top:1px solid #d7e4e9; background:#fff; }
.dock-chat-form input { min-width:0; min-height:42px; padding:8px 12px; border:1px solid #c8d8de; border-radius:12px; color:#263f4a; background:#f8fbfc; font:inherit; outline:none; }
.dock-chat-form input:focus { border-color:var(--clinic-primary); box-shadow:0 0 0 3px rgba(var(--clinic-primary-rgb),.1); }
.dock-chat-form button { display:grid; width:42px; height:42px; padding:0; place-items:center; border:0; border-radius:12px; color:#fff; background:var(--clinic-primary); cursor:pointer; }
.dock-chat-form button svg { width:21px; height:21px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.dock-notifications-panel { right:auto; bottom:18px; left:18px; height:390px; }
.mobile-home-nav { display:none; }
.dock-notification-list { display:grid; align-content:start; flex:1; gap:7px; padding:10px; overflow:auto; background:linear-gradient(180deg,#edf7fb,#fff); }
.dock-notification-list article { display:grid; grid-template-columns:1fr auto; gap:8px; padding:10px; border:1px solid #dbe6ea; border-radius:11px; color:#2d4651; background:#fff; }
.dock-notification-list article.is-unread { border-color:#62bdd0; background:#ebfbff; }
.dock-notification-list article.is-completed { border-color:#9edab4; background:#f2fff7; }
.dock-notification-list article.is-cancelled { border-color:#efbdc4; background:#fff7f8; opacity:.86; }
.dock-notification-list article > div:first-child { display:grid; align-content:start; gap:3px; }
.dock-notification-list article p { margin:0; color:#62747c; font-size:0.75rem; }
.dock-notification-list article small { color:#71828a; font-size:0.5625rem; white-space:nowrap; }
.dock-notification-meta { display:flex; min-width:84px; align-items:flex-end; flex-direction:column; gap:7px; }
.dock-notification-actions { display:flex; gap:4px; }
.dock-notification-actions button { min-height:27px; padding:3px 8px; border:0; border-radius:8px; color:#fff; background:#239867; font:inherit; font-size:0.625rem; font-weight:900; cursor:pointer; }
.dock-notification-actions button:last-child { background:#d95b6c; }
.dock-notification-status { display:inline-flex; min-height:25px; padding:3px 8px; align-items:center; border-radius:8px; color:#24744f; background:#dff7e8; font-size:0.625rem; white-space:nowrap; }
.is-cancelled .dock-notification-status { color:#a73e4c; background:#fbe2e6; }
.dock-notification-empty { margin:auto; color:#71828a; text-align:center; }
.doctor-entry-toast-stack { position:fixed; right:auto; bottom:18px; left:18px; z-index:80; display:grid; width:min(360px,calc(100vw - 24px)); gap:10px; pointer-events:none; }
.doctor-entry-toast { display:grid; grid-template-columns:48px minmax(0,1fr); gap:11px; width:100%; padding:13px 14px; align-items:center; border:1px solid rgba(255,255,255,.82); border-radius:17px; color:#fff; background:linear-gradient(135deg,var(--clinic-secondary),var(--clinic-accent-strong)); box-shadow:0 16px 38px rgba(var(--clinic-shadow),.34); direction:rtl; text-align:right; font:inherit; cursor:pointer; pointer-events:auto; animation:doctor-entry-toast-in .32s ease-out both; }
.doctor-entry-toast:hover { transform:translateY(-2px); box-shadow:0 20px 44px rgba(8,53,86,.42); }
.doctor-entry-toast:disabled { cursor:wait; opacity:.82; }
.doctor-entry-toast > span:last-child { display:grid; min-width:0; gap:2px; }
.doctor-entry-toast strong { font-size:0.875rem; font-weight:900; }
.doctor-entry-toast b { overflow:hidden; font-size:0.8125rem; line-height:1.55; white-space:pre-line; }
.doctor-entry-toast small { color:rgba(255,255,255,.82); font-size:0.625rem; }
.doctor-entry-toast-icon { display:grid; width:42px; height:42px; place-items:center; border-radius:50%; color:var(--clinic-primary-strong); background:var(--clinic-primary-soft); font-size:1.375rem; font-weight:900; }
@keyframes doctor-entry-toast-in { from { opacity:0; transform:translateX(-34px) scale(.96); } to { opacity:1; transform:translateX(0) scale(1); } }

.clinic-settings-page .dashboard-canvas { padding:26px 0 120px; }
.clinic-settings-shell { display:grid; width:min(var(--x2-page-max-width),calc(100% - var(--x2-page-inline-space))); margin:auto; gap:18px; direction:rtl; }
.clinic-settings-heading { display:flex; justify-content:space-between; align-items:center; gap:22px; padding:25px 29px; overflow:hidden; border-radius:28px; }
.clinic-settings-heading p { margin:0 0 5px; color:#4a6f85; font-weight:800; }
.clinic-settings-heading h1 { margin:0; color:#123d55; font-size:2.125rem; }
.clinic-settings-heading > div > span { color:#5d7480; font-weight:700; }
.clinic-settings-summary { display:grid; grid-template-columns:auto auto; gap:5px 9px; align-items:center; min-width:145px; padding:14px 18px; border:1px solid rgba(255,255,255,.58); border-radius:20px; color:var(--clinic-primary-strong); background:rgba(var(--clinic-primary-rgb),.08); }
.clinic-settings-summary b { display:grid; width:35px; height:35px; place-items:center; border-radius:50%; color:#fff; background:linear-gradient(135deg,var(--clinic-accent-strong),var(--clinic-accent-strong)); }
.clinic-settings-summary span { font-weight:900; }
.clinic-settings-alert { width:min(760px,100%); margin:0 auto; }
.clinic-settings-readonly { padding:13px 17px; border-radius:16px; color:#7a5915; background:#fff2ca; font-weight:800; text-align:center; }
.clinic-settings-card { overflow:hidden; border-radius:28px; color:#173f53; }
.clinic-settings-card > header { display:flex; justify-content:space-between; align-items:center; gap:15px; padding:20px 25px; border-bottom:1px solid rgba(var(--clinic-primary-rgb),.14); background:linear-gradient(135deg,rgba(255,255,255,.42),rgba(var(--clinic-primary-rgb),.1)); }
.clinic-settings-card > header span { color:#5b7785; font-size:0.8125rem; font-weight:800; }
.clinic-settings-card > header h2 { margin:3px 0 0; color:#123d55; font-size:1.6875rem; }
.clinic-settings-card > header > b { padding:7px 13px; border-radius:999px; color:#176a56; background:#dff6ea; font-size:0.8125rem; }
.clinic-name-form { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:12px; padding:20px 25px; align-items:end; }
.clinic-name-form label { display:grid; gap:7px; }
.clinic-name-form label span { margin:0; color:#345c70; font-weight:900; }
.clinic-settings-card input { min-height:48px; padding:8px 14px; border:1px solid rgba(77,145,171,.38); border-radius:15px; color:#173f53; -webkit-text-fill-color:#173f53; background:rgba(255,255,255,.72); box-shadow:inset 0 1px 3px rgba(22,73,94,.05); }
.clinic-settings-card input:focus { border-color:var(--clinic-accent-strong); outline:0; box-shadow:0 0 0 4px rgba(var(--clinic-accent-rgb),.14); }
.clinic-name-form button,.clinic-room-add button,.clinic-room-edit button { min-height:46px; padding:7px 17px; border:0; border-radius:13px; color:#fff; background:linear-gradient(135deg,var(--clinic-accent-strong),var(--clinic-accent-strong)); font:inherit; font-weight:900; cursor:pointer; }
.clinic-rooms-section { padding:0 25px 25px; }
.clinic-rooms-title { display:flex; justify-content:space-between; align-items:center; padding:18px 0 13px; border-top:1px solid rgba(54,113,139,.12); }
.clinic-rooms-title h3 { margin:0; color:#17465e; font-size:1.375rem; }
.clinic-rooms-title p { margin:4px 0 0; color:#6c818c; font-size:0.8125rem; }
.clinic-room-add { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px; margin-bottom:14px; padding:14px; border:1px dashed rgba(var(--clinic-primary-rgb),.35); border-radius:18px; background:rgba(var(--clinic-primary-rgb),.06); }
.clinic-room-add button { background:linear-gradient(135deg,#188a68,#168456); }
.clinic-room-list { display:grid; gap:9px; }
.clinic-room-row { display:flex; align-items:center; gap:10px; min-height:65px; padding:9px 11px; border:1px solid rgba(var(--clinic-primary-rgb),.22); border-radius:18px; background:linear-gradient(135deg,rgba(255,255,255,.7),var(--clinic-primary-soft)); }
.clinic-room-icon { display:grid; width:42px; height:42px; flex:0 0 42px; place-items:center; border-radius:14px; color:var(--clinic-primary-strong); background:var(--clinic-primary-soft); }
.clinic-room-icon svg { width:24px; height:24px; fill:none; stroke:currentColor; stroke-width:1.8; }
.clinic-room-edit { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; min-width:0; flex:1; }
.clinic-room-edit input { min-width:0; }
.clinic-room-row > form:last-child { margin:0; }
.clinic-room-delete { min-height:42px; padding:6px 14px; border:0; border-radius:12px; color:#fff; background:#d65062; font:inherit; font-weight:900; cursor:pointer; }
.clinic-room-empty { margin:0; padding:25px; border:1px dashed rgba(72,139,163,.3); border-radius:18px; color:#71858f; background:rgba(255,255,255,.32); text-align:center; }
.clinic-rooms-table-card { overflow:hidden; border-radius:28px; color:#173f53; }
.clinic-rooms-table-card > header { display:flex; justify-content:space-between; align-items:center; gap:16px; padding:21px 25px; border-bottom:1px solid rgba(54,113,139,.14); }
.clinic-rooms-table-card > header h2 { margin:0; color:#123d55; font-size:1.5625rem; }
.clinic-rooms-table-card > header p { margin:4px 0 0; color:#6c818c; font-size:0.8125rem; }
.clinic-rooms-table-card > header button { min-height:45px; padding:7px 20px; border:0; border-radius:14px; color:#fff; background:linear-gradient(135deg,#188a68,#168456); box-shadow:0 8px 18px rgba(24,138,104,.18); font:inherit; font-weight:900; cursor:pointer; }
.clinic-rooms-table-wrap { overflow:auto; }
.clinic-rooms-table { width:100%; border-collapse:collapse; }
.clinic-rooms-table th,.clinic-rooms-table td { padding:14px 18px; border-bottom:1px solid rgba(54,113,139,.12); text-align:right; vertical-align:middle; }
.clinic-rooms-table th { color:#345c70; background:var(--clinic-primary-soft); font-size:0.8125rem; }
.clinic-rooms-table th:first-child,.clinic-rooms-table td:first-child { width:75px; text-align:center; }
.clinic-rooms-table th:last-child,.clinic-rooms-table td:last-child { width:110px; }
.clinic-room-number { display:grid; width:32px; height:32px; margin:auto; place-items:center; border-radius:50%; color:#fff; background:var(--clinic-accent-strong); font-weight:900; }
.clinic-room-table-edit { display:grid; grid-template-columns:minmax(180px,1fr) auto; gap:9px; max-width:600px; }
.clinic-room-table-edit button { min-height:44px; padding:5px 17px; border:0; border-radius:12px; color:#fff; background:var(--clinic-accent-strong); font:inherit; font-weight:900; cursor:pointer; }
.clinic-rooms-table td > form { margin:0; }
.clinic-room-empty-cell { padding:35px !important; color:#71858f; text-align:center !important; }
.clinic-room-modal[hidden] { display:none; }
.clinic-room-modal { position:fixed; inset:0; z-index:120; display:grid; padding:20px; place-items:center; direction:rtl; }
.clinic-room-modal-backdrop { position:absolute; inset:0; width:100%; height:100%; border:0; background:rgba(4,28,43,.58); backdrop-filter:blur(5px); }
.clinic-room-modal-card { position:relative; z-index:1; display:grid; width:min(500px,100%); gap:20px; padding:25px; overflow:hidden; border:1px solid rgba(255,255,255,.86); border-radius:28px; color:#173f53; background:linear-gradient(145deg,rgba(255,255,255,.98),var(--clinic-primary-soft)); box-shadow:0 24px 70px rgba(var(--clinic-shadow),.35); }
.clinic-room-modal-card > header { display:flex; justify-content:space-between; align-items:center; margin:-25px -25px 2px; padding:18px 22px; border-radius:27px 27px 18px 18px; background:linear-gradient(135deg,var(--clinic-accent-strong),var(--clinic-accent-strong)); }
.clinic-room-modal-card h2 { margin:0; color:#fff; font-size:1.5rem; }
.clinic-room-modal-card header button { width:34px; height:34px; padding:0; border:0; border-radius:50%; color:#fff; background:#d55162; font-size:1.375rem; cursor:pointer; }
.clinic-room-modal-card label { display:grid; gap:7px; }
.clinic-room-modal-card label span { margin:0; color:#284e61; font-weight:900; }
.clinic-room-modal-card input { min-height:50px; padding:8px 14px; border:1px solid rgba(79,145,171,.38); border-radius:15px; color:#173f53; -webkit-text-fill-color:#173f53; background:rgba(255,255,255,.8); }
.clinic-room-modal-card footer { display:flex; justify-content:flex-end; gap:9px; }
.clinic-room-modal-card footer button { min-height:42px; padding:7px 17px; border:0; border-radius:12px; color:#fff; background:#788d97; font:inherit; font-weight:900; cursor:pointer; }
.clinic-room-modal-card footer button:last-child { background:var(--clinic-accent-strong); }
@media (max-width:700px) {
  .clinic-settings-page .dashboard-canvas { padding:14px 0 110px; }
  .clinic-settings-heading { align-items:stretch; flex-direction:column; }
  .clinic-settings-heading h1 { font-size:1.75rem; }
  .clinic-settings-summary { align-self:stretch; }
  .clinic-name-form,.clinic-room-add { grid-template-columns:1fr; }
  .clinic-room-row { align-items:stretch; flex-wrap:wrap; }
  .clinic-room-edit { grid-template-columns:1fr; }
  .clinic-room-row > form:last-child { width:100%; }
  .clinic-room-delete { width:100%; }
  .clinic-rooms-table-card > header { align-items:stretch; flex-direction:column; }
  .clinic-rooms-table { min-width:620px; }
}

.users-admin-page .dashboard-canvas { padding:26px 0 120px; }
.users-admin-shell { display:grid; width:min(var(--x2-page-max-width),calc(100% - var(--x2-page-inline-space))); margin:auto; gap:18px; direction:rtl; }
.users-admin-heading { display:flex; justify-content:space-between; gap:20px; padding:24px 28px; align-items:center; border-radius:26px; overflow:hidden; }
.users-admin-heading p { margin:0 0 4px; color:#4a6f85; font-weight:800; }
.users-admin-heading h1 { margin:0; color:#123d55; font-size:2.125rem; }
.users-admin-heading span { color:#5d7480; font-weight:700; }
.users-heading-actions { display:flex; align-items:center; flex-wrap:wrap; gap:9px; }
.users-add-btn,
.users-history-btn { min-height:46px; padding:0 22px; border:0; border-radius:14px; color:#fff; background:var(--clinic-secondary); font:inherit; font-weight:900; cursor:pointer; }
.users-add-btn { background:linear-gradient(135deg,#188a68,#168456); box-shadow:0 8px 18px rgba(24,138,104,.18); }
.users-admin-alert { width:min(760px,100%); margin:0 auto; }
.users-admin-group { overflow:hidden; padding:0; border-radius:26px; }
.users-admin-group > header { display:flex; padding:18px 22px; align-items:center; gap:10px; border-bottom:1px solid rgba(var(--clinic-primary-rgb),.15); background:linear-gradient(135deg,rgba(255,255,255,.32),rgba(var(--clinic-primary-rgb),.1)); }
.users-admin-group h2 { margin:0; color:#143d55; }
.users-admin-group > header b { display:grid; min-width:30px; height:30px; place-items:center; border-radius:50%; color:#fff; background:var(--clinic-accent-strong); }
.users-admin-table-wrap { overflow:auto; }
.users-admin-table { width:100%; border-collapse:collapse; color:#173d50; }
.users-admin-table th,.users-admin-table td { padding:15px 14px; text-align:right; border-bottom:1px solid rgba(46,104,132,.12); vertical-align:middle; }
.users-admin-table th { color:#345c70; background:var(--clinic-primary-soft); font-size:0.8125rem; }
.users-admin-table td strong { display:block; }
.users-admin-table td small { color:var(--clinic-accent-strong); font-weight:800; }
.users-role-badge,.users-status-badge { display:inline-flex; min-height:30px; padding:4px 11px; align-items:center; border-radius:999px; font-size:0.75rem; font-weight:900; }
.users-role-badge.is-doctor { color:#185d99; background:#dceeff; }
.users-role-badge.is-secretary { color:#3d6a24; background:#e7f6d8; }
.users-status-badge.is-active { color:#16744c; background:#dff7e9; }
.users-status-badge.is-blocked { color:#a33847; background:#ffe1e5; }
.users-setting-toggle { margin:0; }
.users-setting-toggle label { display:inline-flex; align-items:center; gap:8px; cursor:pointer; user-select:none; }
.users-setting-toggle input { position:absolute; width:1px; height:1px; opacity:0; pointer-events:none; }
.users-setting-toggle label > span { position:relative; width:46px; height:25px; flex:0 0 46px; border-radius:999px; background:#d85b68; box-shadow:inset 0 2px 5px rgba(72,20,29,.2); transition:.2s ease; }
.users-setting-toggle label > span::after { content:""; position:absolute; top:3px; right:3px; width:19px; height:19px; border-radius:50%; background:#fff; box-shadow:0 2px 5px rgba(20,49,63,.28); transition:.2s ease; }
.users-setting-toggle input:checked + span { background:#269264; }
.users-setting-toggle input:checked + span::after { transform:translateX(-21px); }
.users-setting-toggle input:focus-visible + span { outline:3px solid var(--clinic-accent-strong); outline-offset:2px; }
.users-setting-toggle b { min-width:42px; color:#a33847; font-size:0.75rem; font-weight:900; }
.users-setting-toggle input:checked ~ b { color:#16744c; }
.users-row-actions { display:flex; align-items:center; flex-wrap:wrap; gap:7px; }
.users-row-actions form { margin:0; }
.users-row-actions button { min-height:34px; padding:5px 11px; border:0; border-radius:9px; color:#fff; font:inherit; font-size:0.75rem; font-weight:900; cursor:pointer; }
.users-password-btn { background:#257baa; }
.users-block-btn { background:#d64f61; }
.users-unblock-btn { background:#269264; }
.users-discount-off-btn { background:#d9822b; }
.users-discount-on-btn { background:var(--clinic-primary); }
[data-booking-discount][hidden],
[data-attendance-discount][hidden] { display:none !important; }
.users-no-action { color:#83939b; font-size:0.75rem; }
.users-admin-modal[hidden] { display:none; }
.users-admin-modal { position:fixed; inset:0; z-index:120; display:grid; padding:20px; place-items:center; direction:rtl; }
.users-modal-backdrop { position:absolute; inset:0; width:100%; height:100%; border:0; background:rgba(4,28,43,.56); backdrop-filter:blur(5px); }
.users-modal-card { position:relative; z-index:1; display:grid; width:min(470px,100%); max-height:86vh; gap:17px; padding:25px; overflow:auto; border:1px solid rgba(255,255,255,.86); border-radius:28px; color:#173f53; background:linear-gradient(145deg,rgba(255,255,255,.98),var(--clinic-primary-soft)); box-shadow:0 24px 70px rgba(var(--clinic-shadow),.35),inset 0 1px 0 rgba(255,255,255,.9); }
.users-modal-card header { display:flex; justify-content:space-between; align-items:center; }
.users-modal-card > header { margin:-25px -25px 2px; padding:18px 22px; border-radius:27px 27px 18px 18px; background:linear-gradient(135deg,var(--clinic-accent-strong),var(--clinic-accent-strong)); box-shadow:0 10px 24px rgba(24,101,137,.2); }
.users-modal-card h2 { margin:0; color:#fff; font-size:1.5625rem; font-weight:900; }
.users-modal-card p { margin:0; color:#486b7c; font-weight:800; }
.users-modal-card header button { width:34px; height:34px; border:0; border-radius:50%; color:#fff; background:#d55162; font-size:1.375rem; cursor:pointer; }
.users-modal-card label { display:grid; gap:6px; color:#284e61; font-weight:800; }
.users-modal-card label span { margin:0; color:#284e61; font-size:0.875rem; font-weight:900; }
.users-modal-card input,.users-modal-card select { min-height:48px; padding:8px 13px; border:1px solid rgba(79,145,171,.38); border-radius:15px; color:#173f53; -webkit-text-fill-color:#173f53; font:inherit; background:rgba(255,255,255,.76); box-shadow:inset 0 1px 3px rgba(22,73,94,.06); }
.users-modal-card input:focus,.users-modal-card select:focus { border-color:var(--clinic-accent-strong); box-shadow:0 0 0 4px rgba(var(--clinic-accent-rgb),.14); outline:0; }
.users-modal-card footer { display:flex; justify-content:flex-end; gap:8px; }
.users-modal-card footer button { min-height:39px; padding:6px 15px; border:0; border-radius:10px; color:#fff; background:#788d97; font:inherit; font-weight:900; cursor:pointer; }
.users-modal-card footer button:last-child { background:var(--clinic-accent-strong); }
.chat-replies-fields { display:grid; gap:10px; }
.chat-reply-field { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:8px; }
.chat-reply-field label { min-width:0; }
.users-modal-card .chat-reply-remove { min-height:48px; padding:8px 14px; border:0; border-radius:13px; color:#fff; background:#d55162; font:inherit; font-weight:900; cursor:pointer; }
.users-modal-card .chat-replies-add { justify-self:start; min-height:42px; padding:7px 15px; border:0; border-radius:12px; color:#fff; background:#269264; font:inherit; font-weight:900; cursor:pointer; }
.users-create-card { width:min(620px,100%); }
.users-create-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:15px; }
.users-create-grid .is-full { grid-column:1/-1; }
.users-history-card { width:min(760px,100%); }
.users-history-list { display:grid; gap:9px; }
.users-history-list article { padding:14px 16px; border:1px solid rgba(var(--clinic-primary-rgb),.25); border-radius:17px; color:#173f53; background:linear-gradient(135deg,rgba(255,255,255,.78),var(--clinic-primary-soft)); }
.users-history-list article b { color:#195a80; }
.users-history-list article p { margin:4px 0; color:#284e61; }
.users-history-list article small { color:#71858f; }
.users-history-empty { padding:28px; color:#71858f; text-align:center; }
.permissions-shell { width:min(var(--x2-page-max-width),calc(100% - var(--x2-page-inline-space))); margin:0 auto; padding:25px 0 115px; direction:rtl; }
.permissions-heading { display:flex; align-items:center; min-height:145px; padding:27px 32px; border-radius:28px; }
.permissions-heading p { margin:0 0 4px; color:var(--clinic-accent-strong); font-weight:900; }
.permissions-heading h1 { margin:0; color:#173f53; font-size:2.125rem; }
.permissions-heading span { display:block; margin-top:6px; color:#607d8b; font-weight:700; }
.permissions-alert { width:min(760px,100%); margin:14px auto 0; }
.permissions-layout { display:grid; grid-template-columns:260px minmax(0,1fr); align-items:start; gap:18px; margin-top:18px; }
.permissions-users { display:grid; gap:8px; padding:18px; border-radius:24px; }
.permissions-users h2 { margin:0 0 6px; color:#173f53; }
.permissions-users a { display:grid; gap:2px; padding:12px 14px; border:1px solid rgba(53,129,160,.18); border-radius:14px; color:#24556c; text-decoration:none; background:rgba(255,255,255,.6); transition:.18s ease; }
.permissions-users a:hover,.permissions-users a.is-active { color:#fff; border-color:transparent; background:linear-gradient(135deg,var(--clinic-accent-strong),var(--clinic-accent-strong)); transform:translateY(-1px); }
.permissions-users a span { font-size:0.75rem; opacity:.82; }
.permissions-form { display:grid; gap:18px; padding:23px; border-radius:28px; }
.permissions-form > header { display:flex; align-items:center; justify-content:space-between; gap:15px; }
.permissions-form > header small { color:var(--clinic-accent-strong); font-weight:900; }
.permissions-form > header h2 { margin:2px 0 0; color:#173f53; font-size:1.6875rem; }
.permissions-global-actions { display:flex; flex-wrap:wrap; gap:7px; }
.permissions-global-actions button,.permissions-form legend button { border:0; border-radius:10px; padding:7px 11px; color:#fff; background:var(--clinic-accent-strong); font:inherit; font-size:0.75rem; font-weight:900; cursor:pointer; }
.permissions-global-actions button:last-child { background:#d55162; }
.permissions-groups { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.permissions-groups fieldset { min-width:0; margin:0; padding:15px; border:1px solid rgba(64,139,169,.25); border-radius:19px; background:rgba(255,255,255,.54); }
.permissions-groups legend { display:flex; width:100%; padding:0 4px 9px; align-items:center; justify-content:space-between; gap:8px; color:#174f6c; font-weight:900; }
.permissions-groups legend button { background:#6e8c99; }
.permissions-groups fieldset > div { display:grid; gap:8px; }
.permissions-groups label { display:flex; min-height:52px; padding:9px 11px; align-items:center; gap:10px; border:1px solid rgba(var(--clinic-primary-rgb),.17); border-radius:13px; cursor:pointer; background:rgba(var(--clinic-primary-rgb),.06); }
.permissions-groups input { width:20px; height:20px; flex:0 0 auto; accent-color:var(--clinic-accent-strong); }
.permissions-groups label span { display:grid; gap:1px; }
.permissions-groups label b { color:#244f63; }
.permissions-groups label small { color:#81949d; direction:ltr; text-align:right; font-size:0.625rem; }
.permissions-form > footer { display:flex; justify-content:flex-end; }
.permissions-form > footer button { min-width:170px; min-height:48px; border:0; border-radius:14px; color:#fff; background:linear-gradient(135deg,var(--clinic-accent-strong),var(--clinic-accent-strong)); font:inherit; font-weight:900; cursor:pointer; box-shadow:0 9px 22px rgba(var(--clinic-accent-rgb),.2); }
.dashboard-permission-alert { position:fixed; z-index:150; top:22px; left:50%; width:min(520px,calc(100% - 28px)); transform:translateX(-50%); }
@media (max-width:850px) { .permissions-layout { grid-template-columns:1fr; } .permissions-users { grid-template-columns:repeat(2,minmax(0,1fr)); } .permissions-users h2 { grid-column:1/-1; } }
@media (max-width:650px) { .permissions-shell { padding-inline:0; } .permissions-heading { padding:21px; } .permissions-heading h1 { font-size:1.75rem; } .permissions-form > header { align-items:flex-start; flex-direction:column; } .permissions-groups { grid-template-columns:1fr; } .permissions-users { grid-template-columns:1fr; } }
@media (max-width:760px) {
  .doctor-entry-toast-stack { bottom:82px; left:12px; }
  .users-admin-page .dashboard-canvas { padding:14px 0 110px; }
  .users-admin-heading { align-items:stretch; flex-direction:column; }
  .users-admin-heading h1 { font-size:1.75rem; }
  .users-heading-actions > button { flex:1; }
  .users-create-grid { grid-template-columns:1fr; }
  .users-create-grid .is-full { grid-column:auto; }
  .users-admin-table { min-width:1100px; }
}

.dock-item {
    position: relative;
    display: grid;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    place-items: center;
    gap: 0;
    padding: 3px 6px;
    border-radius: 14px;
    color: rgba(255, 255, 255, .78);
    text-decoration: none;
    border: 0;
    background: transparent;
    cursor: pointer;
    transition: transform .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease;
}

.dock-group {
    position: relative;
    min-width: 0;
}

.dock-menu {
    position: absolute;
    right: 50%;
    bottom: calc(100% + 18px);
    display: grid;
    width: 220px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, .44);
    border-radius: 20px;
    opacity: 0;
    pointer-events: none;
    background:
        linear-gradient(155deg, rgba(255, 255, 255, .34), rgba(255, 255, 255, .16)),
        rgba(15, 74, 116, .68);
    box-shadow: 0 20px 52px rgba(3, 31, 48, .28), inset 0 1px 0 rgba(255, 255, 255, .38);
    backdrop-filter: blur(22px);
    transform: translate(50%, 12px) scale(.96);
    transform-origin: bottom center;
    transition: opacity .18s ease, transform .18s ease;
}

.dock-menu::after {
    display: none;
}

.dock-group:hover .dock-menu,
.dock-group.is-open .dock-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translate(50%, 0) scale(1);
}

.dock-menu a {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 0 16px;
    border-radius: 14px;
    color: rgba(255, 255, 255, .88);
    font-size: 1.1875rem;
    font-weight: 800;
    text-decoration: none;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}

.dock-menu .menu-icon {
    flex: 0 0 auto;
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: .86;
}

.dock-menu a span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dock-menu a:hover {
    color: var(--clinic-primary-strong);
    background: linear-gradient(135deg, #ffffff, var(--clinic-primary-soft));
    transform: translateX(-4px);
}

.dock-item svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dock-item span {
    max-width: 100%;
    overflow: visible;
    font-size: 1.0625rem;
    font-weight: 800;
    line-height: 1.2;
    text-overflow: clip;
    white-space: nowrap;
}

.dock-item:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, .08);
}

.dock-item.is-active {
    color: var(--clinic-primary-strong);
    background: linear-gradient(135deg, #ffffff, var(--clinic-primary-soft));
    box-shadow: 0 14px 30px rgba(var(--clinic-primary-rgb), .22);
    transform: none;
}

.dock-group.is-home .dock-item {
    min-height: 52px;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 18px;
}

.dock-group.is-home .dock-item svg {
    width: 25px;
    height: 25px;
    stroke-width: 2.1;
}

.dock-group.is-home .dock-item span {
    font-size: 1.0625rem;
    font-weight: 900;
}

.dock-group.is-home .dock-item.is-active {
    color: var(--clinic-primary-strong);
    background:
        radial-gradient(circle at 30% 18%, rgba(255, 255, 255, .95), transparent 34%),
        linear-gradient(135deg, #ffffff, var(--clinic-primary-soft) 58%, rgba(var(--clinic-accent-rgb), .32));
    box-shadow: 0 14px 30px rgba(var(--clinic-primary-rgb), .28), 0 0 0 6px rgba(255, 255, 255, .12);
    transform: none;
}

.dock-item.is-active::after {
    display: none;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 96px;
    padding: 18px 22px;
    border-radius: 24px;
}

.topbar h1,
.welcome-panel h2,
.quick-panel h2 {
    margin-bottom: 0;
    font-weight: 900;
}

.logout-link {
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 14px;
    text-decoration: none;
    font-weight: 800;
    background: rgba(255, 255, 255, .2);
}

.hero-grid,
.stats-grid {
    display: grid;
    gap: 18px;
    margin-top: 18px;
}

.hero-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
}

.welcome-panel,
.quick-panel,
.stat-card {
    padding: 24px;
    border-radius: 24px;
}

.welcome-panel p {
    max-width: 640px;
    color: rgba(248, 251, 255, .8);
    line-height: 1.9;
}

.quick-actions {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.quick-actions button {
    min-height: 48px;
    border: 1px solid rgba(255, 255, 255, .26);
    border-radius: 14px;
    color: #f8fbff;
    background: rgba(255, 255, 255, .2);
    cursor: pointer;
    font-weight: 800;
}

.stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-card span {
    display: block;
    color: rgba(248, 251, 255, .74);
    font-weight: 700;
}

.stat-card strong {
    display: block;
    margin-top: 8px;
    font-size: 2.625rem;
    font-weight: 900;
}

.patient-page {
    width: min(var(--x2-page-max-width), calc(100% - var(--x2-page-inline-space)));
    margin: 0 auto;
    padding: 22px 0 120px;
}

.patient-tabs,
.summary-tabs {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}

.patient-tabs {
    grid-template-columns: 1fr 1fr;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, .46);
    border-radius: 14px;
    background: rgba(255, 255, 255, .36);
    box-shadow: 0 12px 36px rgba(3, 31, 48, .16);
    backdrop-filter: blur(18px);
}

.patient-tab,
.summary-tabs button {
    min-height: 44px;
    border: 0;
    border-radius: 10px;
    color: rgba(255, 255, 255, .84);
    background: rgba(36, 62, 144, .76);
    cursor: pointer;
    font-weight: 900;
}

.patient-tab.is-active {
    color: #ffffff;
    background: linear-gradient(135deg, var(--clinic-primary), var(--clinic-secondary));
}
.secretariat-page > .patient-tabs .patient-tab { display:flex; align-items:center; justify-content:center; gap:9px; }
.secretariat-page > .patient-tabs .patient-tab svg { width:22px; height:22px; flex:0 0 22px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }

.patient-form,
.patient-summary {
    padding: 18px;
    border-radius: 16px;
}

.patient-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 900;
}

.patient-section-title::before {
    flex: 1;
    height: 3px;
    border-radius: 999px;
    content: "";
    background: linear-gradient(90deg, transparent, var(--clinic-secondary));
}

.patient-section-title span {
    flex: 0 0 auto;
}

.patient-grid .patient-section-title {
    grid-column: 1 / -1;
    margin-top: 4px;
    margin-bottom: 0;
}

.patient-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}

.patient-grid label {
    min-width: 0;
}

.patient-grid .wide {
    grid-column: span 2;
}

.patient-grid .full {
    grid-column: 1 / -1;
}

.patient-panel {
    display: none;
}

.patient-panel.is-active {
    display: block;
}

.patient-notes-field {
    display: block;
}

.patient-form:has([data-patient-panel="notes"].is-active) .patient-actions {
    display: none;
}

.general-note-actions {
    display: grid;
    margin-top: 14px;
}

.patient-notes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, .38);
    border-radius: 16px;
    outline: none;
    resize: vertical;
    color: #f8fbff;
    background: rgba(4, 36, 46, .26);
    font: inherit;
}

textarea:focus {
    border-color: var(--clinic-accent-strong);
    box-shadow: 0 0 0 4px rgba(var(--clinic-accent-rgb), .14);
}

.patient-check {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, .34);
    border-radius: 16px;
    background: rgba(4, 36, 46, .2);
}

.patient-check input {
    width: 18px;
    min-height: 18px;
    accent-color: var(--clinic-accent-strong);
}

.patient-check span {
    margin: 0;
    font-size: 0.9375rem;
}

.patient-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
}

.patient-actions .full {
    grid-column: 1 / -1;
}

.secondary-btn {
    min-height: 54px;
    border: 0;
    border-radius: 16px;
    color: #ffffff;
    background: linear-gradient(135deg, #48d29c, #61ddb1);
    box-shadow: 0 18px 36px rgba(43, 196, 139, .22);
    cursor: pointer;
    font-weight: 900;
}

.patient-summary {
    margin-top: 18px;
}

.summary-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.summary-tabs button:first-child {
    color: #1c2a54;
    background: rgba(255, 255, 255, .86);
}

.patient-alert {
    margin-bottom: 14px;
}

.alert.is-dismissing {
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity .25s ease, transform .25s ease;
}

.patients-list-page {
    display: grid;
    gap: 16px;
    width: min(var(--x2-page-max-width), calc(100% - var(--x2-page-inline-space)));
    margin: 0 auto;
    padding: 18px 0 110px;
}

.patients-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px;
    border-radius: 16px;
}

.patients-list-header span {
    color: var(--clinic-secondary);
    font-size: 1.0625rem;
    font-weight: 900;
}

.patients-list-header h1 {
    margin: 4px 0 0;
    color: #102833;
    font-size: clamp(1.875rem, 4vw, 2.875rem);
}

.patients-list-header .secondary-btn {
    display: inline-flex;
    width: auto;
    min-width: 190px;
    padding: 0 20px;
    align-items: center;
    justify-content: center;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
}

.patients-list-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.patients-list-stats article {
    display: grid;
    gap: 8px;
    padding: 16px;
    border-radius: 14px;
}

.patients-list-stats span {
    color: #50606a;
    font-size: 1rem;
    font-weight: 800;
}

.patients-list-stats strong {
    color: var(--clinic-primary-deep);
    font-size: 2.125rem;
    font-weight: 900;
}

.patients-list-card {
    padding: 16px;
    border-radius: 16px;
}

.patients-list-tools {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 160px 130px auto;
    align-items: end;
    gap: 14px;
    margin-bottom: 14px;
}

.patients-list-tools label {
    display: grid;
    gap: 6px;
}

.patients-list-tools span {
    color: #40515b;
    font-weight: 900;
}

.patients-list-tools .dark-btn {
    min-height: 48px;
}

#patientsListCount {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 18px;
    border-radius: 12px;
    color: #ffffff;
    background: var(--clinic-primary-strong);
}

.patients-list-table-wrap {
    overflow: auto;
    border: 1px solid rgba(53, 89, 117, .28);
    border-radius: 12px;
}

.patients-list-table {
    width: 100%;
    min-width: 980px;
    border-collapse: collapse;
    background: rgba(255, 255, 255, .66);
}

.patients-list-table th,
.patients-list-table td {
    padding: 12px 10px;
    border: 1px solid rgba(53, 89, 117, .22);
    color: #102833;
    font-size: 1rem;
    font-weight: 800;
    text-align: center;
    vertical-align: middle;
}

.patients-list-table th {
    background: #c9e6f6;
    font-weight: 900;
}

.patients-list-table td strong,
.patients-list-table td small {
    display: block;
}

.patients-list-table td small {
    margin-top: 4px;
    color: #66757d;
    font-size: 0.8125rem;
}

.patients-list-table a {
    color: var(--clinic-primary-deep);
    font-weight: 900;
    text-decoration: none;
}

.patients-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 14px;
}

.patients-pagination a,
.patients-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 12px;
    font-weight: 900;
}

.patients-pagination a {
    color: #ffffff;
    background: var(--clinic-primary-strong);
    text-decoration: none;
}

.patients-pagination a.is-disabled {
    pointer-events: none;
    opacity: .45;
}

.patients-pagination span {
    color: #102833;
    background: rgba(255, 255, 255, .72);
}

.drugs-source-note {
    padding: 10px 14px;
    border: 1px solid rgba(53, 89, 117, .2);
    border-radius: 12px;
    color: #40515b;
    background: rgba(255, 255, 255, .66);
    font-weight: 900;
}

.patients-list-stats.drugs-directory-stats {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.drugs-directory-stats article {
    width: 100%;
    min-width: 0;
}

.drugs-directory-tools {
    grid-template-columns: minmax(300px, 1fr) 160px 110px auto;
}

#drugsCount {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 18px;
    border-radius: 12px;
    color: #ffffff;
    background: var(--clinic-primary-strong);
    white-space: nowrap;
}

.drugs-directory-table {
    min-width: 1260px;
}

.drugs-directory-table th:first-child {
    width: 240px;
}

.drugs-directory-table th:nth-child(2) {
    width: 330px;
}

.drugs-directory-table td {
    overflow-wrap: anywhere;
}

.drugs-directory-table td strong,
.drugs-directory-table td small {
    display: block;
}

.drugs-directory-table td small {
    margin-top: 5px;
    color: #52636d;
}

.drugs-directory-table .drugs-empty {
    padding: 34px 16px;
    text-align: center;
}

.appointments-page {
    width: min(var(--x2-page-max-width), calc(100% - var(--x2-page-inline-space)));
    margin: 0 auto;
    padding: 18px 0 120px;
}

.appointments-card {
    padding: 18px;
    border-radius: 16px;
}

.appointments-title {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
    color: #ffffff;
    font-size: 1.75rem;
    font-weight: 900;
}

.appointments-title::before {
    flex: 1;
    height: 4px;
    border-radius: 999px;
    content: "";
    background: linear-gradient(90deg, transparent, var(--clinic-secondary));
}

.finished-toggle {
    min-height: 38px;
    display: inline-grid;
    place-items: center;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, .45);
    border-radius: 999px;
    color: #14313c;
    background: rgba(255, 255, 255, .72);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 900;
    white-space: nowrap;
}

.finished-toggle.is-active {
    color: #ffffff;
    background: linear-gradient(135deg, var(--clinic-primary-deep), var(--clinic-primary));
}

.appointments-toolbar,
.calendar-toolbar {
    display: grid;
    grid-template-columns: 220px 220px 220px 220px;
    gap: 12px;
    align-items: center;
    justify-content: end;
    margin-bottom: 16px;
}

.calendar-toolbar {
    grid-template-columns: 1fr auto 1fr;
}

.calendar-toolbar strong {
    color: #0d2630;
    font-size: 2.125rem;
    font-weight: 900;
    text-align: center;
}

.date-nav,
.view-switcher {
    display: flex;
    align-items: center;
    gap: 6px;
}

.date-nav a,
.view-switcher a,
.date-nav button {
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid rgba(9, 43, 54, .14);
    border-radius: 8px;
    color: #283740;
    background: rgba(255, 255, 255, .76);
    text-decoration: none;
    cursor: pointer;
    font-weight: 800;
}

.date-nav button {
    color: #ffffff;
    background: #d71914;
}

.view-switcher {
    justify-content: end;
}

.view-switcher a.is-active {
    color: #062d38;
    background: #c8d2da;
    box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .1);
}

.calendar-grid {
    display: grid;
    grid-template-columns: 62px repeat(var(--days), minmax(190px, 1fr));
    overflow: auto;
    border: 1px solid rgba(10, 42, 54, .14);
    border-radius: 12px;
    background: rgba(255, 255, 255, .82);
}

.calendar-corner,
.calendar-day-head,
.calendar-time,
.calendar-slot {
    border-left: 1px solid rgba(10, 42, 54, .12);
    border-bottom: 1px solid rgba(10, 42, 54, .1);
}

.calendar-day-head {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    min-width: 190px;
    color: #172832;
    background: rgba(255, 255, 255, .92);
    text-align: center;
}

.calendar-day-head strong {
    grid-column: 1 / -1;
    padding: 7px;
    border-bottom: 1px solid rgba(10, 42, 54, .1);
}

.calendar-day-head span {
    padding: 6px;
    font-weight: 900;
}

.calendar-time {
    display: grid;
    min-height: 72px;
    place-items: start center;
    padding-top: 14px;
    color: #344b56;
    background: rgba(255, 255, 255, .9);
    font-size: 1.125rem;
    font-weight: 800;
}

.calendar-slot {
    position: relative;
    min-height: 72px;
    background: rgba(255, 246, 202, .58);
}

.calendar-slot::before {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    left: 0;
    content: "";
    background:
        linear-gradient(to left,
            transparent calc(25% - 1px),
            rgba(10, 42, 54, .18) calc(25% - 1px),
            rgba(10, 42, 54, .18) 25%,
            transparent 25%,
            transparent calc(50% - 1px),
            rgba(10, 42, 54, .18) calc(50% - 1px),
            rgba(10, 42, 54, .18) 50%,
            transparent 50%,
            transparent calc(75% - 1px),
            rgba(10, 42, 54, .18) calc(75% - 1px),
            rgba(10, 42, 54, .18) 75%,
            transparent 75%);
    pointer-events: none;
}

.calendar-slot.is-drop-target {
    outline: 2px solid rgba(85, 199, 159, .35);
    outline-offset: -2px;
}

.calendar-slot.is-drop-target::after {
    position: absolute;
    top: 4px;
    bottom: 4px;
    width: calc(25% - 8px);
    border-radius: 6px;
    content: "";
    background: rgba(65, 165, 94, .32);
    box-shadow: inset 0 0 0 2px rgba(65, 165, 94, .42);
    pointer-events: none;
}

.calendar-slot.drop-period-00-15::after {
    right: 4px;
}

.calendar-slot.drop-period-15-30::after {
    right: calc(25% + 4px);
}

.calendar-slot.drop-period-30-45::after {
    right: calc(50% + 4px);
}

.calendar-slot.drop-period-45-60::after {
    right: calc(75% + 4px);
}

.appointment-pill {
    position: absolute;
    top: 8px;
    right: var(--period-right, 2%);
    left: auto;
    width: 22%;
    min-height: 52px;
    padding: 10px 14px;
    border-radius: 5px;
    color: #072315;
    background: linear-gradient(135deg, #3f965c, #79c993);
    box-shadow: 0 8px 18px rgba(44, 126, 76, .18);
    font-size: 1.125rem;
    font-weight: 900;
    cursor: grab;
    user-select: none;
    z-index: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.appointment-pill.is-split {
    width: 10.5%;
    padding-inline: 8px;
    font-size: 0.9375rem;
}

.appointment-pill.is-split.lane-1 {
    right: calc(var(--period-right, 2%) + 11.5%);
}

.appointment-pill:active {
    cursor: grabbing;
}

.appointment-pill.is-dragging {
    opacity: .55;
}

.appointment-pill.period-00-15 {
    --period-right: 2%;
}

.appointment-pill.period-15-30 {
    --period-right: 26%;
}

.appointment-pill.period-30-45 {
    --period-right: 52%;
}

.appointment-pill.period-45-60 {
    --period-right: 76%;
}

.booking-modal[hidden] {
    display: none;
}

.booking-modal {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    padding: 24px;
}

.booking-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .52);
    backdrop-filter: blur(4px);
}

.booking-dialog {
    position: relative;
    z-index: 1;
    width: min(920px, 100%);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .58);
    border-radius: 14px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 28px 90px rgba(0, 0, 0, .32);
}

.booking-head {
    padding: 24px 26px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, .08);
}

.booking-head h2 {
    margin: 0;
    color: #172832;
    font-size: 1.875rem;
    font-weight: 900;
}

.booking-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 22px 24px;
}

.booking-grid label span {
    color: #5d6b72;
}

.booking-grid label {
    position: relative;
}

.booking-grid input,
.booking-grid select,
.booking-grid textarea {
    color: #1a2a32;
    background: #ffffff;
    border-color: rgba(10, 42, 54, .14);
}

.patient-search {
    margin-bottom: 8px;
}

.patient-search-results {
    position: absolute;
    top: calc(100% - 2px);
    right: 0;
    left: 0;
    z-index: 45;
    max-height: 180px;
    overflow: auto;
    border: 1px solid rgba(10, 42, 54, .12);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 14px 34px rgba(10, 42, 54, .14);
}

.patient-search-results[hidden] {
    display: none;
}

.patient-search-results button {
    display: flex;
    width: 100%;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid rgba(10, 42, 54, .08);
    color: #1a2a32;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    font-weight: 800;
    text-align: right;
}

.patient-search-results button:hover {
    background: rgba(85, 199, 159, .12);
}

.patient-search-results span {
    color: #66757d;
    font-weight: 700;
}

.booking-grid .full {
    grid-column: 1 / -1;
}

.modal-close {
    border: 0;
    color: #263942;
    background: transparent;
    cursor: pointer;
    font-size: 1.125rem;
    font-weight: 800;
}

.booking-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 24px 22px;
}

.danger-btn {
    min-height: 44px;
    padding: 0 22px;
    border: 0;
    border-radius: 10px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--clinic-primary-deep), var(--clinic-primary));
    cursor: pointer;
    font-weight: 900;
}

.attendance-page {
    width: min(var(--x2-page-max-width), calc(100% - var(--x2-page-inline-space)));
    margin: 0 auto;
    padding: 18px 0 120px;
}

.attendance-card {
    padding: 18px;
    border-radius: 16px;
}

.attendance-toolbar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
    align-items: center;
    margin-bottom: 18px;
}

.attendance-toolbar > * {
    min-width: 0;
    width: 100%;
}

.attendance-link {
    display: grid;
    place-items: center;
    text-decoration: none;
}

.service-admin-form {
    display: grid;
    grid-template-columns: 1fr 1.4fr 1fr auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 18px;
}

.service-admin-form label {
    display: grid;
    gap: 6px;
    color: #5b6870;
    font-weight: 900;
}

.service-admin-table-wrap {
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, .42);
    border-radius: 10px;
    background: rgba(255, 255, 255, .88);
}

.service-admin-table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
    color: #112c38;
}

.service-admin-table th,
.service-admin-table td {
    padding: 10px 12px;
    border: 1px solid rgba(29, 82, 104, .24);
    text-align: center;
}

.service-admin-table th {
    background: #c9e6f6;
    font-weight: 900;
}

.daily-account-page {
    width: min(var(--x2-page-max-width), calc(100% - var(--x2-page-inline-space)));
    margin: 0 auto;
    padding: 18px 0 120px;
}

.daily-account-card {
    padding: 20px;
    border-radius: 16px;
}

.daily-account-filters {
    display: grid;
    grid-template-columns: .9fr 1fr 1fr 110px 110px;
    gap: 10px;
    align-items: center;
    margin-bottom: 18px;
}
.daily-account-filters > button,.daily-account-filters > a { display:flex; align-items:center; justify-content:center; width:100%; min-height:54px; padding:0 18px; font-size:1rem; white-space:nowrap; }

.daily-account-grid {
    display: grid;
    grid-template-columns: .8fr 1.6fr;
    gap: 24px;
    align-items: start;
}

.daily-account-section h2 {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: center;
    margin: 0 0 8px;
    color: #313b44;
    font-size: 1.5rem;
}

.daily-account-section h2::after {
    height: 3px;
    border-radius: 999px;
    background: var(--clinic-secondary);
    content: "";
}

.daily-account-table-wrap {
    overflow: auto;
    border: 1px solid rgba(53, 89, 117, .32);
    background: rgba(255, 255, 255, .9);
}

.daily-account-table {
    width: 100%;
    border-collapse: collapse;
    color: #263942;
}

.daily-account-table th,
.daily-account-table td {
    padding: 8px 10px;
    border: 1px solid rgba(53, 89, 117, .32);
    text-align: right;
    font-weight: 800;
}

.daily-account-table th {
    background: #c9e6f6;
    font-weight: 900;
}

/* Clinic statistics */
.clinic-stats-page { width:min(var(--x2-page-max-width),calc(100% - var(--x2-page-inline-space))); margin:18px auto 120px; direction:rtl; color:#263f4a; }
.clinic-stats-header { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:24px 28px; overflow:hidden; border:1px solid rgba(255,255,255,.72); border-radius:26px; background:linear-gradient(145deg,rgba(244,252,255,.82),rgba(205,235,245,.62)); box-shadow:0 18px 48px rgba(17,67,91,.16),inset 0 1px 0 rgba(255,255,255,.78); }
.clinic-stats-header span { color:var(--clinic-primary); font-weight:900; }
.clinic-stats-header h1 { margin:3px 0; font-size:1.875rem; }
.clinic-stats-header p { margin:0; color:#6c7d85; }
.clinic-stats-header > a { display:inline-flex; min-width:130px; min-height:46px; padding:0 18px; flex:0 0 auto; align-items:center; justify-content:center; border-radius:14px; color:#fff; background:var(--clinic-primary); box-shadow:0 9px 20px rgba(var(--clinic-primary-rgb),.2); font-weight:900; text-decoration:none; }
.clinic-stats-filters { display:grid; grid-template-columns:1.1fr repeat(4,minmax(150px,1fr)) 170px; gap:11px; margin-top:14px; padding:18px; align-items:end; overflow:hidden; border:1px solid rgba(255,255,255,.7); border-radius:22px; background:linear-gradient(145deg,rgba(244,252,255,.78),rgba(207,237,246,.58)); box-shadow:0 14px 36px rgba(17,67,91,.13),inset 0 1px 0 rgba(255,255,255,.72); }
.clinic-stats-filters label { display:grid; gap:5px; }
.clinic-stats-filters label > span { color:#607079; font-size:0.75rem; font-weight:800; }
.clinic-stats-filters select,.clinic-stats-filters input { width:100%; min-height:48px; padding:8px 11px; border:1px solid #c3d6de; border-radius:13px; outline:none; color:#263f4a; background:rgba(255,255,255,.94); font:inherit; }
.clinic-stats-filters select:focus,.clinic-stats-filters input:focus { border-color:var(--clinic-accent-strong); box-shadow:0 0 0 3px rgba(var(--clinic-accent-rgb),.12); }
.clinic-stats-filters button { min-height:48px; border:0; border-radius:13px; color:#fff; background:var(--clinic-primary); box-shadow:0 9px 20px rgba(var(--clinic-primary-rgb),.2); font:inherit; font-weight:900; cursor:pointer; }
.clinic-stats-cards { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin-top:12px; }
.clinic-stats-cards article { min-height:128px; padding:19px; overflow:hidden; border:1px solid rgba(255,255,255,.78); border-radius:20px; background:linear-gradient(145deg,rgba(255,255,255,.94),rgba(228,242,247,.86)); box-shadow:0 12px 30px rgba(35,65,78,.11),inset 0 1px 0 rgba(255,255,255,.78); }
.clinic-stats-cards span,.clinic-stats-cards small { display:block; color:#6b7b83; font-weight:700; }
.clinic-stats-cards strong { display:block; margin:7px 0 4px; color:var(--clinic-primary-strong); font-size:1.6875rem; }
.clinic-stats-cards .is-danger strong { color:#d94d61; }
.clinic-stats-cards .is-money { color:#fff; background:linear-gradient(135deg,var(--clinic-primary),var(--clinic-secondary)); }
.clinic-stats-cards .is-money span,.clinic-stats-cards .is-money strong,.clinic-stats-cards .is-money small { color:#fff; }
.clinic-stats-revenue { display:grid; grid-template-columns:repeat(3,1fr); gap:1px; margin-top:12px; overflow:hidden; border:1px solid rgba(255,255,255,.72); border-radius:22px; box-shadow:0 14px 34px rgba(17,67,91,.13); }
.clinic-stats-revenue > div { padding:18px 22px; background:rgba(255,255,255,.76); }
.clinic-stats-revenue span { display:block; color:#718088; }
.clinic-stats-revenue strong { display:block; margin-top:5px; color:var(--clinic-primary-strong); font-size:1.4375rem; }
.clinic-stats-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-top:12px; }
.clinic-stats-panel { min-width:0; padding:20px; overflow:hidden; border:1px solid rgba(255,255,255,.72); border-radius:22px; background:linear-gradient(145deg,rgba(244,252,255,.8),rgba(207,237,246,.6)); box-shadow:0 14px 36px rgba(17,67,91,.13),inset 0 1px 0 rgba(255,255,255,.75); }
.clinic-stats-panel h2 { margin:0 0 16px; color:#314a55; font-size:1.25rem; }
.clinic-stats-bars { display:grid; gap:13px; }
.clinic-stats-bars > p { margin:0; padding:20px; color:#718088; text-align:center; }
.clinic-stats-bars article header { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:5px; }
.clinic-stats-bars article header span { color:#667780; font-size:0.75rem; font-weight:800; }
.clinic-stats-bars article > div { height:8px; overflow:hidden; border-radius:9px; background:#e7edf0; }
.clinic-stats-bars article i { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg,var(--clinic-primary),var(--clinic-accent)); }
.clinic-stats-daily { margin-top:12px; }
.clinic-stats-daily .daily-account-table-wrap { overflow:auto; border:1px solid rgba(117,150,164,.22); border-radius:15px; background:rgba(255,255,255,.72); }

@media (max-width:1050px) {
    .clinic-stats-filters { grid-template-columns:repeat(3,minmax(0,1fr)); }
    .clinic-stats-cards { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

@media (max-width:650px) {
    .clinic-stats-page { width:min(var(--x2-page-max-width),calc(100% - var(--x2-page-inline-space))); margin-top:8px; }
    .clinic-stats-header { align-items:flex-start; padding:17px; flex-direction:column; }
    .clinic-stats-header h1 { font-size:1.5625rem; }
    .clinic-stats-filters,.clinic-stats-cards,.clinic-stats-grid,.clinic-stats-revenue { grid-template-columns:1fr; }
    .clinic-stats-bars article header { align-items:flex-start; flex-direction:column; }
}

.daily-total {
    display: block;
    margin-top: 12px;
    color: #333b43;
    font-size: 1.375rem;
}

.daily-grand-total {
    display: block;
    margin-top: 20px;
    color: #333b43;
    font-size: 1.5rem;
    text-align: center;
}
.daily-discounts-toggle { display:flex; align-items:center; justify-content:center; gap:9px; width:100%; min-height:50px; margin-top:20px; border:0; border-radius:12px; color:#fff; background:linear-gradient(135deg,var(--clinic-primary),var(--clinic-secondary)); font:inherit; font-weight:900; cursor:pointer; }
.daily-discounts-toggle span { display:inline-grid; place-items:center; min-width:27px; height:27px; border-radius:20px; background:rgba(255,255,255,.2); }
.daily-discounts-toggle::after { content:'+'; font-size:1.375rem; }
.daily-discounts-toggle.is-open::after { content:'−'; }
.daily-discounts-section { margin-top:14px; padding:15px; border:1px solid rgba(var(--clinic-primary-rgb),.22); border-radius:12px; background:rgba(255,255,255,.42); }
.daily-discounts-section[hidden] { display:none; }

.reception-screen {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 10px;
    width: min(var(--x2-page-max-width), calc(100% - var(--x2-page-inline-space)));
    margin: 0 auto;
    height: calc(100vh - 18px);
    padding: 10px 0 0;
    overflow: hidden;
}

.reception-home-link {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 30;
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .42);
    border-radius: 18px;
    color: #ffffff;
    background: rgba(var(--clinic-primary-strong-rgb), .42);
    box-shadow: 0 14px 36px rgba(10, 25, 44, .18);
    opacity: .42;
    text-decoration: none;
    backdrop-filter: blur(14px);
    transition: opacity .18s ease, transform .18s ease;
}

.reception-settings-link {
    position: fixed;
    right: 18px;
    bottom: 84px;
    z-index: 30;
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .42);
    border-radius: 18px;
    color: #ffffff;
    background: rgba(var(--clinic-primary-strong-rgb), .38);
    box-shadow: 0 14px 36px rgba(10, 25, 44, .18);
    opacity: .42;
    cursor: pointer;
    backdrop-filter: blur(14px);
    transition: opacity .18s ease, transform .18s ease;
}

.reception-settings-link:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.reception-settings-link svg {
    width: 30px;
    height: 30px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.reception-home-link:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.reception-home-link svg {
    width: 30px;
    height: 30px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.reception-header,
.reception-filters,
.reception-now,
.reception-next,
.reception-current-list,
.reception-queue {
    border-radius: 14px;
}

.reception-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 22px;
    margin-bottom: 0;
}

.reception-kicker {
    color: var(--clinic-secondary);
    font-size: 1.125rem;
    font-weight: 900;
}

.reception-header h1 {
    margin: 6px 0 0;
    color: #102833;
    font-size: clamp(1.625rem, 3.4vw, 2.875rem);
}

.reception-clock {
    display: grid;
    gap: 4px;
    min-width: 220px;
    padding: 10px 18px;
    border-radius: 12px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--clinic-primary-deep), var(--clinic-primary));
    text-align: center;
}

.reception-clock span {
    font-size: clamp(1.625rem, 3.4vw, 2.5rem);
    font-weight: 900;
}

.reception-clock small {
    font-size: 1rem;
    font-weight: 800;
}

.reception-filters {
    position: fixed;
    top: 18px;
    right: 18px;
    left: 18px;
    z-index: 25;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 0;
}

.reception-filters[hidden] {
    display: none;
}

.reception-filters label {
    display: grid;
    gap: 6px;
    color: #4a5a63;
    font-weight: 900;
}

.reception-hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 0;
}

.reception-now,
.reception-next {
    display: grid;
    gap: 8px;
    min-height: 190px;
    place-items: center;
    padding: 18px;
    text-align: center;
}

.reception-now span,
.reception-next span {
    color: #4d5b65;
    font-size: 1.375rem;
    font-weight: 900;
}

.reception-now strong,
.reception-next strong {
    display: grid;
    width: 96px;
    height: 96px;
    place-items: center;
    border-radius: 999px;
    color: #ffffff;
    background: var(--clinic-secondary);
    font-size: 2.875rem;
    font-weight: 900;
}

.reception-next strong {
    background: #10a15f;
}

.reception-next.is-emergency strong {
    background: #f04438;
}

.reception-next.is-emergency {
    box-shadow: 0 0 0 4px rgba(240, 68, 56, .28), 0 18px 50px rgba(240, 68, 56, .2);
}

.reception-now h2,
.reception-next h2 {
    margin: 0;
    color: #0d2430;
    font-size: clamp(1.625rem, 3.4vw, 2.625rem);
}

.reception-now p,
.reception-next p {
    margin: 0;
    color: #40515b;
    font-size: 1.375rem;
    font-weight: 900;
}

.reception-current-list {
    padding: 18px;
    margin-bottom: 16px;
}

.reception-current-list h2,
.reception-section-title h2 {
    margin: 0;
    color: #142b36;
    font-size: 1.75rem;
}

.reception-current-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.reception-current-grid article {
    display: grid;
    gap: 4px;
    padding: 12px;
    border-radius: 10px;
    color: #102833;
    background: rgba(201, 230, 246, .75);
}

.reception-current-grid strong {
    color: var(--clinic-secondary);
    font-size: 1.875rem;
}

.reception-current-grid span {
    font-size: 1.25rem;
    font-weight: 900;
}

.reception-queue {
    display: flex;
    min-height: 0;
    flex-direction: column;
    padding: 14px 18px;
}

.reception-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.reception-section-title span {
    color: var(--clinic-secondary);
    font-size: 1.25rem;
    font-weight: 900;
}

.reception-table-wrap {
    min-height: 0;
    overflow: hidden;
    border: 1px solid rgba(53, 89, 117, .32);
    border-radius: 10px;
    background: rgba(255, 255, 255, .9);
}

.reception-table {
    width: 100%;
    border-collapse: collapse;
    color: #102833;
}

.reception-table th,
.reception-table td {
    padding: 10px 12px;
    border: 1px solid rgba(53, 89, 117, .26);
    text-align: center;
    font-size: 1.25rem;
    font-weight: 900;
}

.reception-table th {
    background: #c9e6f6;
}

.reception-table tr.is-current td {
    background: #8a5cf6;
}

.reception-table tr.is-emergency td {
    color: #ffffff;
    background: #f04438;
}

.dark-btn {
    min-height: 54px;
    border: 0;
    border-radius: 16px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--clinic-primary-deep), var(--clinic-primary));
    cursor: pointer;
    font-weight: 900;
}

.attendance-table-wrap {
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, .42);
    border-radius: 10px;
    background: rgba(255, 255, 255, .88);
    direction: rtl;
}

.attendance-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    border-collapse: collapse;
    color: #112c38;
    direction: ltr;
}

.attendance-table th {
    padding: 8px 4px;
    border: 1px solid rgba(29, 82, 104, .35);
    background: #c9e6f6;
    font-size: 1.0625rem;
    font-weight: 900;
    direction: rtl;
    line-height: 1.25;
}

.attendance-table th:nth-child(5),
.attendance-table td:nth-child(5),
.attendance-table th:nth-child(6),
.attendance-table td:nth-child(6) {
    width: 5%;
    max-width: none;
}

.attendance-table th:nth-child(1),
.attendance-table td:nth-child(1),
.attendance-table th:nth-child(12),
.attendance-table td:nth-child(12) {
    width: 5%;
}

.attendance-table th:nth-child(2),
.attendance-table td:nth-child(2),
.attendance-table th:nth-child(3),
.attendance-table td:nth-child(3),
.attendance-table th:nth-child(4),
.attendance-table td:nth-child(4) {
    width: 8%;
}

.attendance-table th:nth-child(7),
.attendance-table td:nth-child(7) {
    width: 5%;
}

.attendance-table th:nth-child(8),
.attendance-table td:nth-child(8) {
    width: 8%;
}

.attendance-table th:nth-child(9),
.attendance-table td:nth-child(9) {
    width: 12%;
}

.attendance-table th:nth-child(10),
.attendance-table td:nth-child(10) {
    width: 11%;
}

.attendance-table th:nth-child(11),
.attendance-table td:nth-child(11) {
    width: 18%;
}

.attendance-table th.attendance-patient-column,
.attendance-table td.attendance-patient-column {
    width: 20%;
    overflow-wrap: normal;
    word-break: normal;
}

.attendance-table th.attendance-turn-column,
.attendance-table td.attendance-turn-column {
    width: 5%;
    white-space: nowrap;
}

.attendance-table td {
    padding: 7px 4px;
    border: 1px solid rgba(255, 255, 255, .45);
    background: #0774f2;
    color: #051f2a;
    font-size: 1.25rem;
    font-weight: 800;
    text-align: center;
    direction: rtl;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.attendance-table tr[data-state="booked"] td {
    background: #10a15f;
}

.attendance-table tr[data-state="attend"] td {
    background: #0879f2;
}

.attendance-table tr[data-state="doctor_entry"] td {
    background: #8a5cf6;
}

.attendance-table tr[data-state="followup_exam"] td {
    background: rgba(52, 211, 153, .13);
}

.attendance-table tr[data-state="exit"] td {
    background: #62c56f;
}

.attendance-table tr[data-state="emergency"] td {
    background: #f04438;
}

.attendance-table tr[data-state="cancelled"] td {
    background: #7b8794;
}

.attendance-table tr[data-state="exit"] td,
.attendance-table tr[data-state="cancelled"] td {
    opacity: .78;
}

.attendance-table select,
.attendance-table input {
    min-height: 34px;
    color: #172832;
    background: rgba(255, 255, 255, .88);
}

.attendance-status-control {
    min-width: 0;
    width: 100%;
    padding-inline: 8px;
}

.mini-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 32px;
    height: 32px;
    min-height: 0;
    padding: 4px;
    border: 0;
    border-radius: 8px;
    color: #ffffff;
    background: rgba(255, 255, 255, .82);
    cursor: pointer;
    font-weight: 800;
}

.mini-add img {
    display: block;
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.service-check {
    display: inline-grid;
    width: 26px;
    height: 26px;
    place-items: center;
    border-radius: 50%;
    color: #ffffff;
    background: #17b26a;
    font-size: 1.125rem;
    font-weight: 900;
    line-height: 1;
}

.service-count {
    display: inline-grid;
    min-width: 24px;
    height: 24px;
    margin-inline-start: 4px;
    place-items: center;
    border-radius: 999px;
    color: #0f5132;
    background: rgba(255, 255, 255, .84);
    font-weight: 900;
}

.upload-btn {
    min-height: 30px;
    padding: 0 12px;
    border: 0;
    border-radius: 6px;
    color: #54616a;
    background: #eef1f5;
    cursor: pointer;
    font-weight: 800;
}

.empty-attendance {
    padding: 22px !important;
    background: rgba(255, 255, 255, .86) !important;
    color: #34505b !important;
}

.attendance-modal[hidden] {
    display: none;
}

.service-modal[hidden] {
    display: none;
}

.service-modal,
.attendance-modal {
    position: fixed;
    inset: 0;
    z-index: 45;
    display: grid;
    place-items: center;
    padding: 18px;
    overflow: auto;
}

.service-dialog,
.attendance-dialog {
    position: relative;
    z-index: 1;
    width: min(520px, 100%);
    max-height: calc(100vh - 36px);
    overflow-y: auto;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, .52);
    border-radius: 16px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .92), rgba(255, 255, 255, .82)),
        #ffffff;
    box-shadow: 0 28px 80px rgba(var(--clinic-shadow), .34), 0 0 0 10px rgba(var(--clinic-primary-rgb), .86);
}

.service-dialog {
    width: min(760px, 100%);
}

.service-dialog .appointments-title,
.attendance-dialog .appointments-title {
    color: #1d2630;
    font-size: 1.75rem;
}

.service-form-grid,
.attendance-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.service-form-grid label span,
.attendance-form-grid label span {
    color: #7a8188;
}

.service-form-grid label,
.attendance-form-grid label {
    position: relative;
}

.service-form-grid input,
.service-form-grid select,
.service-form-grid textarea,
.attendance-form-grid input,
.attendance-form-grid select {
    color: #1a2a32;
    background: #ffffff;
    border-color: rgba(10, 42, 54, .14);
}

.service-form-grid textarea {
    min-height: 54px;
    resize: vertical;
}

.service-form-grid .full {
    grid-column: 1 / -1;
}

.service-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 12px;
}

.service-history-wrap {
    margin-top: 18px;
    overflow: auto;
    border: 1px solid rgba(var(--clinic-primary-rgb), .36);
    border-radius: 10px;
    background: #ffffff;
}

.lab-selected-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    padding: 10px;
    border: 1px solid rgba(var(--clinic-primary-rgb), .28);
    border-radius: 10px;
    background: rgba(244, 250, 255, .92);
}

.lab-selected-preview[hidden] {
    display: none;
}

.lab-selected-item {
    display: grid;
    gap: 6px;
    padding: 8px;
    border: 1px solid rgba(29, 82, 104, .18);
    border-radius: 8px;
    background: #ffffff;
}

.lab-selected-item img {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 6px;
    object-fit: cover;
}

.lab-selected-item span {
    overflow: hidden;
    color: #41515b;
    font-size: 0.75rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lab-selected-item button {
    min-height: 28px;
    border: 0;
    border-radius: 6px;
    color: #ffffff;
    background: #e96565;
    cursor: pointer;
    font-family: inherit;
    font-weight: 900;
}

.service-history-table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
    color: #2b3a42;
    direction: rtl;
}

.service-history-table th,
.service-history-table td {
    padding: 8px 10px;
    border: 1px solid rgba(29, 82, 104, .25);
    text-align: center;
}

.service-history-table th {
    color: #19303d;
    background: #c9e6f6;
    font-weight: 900;
}

.lab-thumb {
    width: 96px;
    height: 72px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid rgba(29, 82, 104, .22);
}

.lab-preview-link {
    display: inline-flex;
    border-radius: 6px;
    overflow: hidden;
}

.lab-delete-btn {
    min-height: 30px;
    padding: 0 12px;
    border: 0;
    border-radius: 6px;
    color: #ffffff;
    background: #e96565;
    cursor: pointer;
    font-family: inherit;
    font-weight: 900;
}

.patient-labs-page {
    display: grid;
    gap: 16px;
    width: min(var(--x2-page-max-width), calc(100% - var(--x2-page-inline-space)));
    margin: 0 auto;
    padding: 18px 0 120px;
}

.patient-labs-header,
.patient-labs-search-card,
.patient-labs-workspace {
    padding: 20px;
    border-radius: 16px;
}

.patient-labs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.patient-labs-header span {
    color: var(--clinic-secondary);
    font-size: 1.0625rem;
    font-weight: 900;
}

.patient-labs-header h1 {
    margin: 3px 0 5px;
    color: #102833;
    font-size: clamp(1.875rem, 4vw, 2.75rem);
}

.patient-labs-header p {
    margin: 0;
    color: #4e606a;
    font-weight: 800;
}

.patient-labs-header-note {
    padding: 11px 16px;
    border: 1px solid rgba(53, 89, 117, .2);
    border-radius: 12px;
    color: #40515b;
    background: rgba(255, 255, 255, .66);
    font-size: 1.0625rem;
    font-weight: 900;
    white-space: nowrap;
}

.patient-labs-search-card {
    position: relative;
    z-index: 5;
}

.patient-labs-search-label {
    position: relative;
    display: grid;
    width: min(760px, 100%);
    margin: 0 auto;
}

.patient-labs-search-label > span,
.patient-labs-form-grid label span {
    color: #40515b;
    font-size: 1rem;
    font-weight: 900;
}

.patient-labs-search-label > span {
    justify-content: center;
    text-align: center;
}

.patient-labs-search-label input,
.patient-labs-form-grid input,
.patient-labs-form-grid textarea {
    color: #1a2a32;
    background: rgba(255, 255, 255, .9);
    border-color: rgba(10, 42, 54, .2);
}

.patient-labs-form-grid textarea {
    width: 100%;
    min-height: 90px;
    padding: 12px 16px;
    border: 1px solid rgba(10, 42, 54, .2);
    border-radius: 16px;
    outline: none;
    resize: vertical;
    font: inherit;
}

.patient-labs-form-grid small {
    display: block;
    margin-top: 6px;
    color: #65757d;
    font-weight: 700;
}

.patient-labs-search-results {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    z-index: 10;
    max-height: 310px;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid rgba(10, 42, 54, .2);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 18px 42px rgba(10, 42, 54, .25);
}

.patient-labs-search-results[hidden],
.patient-labs-workspace[hidden] {
    display: none;
}

.patient-labs-search-results button {
    display: grid;
    gap: 3px;
    width: 100%;
    padding: 11px 13px;
    border: 0;
    border-bottom: 1px solid #e6edf0;
    color: #17313d;
    background: transparent;
    cursor: pointer;
    text-align: right;
}

.patient-labs-search-results button:hover,
.patient-labs-search-results button:focus {
    border-radius: 9px;
    background: #e8f7fb;
}

.patient-labs-search-results button strong {
    font-size: 1rem;
}

.patient-labs-search-results button span {
    color: #64757e;
    font-size: 0.8125rem;
}

.patient-labs-no-results {
    padding: 15px;
    color: #586a73;
    text-align: center;
    font-weight: 800;
}

.patient-labs-search-help {
    width: min(760px, 100%);
    margin: 10px auto 0;
    color: #52636c;
    font-size: 0.875rem;
    font-weight: 800;
    text-align: center;
}

.patient-labs-workspace {
    color: #1b303a;
}

.patient-labs-selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(53, 89, 117, .22);
}

.patient-labs-selected span {
    color: #62717a;
    font-weight: 800;
}

.patient-labs-selected h2 {
    margin: 3px 0 0;
    color: var(--clinic-primary-deep);
    font-size: 1.75rem;
}

.patient-labs-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.patient-labs-meta span {
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .7);
}

.patient-labs-history-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
}

.patient-labs-history-title h2 {
    margin: 0;
    color: #19303d;
}

.patient-labs-history-title span {
    padding: 7px 12px;
    border-radius: 999px;
    color: #ffffff;
    background: var(--clinic-primary-strong);
    font-weight: 900;
}

.patient-labs-history-table td:nth-child(2) {
    direction: ltr;
    overflow-wrap: anywhere;
}

#uploadPatientLabs:disabled,
.lab-delete-btn:disabled {
    cursor: wait;
    opacity: .6;
}

.patient-picker-toggle {
    width: 100%;
    min-height: 54px;
    padding: 0 14px;
    border: 1px solid rgba(10, 42, 54, .14);
    border-radius: 14px;
    color: #1a2a32;
    background: #ffffff;
    cursor: pointer;
    font-family: inherit;
    font-weight: 900;
    text-align: right;
}

.patient-picker-toggle::after {
    float: left;
    content: "▾";
}

.patient-picker-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    z-index: 60;
    padding: 8px;
    border: 1px solid rgba(10, 42, 54, .14);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 16px 38px rgba(10, 42, 54, .18);
}

.patient-picker-menu[hidden] {
    display: none;
}

.patient-picker-search {
    width: 100%;
    margin-bottom: 8px;
}

.patient-picker-options {
    max-height: 190px;
    overflow: auto;
}

.patient-picker-options button {
    display: flex;
    width: 100%;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 0;
    border-radius: 10px;
    color: #1a2a32;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    font-weight: 900;
}

.patient-picker-options button[hidden] {
    display: none;
}

.patient-picker-options button:hover {
    background: rgba(85, 199, 159, .13);
}

.patient-picker-options span {
    color: #64737b;
}

.attendance-form-grid .full {
    grid-column: 1 / -1;
}

.attendance-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.danger-wide {
    min-height: 54px;
    border: 0;
    border-radius: 12px;
    color: #ffffff;
    background: #e96565;
    cursor: pointer;
    font-weight: 900;
}

.attendance-modal-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    margin-top: 18px;
    overflow: hidden;
    border: 1px solid rgba(var(--clinic-primary-rgb), .42);
    border-radius: 12px;
    background: rgba(255, 255, 255, .82);
}

.attendance-modal-tabs button {
    min-height: 54px;
    border: 0;
    color: var(--clinic-primary-strong);
    background: rgba(255, 255, 255, .9);
    cursor: pointer;
    font-weight: 900;
}

.attendance-modal-tabs button:first-child {
    color: #ffffff;
    background: var(--clinic-primary);
}

.attendance-modal-tabs button.is-active {
    color: #ffffff;
    background: var(--clinic-primary);
}

.attendance-modal-tabs button:not(.is-active) {
    color: #59636b;
    background: rgba(255, 255, 255, .94);
}

.history-panel {
    display: none;
    max-height: 190px;
    overflow: auto;
    border: 1px solid rgba(var(--clinic-primary-rgb), .26);
    border-top: 0;
    border-radius: 0 0 12px 12px;
    background: rgba(255, 255, 255, .92);
}

.history-panel.is-active {
    display: block;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    color: #2b3a42;
    direction: rtl;
}

.history-table th,
.history-table td {
    padding: 8px 10px;
    border: 1px solid rgba(74, 111, 132, .28);
    text-align: center;
    font-weight: 800;
}

.history-table th {
    background: #cce8f8;
}

.visit-page {
    width: min(var(--x2-page-max-width), calc(100% - var(--x2-page-inline-space)));
    margin: 0 auto;
    padding: 12px 0 150px;
}

.visit-vertical-body .visit-page {
    display: grid;
    grid-template-columns: 275px minmax(0, 1fr);
    grid-template-areas:
        "header header"
        "sidebar content";
    align-items: start;
    gap: 12px;
}

.visit-vertical-body .visit-patient-bar {
    grid-area: header;
}

.visit-vertical-body .visit-tabs {
    position: sticky;
    top: 12px;
    grid-area: sidebar;
    display: flex;
    max-height: calc(100vh - 115px);
    margin: 0;
    overflow-x: hidden;
    overflow-y: auto;
    flex-direction: column;
}

.visit-vertical-body .visit-tabs button {
    width: 100%;
    min-height: 52px;
    flex: 0 0 auto;
    justify-content: flex-start;
    text-align: right;
}

.visit-vertical-body .visit-tabs button > span {
    flex: 1;
}

.visit-vertical-body .visit-form {
    grid-area: content;
    min-width: 0;
}

.visit-vertical-body .visit-empty {
    grid-column: 1 / -1;
    grid-area: auto;
}

.visit-english-body .visit-page {
    grid-template-columns: minmax(0, 1fr) 275px;
    grid-template-areas:
        "header header"
        "content sidebar";
}

.visit-english-body .visit-tabs button,
.visit-english-body .visit-drug-results button {
    text-align: left;
}

.visit-english-body .visit-field,
.visit-english-body .visit-group,
.visit-english-body .visit-section-title,
.visit-english-body .visit-patient-bar {
    text-align: left;
}

.visit-english-body .visit-stepper {
    direction: ltr;
}

.visit-english-body .bottom-dock,
.visit-english-body .bottom-dock .dock-menu {
    direction: rtl;
}

.visit-english-body .bottom-dock .dock-menu {
    text-align: right;
}

.visit-dashboard-body .visit-page {
    width: min(var(--x2-page-max-width), calc(100% - var(--x2-page-inline-space)));
    max-width: 100%;
    min-width: 0;
    padding-top: 8px;
}

body.visit-dashboard-body {
    overflow-x: hidden;
}

.visit-dashboard-body .visit-patient-bar {
    grid-template-columns: minmax(390px, 1.2fr) minmax(460px, 1.7fr) 130px;
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(255,255,255,.72), rgba(235,246,252,.48));
}
.visit-dashboard-body .visit-patient-main { display:flex; min-width:0; align-items:center; gap:9px; }
.visit-dashboard-body .visit-patient-main h1 { display:block; min-width:0; margin:0; overflow:hidden; direction:rtl; unicode-bidi:isolate; font-size:clamp(1.25rem,2vw,1.6875rem); text-align:right; text-overflow:ellipsis; white-space:nowrap; }
.visit4-toolbar-actions .is-temporarily-hidden { display:none !important; }

.visit4-toolbar-actions {
    display: flex;
    grid-column: 1 / -1;
    flex-wrap: wrap;
    gap: 9px;
    padding-top: 11px;
    border-top: 1px solid rgba(53, 89, 117, .18);
}

.visit4-toolbar-actions button,
.visit4-toolbar-actions a {
    display: inline-flex;
    min-width: 105px;
    min-height: 43px;
    padding: 0 16px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 9px;
    color: #ffffff;
    background: var(--clinic-primary-strong);
    cursor: pointer;
    font-family: inherit;
    font-weight: 900;
    text-decoration: none;
}

.visit4-toolbar-actions button:nth-child(2) { background: var(--clinic-accent-strong); }
.visit4-toolbar-actions button:nth-child(3) { background: var(--clinic-accent-strong); }
.visit4-toolbar-actions button:nth-child(4) { background: var(--clinic-primary); }
.visit4-toolbar-actions button:nth-child(5) { background: #506672; }
.visit4-toolbar-actions a:nth-of-type(1) { background: #43cc91; }
.visit4-toolbar-actions a.is-dark { margin-left: auto; background: #26333b; }
.visit4-toolbar-actions a.is-purple { background: var(--clinic-primary-deep); }
.visit4-next-patient-modal[hidden] { display:none; }
.visit4-next-patient-modal { position:fixed; inset:0; z-index:120; display:grid; place-items:center; padding:18px; }
.visit4-next-patient-backdrop { position:absolute; inset:0; border:0; background:rgba(8,24,32,.68); backdrop-filter:blur(5px); }
.visit4-next-patient-modal > section { position:relative; z-index:1; width:min(560px,100%); padding:20px; border:1px solid rgba(255,255,255,.6); border-radius:18px; color:#263e49; background:#f7fcff; box-shadow:0 28px 80px rgba(20,17,68,.35); }
.visit4-next-patient-modal header { display:flex; align-items:center; justify-content:center; gap:12px; text-align:center; }
.visit4-next-patient-modal header > div { display:grid; justify-items:center; }
.visit4-next-patient-modal header[hidden] { display:none; }
.visit4-next-patient-modal header > span { display:grid; place-items:center; width:48px; height:48px; border-radius:50%; color:#fff; background:#43cc91; font-size:1.5625rem; font-weight:900; }
.visit4-next-patient-modal header small { color:var(--clinic-primary); font-weight:900; }
.visit4-next-patient-modal h2 { margin:3px 0 0; font-size:1.375rem; }
.visit4-next-patient-modal > section > p { margin:18px 0; line-height:1.8; }
.visit4-next-patient-modal footer { display:grid; grid-template-columns:.8fr 1.25fr 1.5fr; gap:10px; }
.visit4-next-patient-modal footer:has(.is-followup[hidden]) { grid-template-columns:1fr 1.5fr; }
.visit4-next-patient-modal footer button { min-height:48px; border:0; border-radius:10px; color:#263e49; background:#e6eef2; font:inherit; font-weight:900; cursor:pointer; }
.visit4-next-patient-modal footer .is-followup { color:#fff; background:#21a982; }
.visit4-next-patient-modal footer .is-confirm { color:#fff; background:var(--clinic-primary); }
.visit4-next-bookings { display:grid; gap:7px; margin:0 0 16px; padding:12px; border-radius:10px; color:#263e49; background:#fff3d8; }
.visit4-next-bookings > span { display:flex; justify-content:space-between; align-items:center; gap:10px; padding-top:6px; border-top:1px solid #ead6a3; color:#263e49; }
.visit4-next-bookings > span:first-child { padding-top:0; border-top:0; }
.visit4-next-bookings strong,
.visit4-next-bookings b,
.visit4-next-bookings small { color:#263e49; }
.visit4-next-bookings small { font-weight:800; }

.visit4-primary-tabs,
.visit4-module-tabs {
    display: grid;
    gap: 4px;
    margin: 9px 0 0;
    padding: 7px;
    border-radius: 15px;
}

.visit4-primary-tabs {
    grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
    overflow-x: auto;
}

.visit4-primary-tabs > .is-temporarily-hidden {
    display: none !important;
}

.visit4-primary-tabs button,
.visit4-module-tabs button {
    min-height: 43px;
    border: 0;
    border-radius: 8px;
    color: #3e4f59;
    background: rgba(233, 237, 255, .88);
    cursor: pointer;
    font-family: inherit;
    font-weight: 900;
}

.visit4-primary-tabs button:has(.visit4-tab-image) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.visit4-primary-tabs button.is-active,
.visit4-module-tabs button.is-active {
    color: #ffffff;
    background: var(--clinic-primary);
    box-shadow: 0 8px 18px rgba(var(--clinic-primary-rgb), .23);
}

.visit4-module-tabs {
    position: sticky;
    top: 0;
    z-index: 22;
    display: flex;
    overflow-x: auto;
    background: linear-gradient(145deg, rgba(255,255,255,.78), rgba(226,237,249,.56));
}

.visit4-module-tabs[hidden] {
    display: none;
}

.visit4-module-tabs button {
    display: inline-flex;
    min-width: 145px;
    flex: 1 0 auto;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.visit4-primary-tabs .visit4-scan-tab,
.visit4-module-tabs .visit4-scan-tab {
    position: relative;
}

.visit4-module-tabs .visit4-tab-image,
.visit4-primary-tabs .visit4-tab-image {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    object-fit: contain;
}

.visit4-primary-tabs .visit4-today-labs-count,
.visit4-module-tabs .visit4-today-labs-count {
    display: grid;
    min-width: 23px;
    height: 23px;
    padding: 0 6px;
    place-items: center;
    border: 2px solid #ffffff;
    border-radius: 999px;
    color: #ffffff;
    background: #ef5668;
    box-shadow: 0 3px 9px rgba(204, 49, 70, .3);
    font-size: 0.6875rem;
    font-weight: 900;
}

.visit4-primary-tabs .visit4-scan-tab.has-today-labs::after,
.visit4-module-tabs .visit4-scan-tab.has-today-labs::after {
    content: "";
    position: absolute;
    top: 5px;
    right: 5px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ef5668;
}

.visit4-module-tabs .visit-ui-icon {
    width: 22px;
    height: 22px;
}

.visit-dashboard-body .visit-tabs,
.visit-dashboard-body .visit-action-bar {
    display: none;
}

.visit-dashboard-body .visit-form {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin-top: 8px;
}

.visit-dashboard-body .visit-section {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    border: 1px solid rgba(255, 255, 255, .62);
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(255,255,255,.64), rgba(232,243,250,.42));
}

.visit-dashboard-body .visit-section-title {
    padding-bottom: 11px;
    border-bottom: 2px solid rgba(var(--clinic-primary-rgb), .22);
}

.visit-dashboard-body .visit-group {
    border-color: rgba(var(--clinic-primary-rgb), .22);
    background: rgba(255, 255, 255, .76);
}

.visit-dashboard-body [data-visit-section="general_exam"] > .visit-section-title,
.visit-dashboard-body [data-visit-section="general_exam"] > .visit-group:not(.visit4-examination-workspace),
.visit-dashboard-body [data-visit-section="complaints"] > .visit-section-title,
.visit-dashboard-body [data-visit-section="complaints"] > .visit-group:not(.visit4-complaint-workspace) {
    display: none;
}

.visit4-complaint-workspace {
    display: grid;
    grid-template-columns: 370px minmax(0, 1fr);
    gap: 14px;
    padding: 12px;
}

.visit4-complaint-workspace > aside {
    display: grid;
    align-content: start;
    gap: 10px;
}

.visit4-complaint-workspace .is-temporarily-hidden {
    display: none !important;
}

.visit4-complaint-workspace > aside label {
    display: grid;
}

.visit4-complaint-workspace > aside small {
    margin: 0 0 -7px 8px;
    z-index: 1;
    width: max-content;
    padding: 0 4px;
    color: #6b7980;
    background: #ffffff;
}

.visit4-complaint-workspace > aside select,
.visit4-complaint-workspace > aside textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #c5d3da;
    border-radius: 8px;
    outline: none;
    color: #253b46;
    background: #ffffff;
    font: inherit;
}

.visit4-complaint-workspace > aside button {
    min-height: 43px;
    border: 0;
    border-radius: 8px;
    color: #ffffff;
    background: #43cc91;
    cursor: pointer;
    font-family: inherit;
    font-weight: 900;
}

.visit4-chronic-profile {
    overflow: hidden;
    border: 1px solid #c5d3da;
    border-radius: 10px;
    background: #fff;
}

.visit4-chronic-profile > summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    min-height: 51px;
    padding: 9px 11px;
    align-items: center;
    gap: 8px;
    color: #304650;
    background: #e9e5fb;
    cursor: pointer;
    list-style: none;
}

.visit4-chronic-profile > summary::-webkit-details-marker { display: none; }

.visit4-chronic-profile > summary strong {
    color: var(--clinic-primary-strong);
    font-size: 0.8125rem;
}

.visit4-chronic-profile > summary > span {
    padding: 5px 8px;
    border-radius: 999px;
    color: #fff;
    background: var(--clinic-primary);
    font-size: 0.5625rem;
    font-weight: 900;
}

.visit4-chronic-profile > summary > b {
    display: grid;
    width: 25px;
    height: 25px;
    place-items: center;
    border-radius: 50%;
    color: var(--clinic-primary);
    background: #fff;
    font-size: 1.0625rem;
    line-height: 1;
}

.visit4-chronic-profile > summary > b::before { content: "+"; }
.visit4-chronic-profile[open] > summary > b::before { content: "\2212"; }

.visit4-chronic-choices {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 9px;
}

.visit4-chronic-choices label {
    position: relative;
    display: block;
    min-width: 0;
    cursor: pointer;
}

.visit4-chronic-choices input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.visit4-chronic-choices label > span {
    display: flex;
    min-width: 0;
    min-height: 36px;
    margin: 0;
    padding: 6px 8px;
    align-items: center;
    justify-content: center;
    border: 1px solid #cbd8de;
    border-radius: 9px;
    color: #455e69;
    background: #f8fbfc;
    font-size: 0.625rem;
    font-weight: 900;
    line-height: 1.2;
    text-align: center;
}

.visit4-chronic-choices input:checked + span {
    border-color: var(--clinic-primary);
    color: #fff;
    background: var(--clinic-primary);
    box-shadow: 0 5px 12px rgba(74,43,164,.18);
}

.visit4-chronic-other {
    display: grid;
    gap: 5px;
    margin: 0 9px 9px;
    padding-top: 8px;
    border-top: 1px dashed #cedae0;
}

.visit4-chronic-other[hidden] { display: none !important; }

.visit4-chronic-other > span {
    display: block;
    margin: 0;
    color: #566d77;
    font-size: 0.625rem;
}

.visit4-chronic-other input {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid #c5d3da;
    border-radius: 8px;
    outline: none;
    color: #253b46;
    background: #fff;
    font: inherit;
    font-size: 0.6875rem;
}

.visit4-chronic-other input:focus {
    border-color: var(--clinic-primary);
    box-shadow: 0 0 0 3px rgba(var(--clinic-primary-rgb),.1);
}

.visit4-complaint-summary {
    overflow: hidden;
    border: 1px solid #c5d3da;
    border-radius: 9px;
    background: #ffffff;
}

.visit4-complaint-summary > header {
    display: flex;
    min-height: 46px;
    padding: 9px 11px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #304650;
    background: #e4e7ef;
}

.visit4-complaint-summary > header strong {
    display: grid;
    gap: 1px;
    font-size: 0.8125rem;
}

.visit4-complaint-summary > header small {
    margin: 0;
    padding: 0;
    color: #6b7980;
    background: transparent;
    font-size: 0.6875rem;
}

.visit4-complaint-summary > header span {
    display: grid;
    min-width: 30px;
    height: 30px;
    padding: 0 7px;
    place-items: center;
    border-radius: 15px;
    color: #ffffff;
    background: var(--clinic-primary);
    font-size: 0.75rem;
    font-weight: 900;
}

#visit4ComplaintSummary {
    display: grid;
    max-height: 520px;
    overflow-y: auto;
}

#visit4ComplaintSummary > div {
    display: grid;
    gap: 4px;
    padding: 9px 11px;
    border-top: 1px solid #e4eaed;
}

#visit4ComplaintSummary > div:first-child {
    border-top: 0;
}

#visit4ComplaintSummary > div:nth-child(even) {
    background: #f6f8fa;
}

#visit4ComplaintSummary span {
    color: #647780;
    font-size: 0.6875rem;
    font-weight: 800;
}

#visit4ComplaintSummary strong {
    color: #263d48;
    font-size: 0.75rem;
    overflow-wrap: anywhere;
}

#visit4ComplaintSummary .visit4-complaint-summary-title {
    color: #304650;
    font-size: 0.75rem;
    font-weight: 900;
}

:is(#visitCurrentSummary, .visit-previous-summary) .visit-current-summary-card {
    grid-column: 1 / -1;
    gap: 5px;
    padding: 7px 10px;
    border-inline-start: 3px solid var(--clinic-primary);
    background: linear-gradient(90deg, rgba(101, 72, 199, .045), transparent 180px);
}

:is(#visitCurrentSummary, .visit-previous-summary) .visit-current-medication-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    border-inline-start-color: #2b8a67;
    background: linear-gradient(90deg, rgba(43, 138, 103, .055), transparent 180px);
}

:is(#visitCurrentSummary, .visit-previous-summary) .visit-current-note-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px 10px;
}

:is(#visitCurrentSummary, .visit-previous-summary) .visit-current-note-card > .visit4-complaint-summary-title {
    flex: 0 0 auto;
    white-space: nowrap;
}

:is(#visitCurrentSummary, .visit-previous-summary) .visit-current-examination-card {
    border-inline-start-color: #328294;
    background: linear-gradient(90deg, rgba(50, 130, 148, .05), transparent 180px);
}

:is(#visitCurrentSummary, .visit-previous-summary) .visit-current-investigation-card {
    border-inline-start-color: #3976b8;
    background: linear-gradient(90deg, rgba(57, 118, 184, .05), transparent 180px);
}

:is(#visitCurrentSummary, .visit-previous-summary) .visit4-complaint-summary-title {
    color: #304650;
    font-size: 0.9375rem;
    font-weight: 900;
    line-height: 1.25;
}

:is(#visitCurrentSummary, .visit-previous-summary) .visit-current-complaint-groups,
:is(#visitCurrentSummary, .visit-previous-summary) .visit-current-examination-groups,
:is(#visitCurrentSummary, .visit-previous-summary) .visit-current-investigation-groups {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
}

:is(#visitCurrentSummary, .visit-previous-summary) .visit-current-complaint-group,
:is(#visitCurrentSummary, .visit-previous-summary) .visit-current-examination-group,
:is(#visitCurrentSummary, .visit-previous-summary) .visit-current-investigation-group {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
}

:is(#visitCurrentSummary, .visit-previous-summary) .visit-current-complaint-group > .visit4-complaint-summary-title,
:is(#visitCurrentSummary, .visit-previous-summary) .visit-current-examination-group > .visit4-complaint-summary-title,
:is(#visitCurrentSummary, .visit-previous-summary) .visit-current-investigation-group > .visit4-complaint-summary-title {
    white-space: nowrap;
}

.visit4-complaint-summary-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

#visit4ComplaintSummary .visit4-complaint-summary-fields > span {
    display: inline-flex;
    min-height: 29px;
    padding: 5px 8px;
    align-items: center;
    gap: 5px;
    border: 1px solid #d8e1e5;
    border-radius: 7px;
    color: #647780;
    background: #ffffff;
    font-size: 0.6875rem;
}

:is(#visitCurrentSummary, .visit-previous-summary) .visit4-complaint-summary-fields > span {
    display: inline-flex;
    min-height: 30px;
    padding: 4px 8px;
    align-items: center;
    gap: 4px;
    border: 1px solid #d5dfe4;
    border-radius: 6px;
    color: #647780;
    background: #ffffff;
    font-size: 0.8125rem;
    line-height: 1.25;
}

:is(#visitCurrentSummary, .visit-previous-summary) .visit4-complaint-summary-fields b {
    color: #61737c;
    font-weight: 800;
}

:is(#visitCurrentSummary, .visit-previous-summary) .visit4-complaint-summary-fields strong {
    color: var(--clinic-primary-strong);
    font-size: 0.8125rem;
    font-weight: 900;
}

:is(#visitCurrentSummary, .visit-previous-summary) .visit-current-medication-card .visit4-complaint-summary-fields strong {
    color: #187052;
}

:is(#visitCurrentSummary, .visit-previous-summary) .visit-current-investigation-card .visit4-complaint-summary-fields strong {
    color: #315ca8;
}

#visit4ComplaintSummary .visit4-complaint-summary-fields b {
    color: #61737c;
    font-weight: 800;
}

#visit4ComplaintSummary .visit4-complaint-summary-fields strong {
    color: var(--clinic-primary-strong);
    font-size: 0.6875rem;
    font-weight: 900;
}

#visit4ComplaintSummary p {
    margin: 0;
    padding: 18px 12px;
    color: #71838b;
    text-align: center;
    font-size: 0.75rem;
}

.visit4-complaint-categories {
    display: grid;
    align-self: start;
    align-content: start;
    grid-auto-rows: max-content;
    gap: 5px;
    max-height: none;
    overflow: visible;
    padding-right: 0;
}

.visit4-complaint-categories > section {
    height: auto;
    min-height: 0;
    align-self: start;
    border: 1px solid #c9d9df;
    border-radius: 9px;
    background: #ffffff;
}

.visit4-complaint-category {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 9px;
    width: 100%;
    min-height: 42px;
    margin: 0;
    padding: 8px 12px;
    border: 0;
    color: #253d48;
    border-bottom: 3px solid var(--clinic-primary);
    background: #ffffff;
    cursor: pointer;
    font-family: inherit;
    font-size: 1.0625rem;
    font-weight: 900;
    text-align: left;
}

.visit4-complaint-category > span {
    display: flex;
    align-items: center;
    gap: 9px;
}

.visit4-complaint-category .visit-ui-icon {
    color: #d75858;
}

.visit4-complaint-category .visit4-category-image {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    object-fit: contain;
}

.visit4-complaint-category > b {
    display: grid;
    width: 27px;
    height: 27px;
    place-items: center;
    border-radius: 50%;
    color: var(--clinic-primary);
    background: var(--clinic-primary-soft);
    font-size: 1.1875rem;
}

.visit4-complaint-category.is-active {
    color: var(--clinic-primary-strong);
    background: var(--clinic-primary-soft);
}

.visit4-complaint-category.is-active > b {
    color: #ffffff;
    background: var(--clinic-primary);
}

.visit4-complaint-table[hidden] {
    display: none;
}

.visit4-complaint-category small {
    color: #72848c;
    font-size: 0.75rem;
    font-weight: 800;
}

.visit4-chief-complaint {
    display: grid;
    gap: 5px;
    color: #263d47;
    direction: ltr;
}

.visit4-cc-intro,
.visit4-cc-common,
.visit4-cc-section {
    padding: 12px;
    border: 1px solid #d3dee3;
    border-radius: 10px;
    background: #f8fbfc;
}

.visit4-cc-intro h3,
.visit4-cc-common h3,
.visit4-cc-section h4 {
    margin: 0 0 8px;
    color: var(--clinic-primary-strong);
}

.visit4-cc-intro h3 small,
.visit4-cc-common h3 small {
    color: #637780;
    font-size: 0.8125rem;
}

.visit4-cc-intro p,
.visit4-cc-warning {
    margin: 0 0 10px;
    color: #71838b;
    font-size: 0.75rem;
}

.visit4-cc-main-choices,
.visit4-cc-checks,
.visit4-cc-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.visit4-cc-main-choices label,
.visit4-cc-checks label,
.visit4-cc-choices label {
    cursor: pointer;
}

.visit4-cc-main-choices input,
.visit4-cc-checks input,
.visit4-cc-choices input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.visit4-cc-main-choices span,
.visit4-cc-checks span,
.visit4-cc-choices span {
    display: inline-flex;
    min-height: 34px;
    padding: 6px 10px;
    align-items: center;
    border: 1px solid #c8d5db;
    border-radius: 8px;
    color: #4c616a;
    background: #fff;
    font-size: 0.75rem;
    font-weight: 800;
}

.visit4-cc-main-choices input:checked + span,
.visit4-cc-checks input:checked + span,
.visit4-cc-choices input:checked + span {
    color: #fff;
    border-color: var(--clinic-primary);
    background: var(--clinic-primary);
}

.visit4-cc-common {
    display: grid;
    gap: 8px;
}

.visit4-cc-common article {
    padding: 10px;
    border-inline-start: 4px solid #43cc91;
    border-radius: 8px;
    background: #fff;
}

.visit4-cc-common article[hidden],
.visit4-cc-section[hidden] {
    display: none;
}

.visit4-cc-common h4 {
    margin: 0 0 8px;
    color: #29434f;
    font-size: 0.875rem;
}

.visit4-cc-section {
    padding: 0;
    overflow: hidden;
    background: #fff;
}

.visit4-cc-section > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    list-style: none;
    padding: 12px 14px;
    color: var(--clinic-primary-strong);
    background: var(--clinic-primary-soft);
    cursor: pointer;
    font-size: 0.9375rem;
    font-weight: 900;
    scroll-margin-top: 140px;
}

.visit4-cc-section > summary::-webkit-details-marker {
    display: none;
}

.visit4-cc-section > summary::after {
    content: "+";
    display: grid;
    width: 27px;
    height: 27px;
    flex: 0 0 27px;
    place-items: center;
    border-radius: 50%;
    color: var(--clinic-primary);
    background: #fff;
    font-size: 1.1875rem;
}

.visit4-cc-section[open] > summary::after {
    content: "−";
    color: #fff;
    background: var(--clinic-primary);
}

.visit4-cc-subsections {
    display: grid;
    gap: 6px;
    margin: 10px 12px 12px;
}

.visit4-cc-subsection {
    overflow: hidden;
    border: 1px solid #d2dde2;
    border-radius: 8px;
    background: #fff;
}

.visit4-cc-subsection > summary {
    display: flex;
    min-height: 43px;
    padding: 8px 12px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    list-style: none;
    color: #304650;
    background: #e4e7ef;
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 900;
    scroll-margin-top: 140px;
}

.visit4-cc-subsection > summary::-webkit-details-marker {
    display: none;
}

.visit4-cc-subsection > summary::after {
    content: "+";
    display: grid;
    width: 25px;
    height: 25px;
    flex: 0 0 25px;
    place-items: center;
    border-radius: 50%;
    color: var(--clinic-primary);
    background: #fff;
    font-size: 1.125rem;
}

.visit4-cc-subsection[open] > summary::after {
    content: "−";
    color: #fff;
    background: var(--clinic-primary);
}

.visit4-cc-subsection > .visit4-cc-grid {
    margin: 0;
    border: 0;
    border-radius: 0;
}

.visit4-cc-subsection > .visit4-cc-ipss {
    margin: 0;
    padding: 8px;
}

.visit4-cc-subsection > .visit4-cc-score {
    margin: 0 8px 8px;
}

.visit4-cc-section > h4,
.visit4-cc-section > .visit4-cc-grid,
.visit4-cc-section > .visit4-cc-ipss,
.visit4-cc-section > .visit4-cc-score,
.visit4-cc-section > .visit4-cc-symptom-table,
.visit4-cc-section > .visit4-cc-warning {
    margin-left: 12px;
    margin-right: 12px;
}

.visit4-cc-section > h4 {
    margin-top: 12px;
    margin-bottom: 0;
    padding: 10px 12px;
    color: #304650;
    background: #dfe4eb;
    font-size: 0.8125rem;
}

.visit4-cc-section > :last-child {
    margin-bottom: 12px;
}

.visit4-cc-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0;
    overflow: hidden;
    border: 1px solid #d4dfe4;
    border-radius: 0 0 8px 8px;
    background: #fff;
}

.visit4-cc-grid > :not(.visit4-cc-toggle-field) {
    flex: 1 0 100%;
}

.visit4-cc-field {
    display: grid;
    grid-template-columns: minmax(150px, 24%) minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-width: 0;
    min-height: 54px;
    padding: 8px 12px;
    border: 0;
    border-radius: 0;
    background: #fff;
}

.visit4-cc-field[hidden] {
    display: none;
}

.visit4-cc-field:nth-child(even) {
    background: #f0f0f0;
}

.visit4-cc-field > strong {
    color: #334d59;
    font-size: 0.8125rem;
}

.visit4-cc-field input:not([type="radio"]):not([type="checkbox"]),
.visit4-cc-field select,
.visit4-cc-field textarea,
.visit4-cc-symptom-table input,
.visit4-cc-symptom-table select,
.visit4-cc-ipss select {
    width: 100%;
    min-height: 37px;
    padding: 6px 8px;
    border: 1px solid #c8d5db;
    border-radius: 7px;
    outline: none;
    color: #263d47;
    background: #fff;
    font: inherit;
}

.visit4-cc-field textarea {
    resize: vertical;
}

.visit4-cc-wide {
    grid-column: auto;
}

.visit4-cc-ipss {
    display: grid;
    gap: 6px;
}

.visit4-cc-ipss > .visit4-cc-ipss-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(210px, auto);
    align-items: center;
    gap: 10px;
    padding: 7px 9px;
    border-radius: 7px;
    background: #f5f7fa;
}

.visit4-cc-ipss strong {
    font-size: 0.75rem;
}

.visit4-cc-ipss-options {
    justify-content: flex-end;
}

.visit4-cc-score {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 9px;
    margin-bottom: 9px;
    padding: 10px;
    border-radius: 8px;
    color: #fff;
    background: linear-gradient(135deg, var(--clinic-primary), var(--clinic-accent-strong));
}

.visit4-cc-score strong {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 50%;
    color: var(--clinic-primary-strong);
    background: #fff;
    font-size: 1.125rem;
}

.visit4-cc-score small {
    margin-left: auto;
    font-weight: 900;
}

.visit4-cc-symptom-table {
    display: grid;
    gap: 3px;
    overflow-x: auto;
}

.visit4-cc-symptom-table > header,
.visit4-cc-symptom-table > div {
    display: grid;
    grid-template-columns: minmax(190px, 1.35fr) repeat(4, minmax(115px, 1fr));
    gap: 5px;
    min-width: 720px;
    align-items: center;
    padding: 6px;
}

.visit4-cc-symptom-table > header {
    color: #fff;
    background: var(--clinic-primary);
    font-size: 0.6875rem;
    font-weight: 900;
}

.visit4-cc-symptom-table > div:nth-child(odd) {
    background: #f2f4f7;
}

.visit4-cc-symptom-table > div > strong {
    font-size: 0.75rem;
}

.visit4-cc-warning {
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 7px;
    color: #795d18;
    background: #fff4cf;
}

@media (max-width: 900px) {
    .visit4-cc-field { grid-template-columns: 1fr; gap: 7px; }
    .visit4-exam-card-grid,
    .visit4-exam-side-grid { grid-template-columns: 1fr; }
    .visit4-exam-choice-field,
    .visit4-exam-input-field { grid-template-columns: 1fr; gap: 6px; }
}

.visit-dashboard-body [data-visit-section="genital_exam"] > .visit-section-title {
    display: none;
}

.visit-dashboard-body .visit-group.visit4-drawing-group {
    height: auto;
    min-height: 0;
    margin-bottom: 5px;
    padding: 0 !important;
    overflow: hidden;
    border-radius: 8px;
}

.visit4-drawing-category {
    display: flex;
    width: 100%;
    min-height: 44px;
    padding: 7px 12px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 0;
    border-bottom: 3px solid var(--clinic-primary);
    color: #253d48;
    background: #ffffff;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 900;
    text-align: left;
}

.visit4-drawing-category > span {
    display: flex;
    align-items: center;
    gap: 9px;
}

.visit4-drawing-category .visit-ui-icon {
    color: #7655c9;
}

.visit4-drawing-category > b {
    display: grid;
    width: 27px;
    height: 27px;
    place-items: center;
    border-radius: 50%;
    color: var(--clinic-primary);
    background: var(--clinic-primary-soft);
    font-size: 1.1875rem;
}

.visit4-drawing-category.is-active {
    color: var(--clinic-primary-strong);
    background: var(--clinic-primary-soft);
}

.visit4-drawing-category.is-active > b {
    color: #ffffff;
    background: var(--clinic-primary);
}

.visit4-drawing-panel {
    padding: 7px;
}

.visit4-drawing-panel[hidden] {
    display: none;
}

.visit4-drawing-table-head {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 10px;
    padding: 10px 12px;
    color: #253942;
    background: #e2e5ee;
    font-size: 0.8125rem;
    font-weight: 900;
}

.visit-dashboard-body .visit4-drawing-panel .visit-fields-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

.visit-dashboard-body .visit4-drawing-panel .visit-field {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-height: 53px;
    padding: 8px 12px;
    border: 0;
    border-radius: 0;
    background: #ffffff;
}

.visit-dashboard-body .visit4-drawing-panel .visit-field:nth-child(even) {
    background: #f0f0f0;
}

.visit-dashboard-body .visit4-drawing-panel .visit-field > h4 {
    margin: 0;
    color: #243842;
    font-size: 0.8125rem;
}

.visit-dashboard-body .visit4-drawing-panel .visit-field > h4 > i {
    width: 30px;
    height: 30px;
}

.visit-dashboard-body .visit4-drawing-panel .visit-choice-grid {
    align-items: center;
    gap: 5px;
}

.visit-dashboard-body .visit4-drawing-panel .visit-choice span {
    min-height: 34px;
    padding: 4px 9px;
    font-size: 0.75rem;
}

.visit-dashboard-body .visit4-drawing-panel .visit-field textarea {
    min-height: 48px;
}

.visit-dashboard-body .visit4-drawing-panel .visit-stepper {
    justify-content: start;
}

.visit4-complaint-table {
    padding: 7px;
}

.visit4-complaint-table > header,
.visit4-complaint-row {
    display: grid;
    grid-template-columns: minmax(130px, 1fr) minmax(270px, 1.5fr) minmax(150px, .75fr) minmax(130px, .7fr);
    align-items: center;
    gap: 7px;
    padding: 7px;
}

.visit4-complaint-table > header {
    color: #253942;
    background: #e4e7ef;
    font-weight: 900;
}

.visit4-complaint-row:nth-child(odd) {
    background: #f1f1f1;
}

.visit4-complaint-row > strong {
    color: #263d47;
    font-size: 0.8125rem;
}

.visit4-severity {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.visit4-severity label {
    cursor: pointer;
}

.visit4-severity input {
    position: absolute;
    width: 1px;
    height: 1px;
    min-height: 0;
    opacity: 0;
}

.visit4-severity span {
    display: inline-flex;
    min-height: 34px;
    max-width: 100%;
    padding: 5px 10px;
    align-items: center;
    justify-content: center;
    border: 1px solid #c5d1d7;
    border-radius: 999px;
    color: #566970;
    background: #ffffff;
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1.25;
    text-align: center;
    white-space: normal;
}

.visit4-severity input:checked + span {
    color: #ffffff;
    border-color: var(--clinic-primary);
    background: var(--clinic-primary);
}

.visit4-cc-toggle-field {
    flex: 0 0 auto;
    padding: 9px 5px;
    align-items: center;
    background: #fff;
}

.visit4-cc-toggle-field:first-child {
    padding-inline-start: 10px;
}

.visit4-cc-toggle-field + .visit4-cc-field,
.visit4-cc-toggle-field + .visit4-cc-wide {
    border-top: 1px solid #dbe4e8;
}

.visit4-duration {
    display: grid;
    grid-template-columns: 65px 1fr;
}

.visit4-duration input,
.visit4-duration select,
.visit4-complaint-row > select {
    width: 100%;
    min-height: 36px;
    padding: 4px 7px;
    border: 1px solid #c8d4d9;
    border-radius: 6px;
    color: #263d47;
    background: #ffffff;
}

.visit4-examination-workspace {
    padding: 0;
    overflow: hidden;
    border-color: rgba(var(--clinic-primary-rgb), .38) !important;
}

.visit4-examination-note {
    border-bottom: 1px solid rgba(var(--clinic-primary-rgb), .2);
    background: rgba(255, 255, 255, .72);
}

.visit4-examination-note > summary {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    min-height: 45px;
    padding: 8px 12px;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    list-style: none;
}

.visit4-examination-note > summary::-webkit-details-marker { display: none; }

.visit4-examination-note > summary .visit-ui-icon {
    width: 21px;
    height: 21px;
    color: var(--clinic-primary);
}

.visit4-examination-note > summary > strong {
    color: var(--clinic-primary-strong);
    font-size: 0.75rem;
    font-weight: 900;
}

.visit4-examination-note > summary > b {
    display: grid;
    width: 25px;
    height: 25px;
    place-items: center;
    border-radius: 50%;
    color: #ffffff;
    background: var(--clinic-primary);
    font-size: 1.0625rem;
    line-height: 1;
}

.visit4-examination-note > summary > b::before { content: "+"; }
.visit4-examination-note[open] > summary > b::before { content: "\2212"; }

.visit4-examination-note > div {
    padding: 0 12px 11px;
}

.visit4-examination-note textarea {
    width: 100%;
    min-height: 72px;
    padding: 10px 12px;
    resize: vertical;
    border: 1px solid #c5d3da;
    border-radius: 9px;
    outline: none;
    color: #263d47;
    background: #ffffff;
    font: inherit;
    line-height: 1.5;
}

.visit4-examination-note textarea:focus {
    border-color: var(--clinic-primary);
    box-shadow: 0 0 0 3px rgba(var(--clinic-primary-rgb), .1);
}

.visit4-examination-note summary { position: relative; }
.visit4-note-shortcuts { display: flex; min-width: 0; width: 100%; align-items: center; justify-content: flex-end; gap: 5px; margin-inline-start: auto; flex-wrap: wrap; }
.visit4-note-shortcut { display: inline-flex; min-height: 29px; padding: 3px 10px; flex: 0 0 auto; align-items: center; gap: 5px; border: 1px solid rgba(var(--clinic-primary-rgb),.32); border-radius: 9px; color: var(--clinic-primary-strong); background: var(--clinic-primary-soft); cursor: pointer; font: inherit; font-size: 0.75rem; font-weight: 800; white-space: nowrap; }
.visit4-note-shortcut.is-active { border-color: var(--clinic-primary); color: #fff; background: var(--clinic-primary); box-shadow: 0 3px 10px rgba(var(--clinic-primary-rgb), .25); }
.visit4-note-add { display: inline-grid; width: 29px; height: 29px; padding: 0; flex: 0 0 29px; place-items: center; border: 0; border-radius: 9px; color: #fff; background: var(--clinic-primary); cursor: pointer; font-size: 1.3125rem; font-weight: 900; line-height: 1; }
.visit4-note-add img { width: 18px; height: 18px; object-fit: contain; }
.visit4-complaint-category-icon { width: 21px; height: 21px; object-fit: contain; vertical-align: middle; }
.visit4-note-shortcut-modal[hidden] { display: none; }
.visit4-note-shortcut-modal { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 18px; }
.visit4-note-shortcut-backdrop { position: absolute; inset: 0; background: rgba(11, 18, 48, .48); backdrop-filter: blur(3px); }
.visit4-note-shortcut-modal > section { position: relative; z-index: 1; display: grid; width: min(390px, 100%); gap: 16px; padding: 20px; border: 1px solid #ded5f5; border-radius: 18px; color: #263e49; background: #fff; box-shadow: 0 24px 70px rgba(20, 17, 68, .32); }
.visit4-note-shortcut-modal header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.visit4-note-shortcut-modal h3 { margin: 0; color: var(--clinic-primary-strong); font-size: 1.1875rem; }
.visit4-note-shortcut-modal header button { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; color: #fff; background: #d85b72; cursor: pointer; font-size: 1.3125rem; line-height: 1; }
.visit4-note-shortcut-modal label { display: grid; gap: 6px; }
.visit4-note-shortcut-modal label span { color: #526771; font-size: 0.8125rem; font-weight: 800; }
.visit4-note-shortcut-modal input { min-height: 45px; padding: 8px 11px; border: 1px solid #cbd8df; border-radius: 10px; color: #263e49; background: #fff; }
.visit4-note-modal-list { display: grid; max-height: 170px; gap: 6px; overflow: auto; }
.visit4-note-modal-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 9px; border-radius: 8px; color: #405762; background: var(--clinic-primary-soft); font-size: 0.8125rem; font-weight: 800; }
.visit4-note-modal-item button { width: 25px; height: 25px; padding: 0; border: 0; border-radius: 50%; color: #fff; background: #d85b72; cursor: pointer; font-size: 1rem; line-height: 1; }
.visit4-note-shortcut-modal footer { display: flex; justify-content: flex-end; gap: 8px; }
.visit4-note-shortcut-modal footer button { min-height: 38px; padding: 6px 15px; border: 0; border-radius: 9px; color: #fff; background: #84939a; cursor: pointer; font: inherit; font-weight: 800; }
.visit4-note-shortcut-modal footer .is-primary { background: var(--clinic-primary); }
.visit4-complaint-workspace > .visit4-examination-note { grid-column: 1 / -1; }

.visit4-exam-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 3px;
    padding: 0;
    overflow-x: auto;
    background: rgba(var(--clinic-primary-rgb), .12);
}

.visit4-exam-tabs button {
    min-height: 43px;
    border: 0;
    border-radius: 8px 8px 0 0;
    color: var(--clinic-primary-strong);
    background: rgba(255, 255, 255, .86);
    cursor: pointer;
    font-family: inherit;
    font-weight: 900;
}

.visit4-exam-tab-count,
.visit4-exam-card-count {
    display: inline-grid;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    place-items: center;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 900;
    line-height: 1;
}

.visit4-exam-tab-count {
    margin-inline-start: 7px;
    color: #ffffff;
    background: var(--clinic-primary);
    box-shadow: 0 2px 8px rgba(70, 38, 157, .25);
}

.visit4-exam-tabs button.is-active .visit4-exam-tab-count {
    color: var(--clinic-primary);
    background: #ffffff;
}

.visit4-exam-tab-count[hidden],
.visit4-exam-card-count[hidden] {
    display: none;
}

.visit4-exam-tabs button[hidden] {
    display: none;
}

.visit4-exam-tabs button.is-active {
    color: #ffffff;
    background: var(--clinic-primary);
}

.visit4-exam-panel {
    display: none;
    padding: 14px;
}

.visit4-exam-panel.is-active {
    display: block;
}

.visit4-exam-panel[data-visit4-exam-panel="general"].is-active {
    display: flex;
    flex-direction: column;
}

.visit4-exam-accordion {
    display: grid;
    gap: 8px;
}

.visit4-exam-card {
    overflow: hidden;
    border: 1px solid #cbd8de;
    border-radius: 9px;
    background: #fff;
}

.visit4-exam-card > summary {
    display: flex;
    min-height: 45px;
    padding: 9px 13px;
    align-items: center;
    justify-content: space-between;
    color: var(--clinic-primary-strong);
    background: var(--clinic-primary-soft);
    cursor: pointer;
    list-style: none;
    font-size: 0.9375rem;
    font-weight: 900;
}

.visit4-exam-card > summary::-webkit-details-marker { display: none; }
.visit4-exam-card-count { margin-inline-start:auto; margin-inline-end:8px; color:#fff; background:var(--clinic-primary); }
.visit4-exam-card > summary::after { content: "+"; display:grid; width:27px; height:27px; place-items:center; border-radius:50%; color:var(--clinic-primary); background:#fff; font-size:1.1875rem; line-height:1; }
.visit4-exam-card[open] > summary::after { content: "−"; color:#fff; background:var(--clinic-primary); }

.visit4-exam-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    padding: 8px;
}

.visit4-exam-choice-field,
.visit4-exam-input-field {
    display: grid;
    grid-template-columns: minmax(150px, 31%) minmax(0, 1fr);
    min-width: 0;
    min-height: 55px;
    padding: 8px 10px;
    align-items: center;
    gap: 9px;
    border-bottom: 1px solid #e1e7ea;
}

.visit4-exam-choice-field > strong,
.visit4-exam-input-field > strong { color:#304954; font-size:0.75rem; }
.visit4-exam-wide { grid-column:1 / -1; }
.visit4-exam-choices { display:flex; flex-wrap:wrap; gap:5px; }
.visit4-exam-choices label { cursor:pointer; }
.visit4-exam-choices input { position:absolute; width:1px; height:1px; opacity:0; }
.visit4-exam-choices span { display:inline-flex; min-height:32px; padding:5px 9px; align-items:center; justify-content:center; border:1px solid #c6d3d9; border-radius:999px; color:#566b75; background:#fff; font-size:0.6875rem; font-weight:900; line-height:1.2; text-align:center; }
.visit4-exam-choices input:checked + span { color:#fff; border-color:var(--clinic-primary); background:var(--clinic-primary); }
.visit4-exam-toggle-list { display:flex; flex-wrap:wrap; gap:7px; padding:10px; border-bottom:1px solid #e1e7ea; }
.visit4-exam-card-grid > .visit4-exam-toggle,
.visit4-exam-side > .visit4-exam-toggle,
.visit4-exam-conditional > .visit4-exam-toggle { padding:10px; border-bottom:1px solid #e1e7ea; }
.visit4-exam-toggle label { cursor:pointer; }
.visit4-exam-toggle input { position:absolute; width:1px; height:1px; opacity:0; }
.visit4-exam-toggle span { display:inline-flex; min-height:34px; padding:6px 11px; align-items:center; justify-content:center; border:1px solid #c6d3d9; border-radius:999px; color:#566b75; background:#fff; font-size:0.75rem; font-weight:900; line-height:1.2; text-align:center; }
.visit4-exam-toggle input:checked + span { color:#fff; border-color:var(--clinic-primary); background:var(--clinic-primary); }
.visit4-exam-input-field > span { display:flex; min-width:0; }
.visit4-exam-input-field input { min-height:39px; padding:7px 9px; border:1px solid #c7d4da; border-radius:7px; color:#263f4a; background:#fff; }
.visit4-exam-input-field textarea { width:100%; min-height:70px; padding:8px 10px; resize:vertical; border:1px solid #c7d4da; border-radius:7px; color:#263f4a; background:#fff; font:inherit; }
.visit4-exam-input-field b { display:grid; min-width:40px; padding:0 6px; place-items:center; border:1px solid #c7d4da; border-left:0; border-radius:0 7px 7px 0; color:#63757d; background:#eef3f5; font-size:0.625rem; }
.visit4-exam-conditional[hidden] { display:none !important; }
.visit4-exam-general-additions { order:-1; margin:0 0 14px; }
[data-exam-disable-when].is-disabled { opacity:.58; }
.visit4-exam-subcard { margin:7px; padding:7px; border:1px dashed rgba(var(--clinic-primary-rgb),.35); border-radius:9px; background:var(--clinic-primary-soft); }
.visit4-exam-subcard > h4 { margin:3px 7px 6px; color:var(--clinic-primary-strong); }
.visit4-exam-side-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; padding:9px; }
.visit4-exam-side { min-width:0; padding:7px; border:1px solid #d9e2e6; border-radius:8px; background:#fafcfd; }
.visit4-exam-side > h4 { margin:0; padding:7px 9px; color:#fff; border-radius:6px; background:var(--clinic-primary); }
.visit4-exam-side .visit4-exam-choice-field,
.visit4-exam-side .visit4-exam-input-field { grid-template-columns:1fr; gap:5px; }

@media (max-width: 900px) {
    .visit4-exam-card-grid,
    .visit4-exam-side-grid { grid-template-columns: 1fr; }
    .visit4-exam-choice-field,
    .visit4-exam-input-field { grid-template-columns: 1fr; gap: 6px; }
}

.visit4-exam-panel > h3 {
    margin: 14px 0 10px;
    padding: 7px 10px;
    color: #ffffff;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--clinic-primary-deep), var(--clinic-primary) 38%, transparent 38%);
    font-size: 0.9375rem;
}

.visit4-exam-panel > h3:first-child {
    margin-top: 0;
}

.visit4-compact-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(280px, 1fr));
    gap: 10px 14px;
}

.visit4-compact-grid.single {
    grid-template-columns: minmax(280px, 390px);
}

.visit4-compact-field {
    display: grid;
    grid-template-columns: minmax(90px, .8fr) minmax(110px, 1fr) minmax(120px, 1.15fr);
    align-items: end;
    gap: 7px;
    min-width: 0;
}

.visit4-compact-field > strong {
    align-self: center;
    color: #24353e;
    font-size: 0.75rem;
}

.visit4-compact-field label,
.visit4-number-field {
    display: grid;
    min-width: 0;
}

.visit4-compact-field label small,
.visit4-number-field small {
    margin: 0 0 -7px 8px;
    z-index: 1;
    width: max-content;
    padding: 0 3px;
    color: #75838a;
    background: #ffffff;
    font-size: 0.625rem;
}

.visit4-compact-field select,
.visit4-compact-field textarea,
.visit4-number-field input {
    width: 100%;
    min-height: 44px;
    padding: 8px 10px;
    border: 1px solid #c8d5db;
    border-radius: 7px;
    outline: none;
    color: #223842;
    background: #ffffff;
    font: inherit;
}

.visit4-compact-field textarea {
    height: 44px;
    resize: vertical;
}

.visit4-vitals-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(130px, 1fr));
    gap: 10px;
}

.visit4-number-field > span {
    position: relative;
    display: flex;
}

.visit4-number-field b {
    display: inline-flex;
    min-width: 46px;
    align-items: center;
    justify-content: center;
    color: #66757c;
    border: 1px solid #c8d5db;
    border-left: 0;
    border-radius: 0 7px 7px 0;
    background: #eef3f5;
    font-size: 0.6875rem;
}

.visit4-number-field b + input,
.visit4-number-field input:has(+ b) {
    border-radius: 7px 0 0 7px;
}

.visit4-bp-guide {
    display: grid;
    grid-template-columns: 1.2fr repeat(4, 1fr);
    margin-top: 12px;
    overflow: hidden;
    border: 1px solid #96b9cf;
    border-radius: 7px;
}

.visit4-bp-guide > * {
    padding: 8px;
    color: #29434e;
    border-right: 1px solid #b9ceda;
    background: #ffffff;
    font-size: 0.6875rem;
}

.visit4-bp-guide strong {
    background: #cce8f8;
}

.visit-empty {
    display: grid;
    width: min(680px, 100%);
    margin: 8vh auto 0;
    padding: 42px;
    place-items: center;
    border-radius: 22px;
    color: #16323e;
    text-align: center;
}

.visit-empty svg {
    width: 76px;
    fill: none;
    stroke: var(--clinic-primary-strong);
    stroke-width: 1.7;
}

.visit-empty h1 {
    margin: 18px 0 8px;
}

.visit-empty p {
    color: #50636d;
    line-height: 1.8;
}

.visit-empty .dark-btn {
    display: inline-grid;
    min-width: 150px;
    place-items: center;
    text-decoration: none;
}

.visit-patient-bar {
    display: grid;
    grid-template-columns: minmax(250px, 1fr) auto auto;
    align-items: center;
    gap: 18px;
    padding: 14px 18px;
    border-radius: 16px;
    color: #17303b;
}

.visit-patient-main h1 {
    display: inline;
    margin: 0 8px;
    font-size: 1.6875rem;
}

.visit-patient-main p {
    margin: 5px 0 0;
    color: #5c6e77;
    font-weight: 800;
}

.visit-live-dot {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    color: #087344;
    background: #d9fae9;
    font-size: 0.8125rem;
    font-weight: 900;
    white-space: nowrap;
}

.visit-live-dot > span {
    display: inline-block;
    flex: 0 0 auto;
    white-space: nowrap;
}

.visit-live-dot::before {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    content: "";
    background: #12a661;
    box-shadow: 0 0 0 4px rgba(18, 166, 97, .14);
}

.visit-file-number-code {
    display: inline-block;
    flex: 0 0 auto;
    direction: ltr;
    unicode-bidi: isolate;
    letter-spacing: .5px;
    font: inherit;
}

.visit-patient-facts {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.visit-patient-facts span {
    display: grid;
    min-width: 90px;
    padding: 7px 10px;
    border-radius: 9px;
    color: #65757d;
    background: rgba(255, 255, 255, .66);
    font-size: 0.75rem;
    text-align: center;
}

.visit-patient-facts strong {
    margin-top: 2px;
    color: #172f3a;
    font-size: 0.9375rem;
}

.visit-patient-facts .visit-patient-inline-action {
    display: inline-flex;
    min-width: 100px;
    min-height: 48px;
    padding: 7px 13px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 9px;
    color: #ffffff;
    background: var(--clinic-primary);
    cursor: pointer;
    font: inherit;
    font-size: 1rem;
    font-weight: 900;
    line-height: 1.2;
    text-decoration: none;
}

.visit-patient-facts .visit-patient-inline-action.is-print { background:var(--clinic-primary-strong); }
.visit-patient-facts .visit-patient-inline-action.is-next { background:#43b982; }
.visit-patient-facts span.has-labs {
    color: #087344;
    background: #d9fae9;
}

.visit-save-state {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 112px;
    padding: 8px 12px;
    border-radius: 10px;
    color: #ffffff;
    background: var(--clinic-primary-strong);
    text-align: center;
    font-weight: 900;
    white-space: nowrap;
}

.visit-save-state small {
    display: none;
}

.visit-tabs {
    display: flex;
    gap: 7px;
    margin: 10px 0;
    padding: 8px;
    overflow-x: auto;
    border-radius: 14px;
    scrollbar-width: thin;
}

.visit-tabs button {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 7px;
    min-height: 44px;
    padding: 6px 11px;
    border: 1px solid rgba(50, 75, 95, .18);
    border-radius: 10px;
    color: #3e5059;
    background: rgba(255, 255, 255, .74);
    cursor: pointer;
    font-family: inherit;
    font-weight: 900;
}

.visit-ui-icon {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.visit-tabs button .visit-ui-icon {
    color: var(--visit-icon-color, var(--clinic-secondary));
}

.visit-tabs button.is-active .visit-ui-icon {
    color: #ffffff;
}

.visit-tabs button[data-visit-tab="personal"] { --visit-icon-color: var(--clinic-secondary); }
.visit-tabs button[data-visit-tab="complaints"] { --visit-icon-color: #df5d68; }
.visit-tabs button[data-visit-tab="luts"] { --visit-icon-color: #1595b6; }
.visit-tabs button[data-visit-tab="pain"] { --visit-icon-color: #ad5e00; }
.visit-tabs button[data-visit-tab="urine"] { --visit-icon-color: #148ebf; }
.visit-tabs button[data-visit-tab="sexual"] { --visit-icon-color: #cc4b87; }
.visit-tabs button[data-visit-tab="general_exam"] { --visit-icon-color: #178567; }
.visit-tabs button[data-visit-tab="genital_exam"] { --visit-icon-color: #7655c9; }
.visit-tabs button[data-visit-tab="diagnosis"] { --visit-icon-color: #4765c7; }
.visit-tabs button[data-visit-tab="investigations"] { --visit-icon-color: #15917e; }
.visit-tabs button[data-visit-tab="treatment"] { --visit-icon-color: #d05a44; }
.visit-tabs button[data-visit-tab="followup"] { --visit-icon-color: #487d3d; }

.visit-tabs button b {
    display: grid;
    width: 25px;
    height: 25px;
    place-items: center;
    border-radius: 50%;
    color: var(--clinic-primary-strong);
    background: #e5ddff;
    font-size: 0.75rem;
}

.visit-tabs button.is-active {
    color: #ffffff;
    border-color: var(--clinic-primary-strong);
    background: var(--clinic-primary-strong);
}

.visit-tabs button.is-active b {
    color: var(--clinic-primary-strong);
    background: #ffffff;
}

.visit-tabs button em {
    display: grid;
    min-width: 21px;
    height: 21px;
    padding: 0 5px;
    place-items: center;
    border-radius: 999px;
    color: #ffffff;
    background: #e25555;
    font-size: 0.6875rem;
    font-style: normal;
}

.visit-section {
    display: none;
    padding: 18px;
    border-radius: 16px;
    color: #17303b;
}

.visit-section.is-active {
    display: block;
}

.visit-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.visit-section-heading {
    display: flex;
    align-items: center;
    gap: 12px;
}

.visit-section-heading > i {
    display: grid;
    width: 52px;
    height: 52px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 15px;
    color: #ffffff;
    background: var(--visit-section-accent, var(--clinic-secondary));
    box-shadow: 0 10px 24px color-mix(in srgb, var(--visit-section-accent, var(--clinic-secondary)) 28%, transparent);
}

.visit-section-heading > i .visit-ui-icon {
    width: 28px;
    height: 28px;
}

.visit-section[data-visit-section="personal"] { --visit-section-accent: var(--clinic-secondary); }
.visit-section[data-visit-section="complaints"] { --visit-section-accent: #df5d68; }
.visit-section[data-visit-section="luts"] { --visit-section-accent: #1595b6; }
.visit-section[data-visit-section="pain"] { --visit-section-accent: #ad5e00; }
.visit-section[data-visit-section="urine"] { --visit-section-accent: #148ebf; }
.visit-section[data-visit-section="sexual"] { --visit-section-accent: #cc4b87; }
.visit-section[data-visit-section="general_exam"] { --visit-section-accent: #178567; }
.visit-section[data-visit-section="genital_exam"] { --visit-section-accent: #7655c9; }
.visit-section[data-visit-section="diagnosis"] { --visit-section-accent: #4765c7; }
.visit-section[data-visit-section="investigations"] { --visit-section-accent: #15917e; }
.visit-section[data-visit-section="treatment"] { --visit-section-accent: #d05a44; }
.visit-section[data-visit-section="followup"] { --visit-section-accent: #487d3d; }

.visit-section-title span {
    color: var(--clinic-secondary);
    font-weight: 900;
}

.visit-section-title h2 {
    margin: 2px 0 0;
    font-size: 1.8125rem;
}

.visit-section-title > strong {
    padding: 8px 12px;
    border-radius: 999px;
    color: #ffffff;
    background: var(--clinic-primary-strong);
}

.visit-group {
    margin-bottom: 14px;
    padding: 16px;
    border: 1px solid rgba(53, 89, 117, .22);
    border-radius: 14px;
    background: rgba(255, 255, 255, .58);
}

.visit-group > h3,
.visit-group-heading h3 {
    margin: 0 0 13px;
    color: var(--clinic-primary-strong);
    font-size: 1.25rem;
}

.visit-fields-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
}

.visit-field {
    min-width: 0;
    padding: 12px;
    border: 1px solid rgba(53, 89, 117, .14);
    border-radius: 11px;
    background: rgba(247, 252, 255, .7);
}

.visit-field h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    color: #364b56;
    font-size: 0.9375rem;
}

.visit-field h4 > i {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 10px;
    color: var(--clinic-secondary);
    background: #e7eaff;
    font-style: normal;
}

.visit-field h4 > i .visit-ui-icon {
    width: 20px;
    height: 20px;
}

.visit-field[data-visit-field="education"] h4 > i { color: #5b4ac4; background: #ebe7ff; }
.visit-field[data-visit-field="marital_status"] h4 > i { color: #c6487b; background: #ffe4ef; }
.visit-field[data-visit-field="children_count"] h4 > i { color: #168456; background: #dff7ea; }
.visit-field[data-visit-field="smoking_status"] h4 > i,
.visit-field[data-visit-field="cigarettes_daily"] h4 > i { color: #9a4d42; background: #f9e4df; }
.visit-field[data-visit-field="smoking_years"] h4 > i { color: #4e68a9; background: #e4ebfb; }
.visit-field[data-visit-field="alcohol"] h4 > i { color: #a66b16; background: #fff0cf; }
.visit-field[data-visit-field="other_habits"] h4 > i { color: #9a7210; background: #fff5c9; }
.visit-field[data-visit-field="other_habits_note"] h4 > i { color: #61717a; background: #e9eff2; }
.visit-field[data-visit-field="urine_color"] h4 > i { color: #1688ac; background: #ddf4fb; }

.visit-choice-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.visit-choice {
    cursor: pointer;
}

.visit-choice input {
    position: absolute;
    width: 1px;
    height: 1px;
    min-height: 0;
    padding: 0;
    clip-path: inset(50%);
    opacity: 0;
}

.visit-choice span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    margin: 0;
    padding: 6px 12px;
    border: 1px solid #b9cbd3;
    border-radius: 9px;
    color: #354b56;
    background: #ffffff;
    font-size: 0.875rem;
    font-weight: 900;
    transition: .15s ease;
}

.visit-choice span .visit-ui-icon {
    width: 18px;
    height: 18px;
    margin-inline-end: 6px;
}

.visit-choice span b {
    font-weight: 900;
}

.visit-choice input:checked + span {
    color: #ffffff;
    border-color: var(--clinic-primary-strong);
    background: var(--clinic-primary-strong);
    box-shadow: 0 5px 14px rgba(var(--clinic-primary-strong-rgb), .22);
}

.visit-choice.is-choice-safe span { color: #176943; border-color: #8fd0b1; background: #e3f8ed; }
.visit-choice.is-choice-safe input:checked + span { color: #fff; border-color: #168456; background: #168456; }
.visit-choice.is-choice-danger span { color: #9b2f3b; border-color: #e39aa2; background: #ffe5e8; }
.visit-choice.is-choice-danger input:checked + span { color: #fff; border-color: #c83e4c; background: #c83e4c; }
.visit-choice.is-choice-warning span { color: #88540c; border-color: #e0b66f; background: #fff0d3; }
.visit-choice.is-choice-warning input:checked + span { color: #fff; border-color: #c27a13; background: #c98212; }
.visit-choice.is-choice-muted span { color: #586970; border-color: #b8c5ca; background: #edf2f4; }
.visit-choice.is-choice-muted input:checked + span { color: #fff; border-color: #62737b; background: #62737b; }
.visit-choice.is-choice-blue span { color: #2857a2; border-color: #9db9e4; background: #e6effd; }
.visit-choice.is-choice-blue input:checked + span { color: #fff; border-color: #3f69b4; background: #476fc0; }
.visit-choice.is-choice-pink span { color: #a43b6c; border-color: #df9fbd; background: #ffe6f1; }
.visit-choice.is-choice-pink input:checked + span { color: #fff; border-color: #c6487b; background: #c6487b; }
.visit-choice.is-choice-purple span { color: #5c45a8; border-color: #b8a9e5; background: #eeeaff; }
.visit-choice.is-choice-purple input:checked + span { color: #fff; border-color: #7056c4; background: #7056c4; }

.visit-choice.is-urine-normal span {
    color: #6f5a00;
    border-color: #e2ca58;
    background: #fff7bd;
}

.visit-choice.is-urine-normal input:checked + span {
    color: #4e3e00;
    border-color: #d3ad00;
    background: #f6d84e;
}

.visit-choice.is-urine-dark-yellow span {
    color: #7a4a00;
    border-color: #d99a2e;
    background: #ffe2a7;
}

.visit-choice.is-urine-dark-yellow input:checked + span {
    color: #ffffff;
    border-color: #bd7300;
    background: #c98212;
}

.visit-choice.is-urine-red span {
    color: #9b2632;
    border-color: #e38c95;
    background: #ffe1e4;
}

.visit-choice.is-urine-red input:checked + span {
    color: #ffffff;
    border-color: #b72d3b;
    background: #c83e4c;
}

.visit-choice.is-urine-brown span {
    color: #6b3b22;
    border-color: #ad795c;
    background: #ead1c1;
}

.visit-choice.is-urine-brown input:checked + span {
    color: #ffffff;
    border-color: #6c3d27;
    background: #795039;
}

.visit-choice.is-urine-clear span {
    color: #31738a;
    border-color: #8dcedf;
    background: #e4f8ff;
}

.visit-choice.is-urine-clear input:checked + span {
    color: #174f62;
    border-color: #4aadc8;
    background: #aee8f7;
}

.visit-stepper {
    display: grid;
    grid-template-columns: 46px minmax(70px, 110px) 46px;
    justify-content: start;
    direction: ltr;
}

.visit-stepper button {
    border: 0;
    color: #ffffff;
    background: var(--clinic-primary-strong);
    cursor: pointer;
    font-size: 1.5rem;
    font-weight: 900;
}

.visit-stepper button:first-child { border-radius: 9px 0 0 9px; }
.visit-stepper button:last-child { border-radius: 0 9px 9px 0; }

.visit-stepper input {
    min-height: 44px;
    padding: 0 6px;
    border: 1px solid #c4d2d8;
    border-radius: 0;
    color: #172f3a;
    background: #ffffff;
    text-align: center;
    font-weight: 900;
}

.visit-field textarea {
    width: 100%;
    min-height: 76px;
    padding: 10px 12px;
    border: 1px solid #c4d2d8;
    border-radius: 9px;
    outline: none;
    color: #172f3a;
    background: #ffffff;
    resize: vertical;
    font: inherit;
}

.visit-personal-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
    margin-bottom: 13px;
}

.visit-personal-summary span {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 5px;
    padding: 11px;
    border-radius: 10px;
    color: #69777e;
    background: #ffffff;
    font-size: 0.8125rem;
}

.visit-personal-summary span > i {
    display: grid;
    grid-row: 1 / 3;
    width: 36px;
    height: 36px;
    place-items: center;
    align-self: center;
    border-radius: 10px;
    color: var(--clinic-secondary);
    background: #e7eaff;
    font-style: normal;
}

.visit-personal-summary span > i .visit-ui-icon {
    width: 21px;
    height: 21px;
}

.visit-personal-summary span:nth-child(2) > i { color: #a46c13; background: #fff0cf; }
.visit-personal-summary span:nth-child(3) > i { color: #c04f82; background: #ffe5f0; }
.visit-personal-summary span:nth-child(4) > i { color: #168456; background: #dff7ea; }
.visit-personal-summary span:nth-child(5) > i { color: #167aa0; background: #dff4fb; }
.visit-personal-summary span:nth-child(6) > i { color: #8a4fb0; background: #f2e5fb; }

.visit-dashboard-body .visit-personal-summary {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.visit-dashboard-body .visit-personal-summary span:nth-child(5) strong {
    font-size: 0.875rem;
    white-space: nowrap;
}

.visit-personal-summary span > em {
    color: #69777e;
    font-style: normal;
}

.visit-personal-summary strong {
    grid-column: 2;
    color: #19313c;
    font-size: 1.0625rem;
}

.ipss-score-card {
    display: grid;
    float: left;
    width: 155px;
    margin: 0 12px 12px 0;
    padding: 12px;
    place-items: center;
    border-radius: 12px;
    color: #ffffff;
    background: var(--clinic-primary-strong);
}

.ipss-score-card strong {
    font-size: 2.375rem;
}

.ipss-score-card small {
    color: rgba(255, 255, 255, .82);
}

.ipss-questions {
    clear: both;
}

.ipss-question {
    margin: 0 0 10px;
    padding: 11px;
    border: 1px solid rgba(53, 89, 117, .18);
    border-radius: 10px;
}

.ipss-question legend {
    padding: 0 6px;
    color: #334b56;
    font-weight: 900;
}

.ipss-options {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
}

.ipss-options label {
    cursor: pointer;
    text-align: center;
}

.ipss-options input {
    position: absolute;
    width: 1px;
    height: 1px;
    min-height: 0;
    padding: 0;
    clip-path: inset(50%);
    opacity: 0;
}

.ipss-options span {
    display: grid;
    width: 38px;
    height: 38px;
    margin: 0 auto 4px;
    place-items: center;
    border: 1px solid #b9cbd3;
    border-radius: 50%;
    color: #263d48;
    background: #ffffff;
    font-weight: 900;
}

.ipss-options input:checked + span {
    color: #ffffff;
    border-color: var(--clinic-primary-strong);
    background: var(--clinic-primary-strong);
}

.ipss-options small {
    display: block;
    color: #65757d;
    font-size: 0.625rem;
}

.visit-section-nav {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.visit-section-nav button,
.visit-action-bar button {
    min-height: 43px;
    padding: 0 20px;
    border: 0;
    border-radius: 10px;
    color: #ffffff;
    background: #536772;
    cursor: pointer;
    font-family: inherit;
    font-weight: 900;
}

.visit-section-nav button:disabled {
    opacity: 0;
    pointer-events: none;
}

.visit-group-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.visit-group-heading a {
    padding: 7px 11px;
    border-radius: 8px;
    color: #ffffff;
    background: var(--clinic-primary-strong);
    text-decoration: none;
    font-weight: 900;
}

.visit-lab-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 9px;
}

.visit-labs-by-date {
    display: grid;
    gap: 13px;
}

.visit-lab-day {
    overflow: hidden;
    border: 1px solid #c8d9e0;
    border-radius: 11px;
    background: rgba(255, 255, 255, .72);
}

.visit-lab-day > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    color: #29434e;
    background: #d9edf7;
}

.visit-lab-day > header div {
    display: flex;
    align-items: center;
    gap: 9px;
}

.visit-lab-day > header strong {
    color: var(--clinic-primary-deep);
    font-size: 1.0625rem;
}

.visit-lab-day > header span {
    color: #60727b;
    font-size: 0.8125rem;
    font-weight: 800;
}

.visit-lab-day > header b {
    padding: 5px 9px;
    border-radius: 999px;
    color: #ffffff;
    background: var(--clinic-primary-strong);
    font-size: 0.75rem;
}

.visit-lab-day .visit-lab-gallery {
    padding: 11px;
}

.visit-lab-gallery a {
    display: grid;
    gap: 4px;
    padding: 7px;
    overflow: hidden;
    border: 1px solid #cfdae0;
    border-radius: 9px;
    color: #334b56;
    background: #ffffff;
    text-decoration: none;
}

.visit-lab-gallery img {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 6px;
    object-fit: cover;
}

.visit-lab-gallery span {
    overflow: hidden;
    font-size: 0.75rem;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.visit-lab-gallery small { color: #6a7880; }

.visit-prescription-builder .visit-group-heading {
    margin-bottom: 14px;
}

.visit-dashboard-body .visit4-treatment-rosetta {
    padding: 10px;
    border: 1px solid #c8d8df;
    border-radius: 8px;
    background: rgba(255, 255, 255, .92);
}

.visit4-treatment-workspace {
    display: grid;
    grid-template-columns: 370px minmax(0, 1fr);
    gap: 14px;
}

.visit4-treatment-workspace > aside,
.visit4-treatment-workspace > main {
    min-width: 0;
}

.visit4-treatment-workspace > aside {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.visit4-treatment-workspace > main {
    padding-inline-start: 12px;
    border-inline-start: 1px solid #c9d9df;
}

.visit4-treatment-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    color: #18323d;
}

.visit4-treatment-title .visit-ui-icon {
    width: 21px;
    color: #f15b73;
}

.visit4-treatment-title h3 {
    margin: 0;
    font-size: 1.1875rem;
    white-space: nowrap;
}

.visit4-treatment-title > span {
    height: 3px;
    flex: 1;
    margin-inline-start: 7px;
    background: var(--clinic-secondary);
}

.visit4-treatment-title > b {
    padding: 5px 9px;
    border-radius: 20px;
    color: var(--clinic-primary);
    background: var(--clinic-primary-soft);
    font-size: 0.75rem;
    white-space: nowrap;
}

.visit4-treatment-title .visit4-load-treatment {
    flex: 0 0 auto;
    min-height: 30px;
    padding: 6px 12px;
    border: 0;
    border-radius: 18px;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
}

.visit4-treatment-followup {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
    color: #42545c;
    font-size: 0.6875rem;
    font-weight: 800;
    white-space: nowrap;
}

.visit4-treatment-followup > span {
    display: none;
}

.visit4-treatment-followup select {
    min-width: 112px;
    min-height: 30px;
    padding: 5px 28px 5px 9px;
    border: 1px solid #c9d6dc;
    border-radius: 8px;
    color: #263f4a;
    background: #ffffff;
    font: inherit;
    cursor: pointer;
}

.visit4-treatment-toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
    gap: 9px;
    margin: 0;
}

.visit4-treatment-toolbar .visit-drug-search-label {
    grid-column: 1 / -1;
    max-width: none;
    margin: 0;
}

.visit4-treatment-toolbar .visit-drug-search-label > span {
    justify-content: start;
    font-size: 0.6875rem;
    text-align: left;
}

.visit4-treatment-toolbar input,
.visit4-treatment-toolbar button {
    min-height: 43px;
    border-radius: 6px;
}

.visit4-treatment-toolbar button {
    padding: 0 18px;
    border: 0;
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

.visit4-load-treatment { background: #343b42; }
.visit4-add-treatment { background: var(--clinic-accent-strong); }

.visit4-treatment-toolbar .visit4-add-treatment {
    grid-column: 1 / -1;
}

.visit4-treatment-toolbar #visitAddToPrescription,
.visit4-treatment-toolbar #visitQuickRxToggle {
    grid-column: auto;
}

.visit4-quick-rx-toggle {
    background: #364e76;
}

.visit4-quick-rx-toggle.is-active {
    background: #25395c;
    box-shadow: 0 0 0 3px rgba(54, 78, 118, .16);
}

.visit4-quick-rx-panel {
    padding: 12px;
    border: 1px solid #b9d6e1;
    border-radius: 8px;
    background: linear-gradient(145deg, #f8fdff, #eef7fb);
}

.visit4-quick-rx-heading,
.visit4-quick-rx-heading > div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.visit4-quick-rx-heading {
    justify-content: space-between;
    margin-bottom: 10px;
}

.visit4-quick-rx-heading > div {
    align-items: flex-start;
    flex-direction: column;
    gap: 1px;
}

.visit4-quick-rx-heading strong { color: #183b55; font-size: 0.9375rem; }
.visit4-quick-rx-heading span { color: #6a7e89; font-size: 0.6875rem; }
.visit4-quick-rx-heading a,
.visit4-quick-rx-panel > p a { color: var(--clinic-accent-strong); font-size: 0.75rem; font-weight: 900; }
.visit4-quick-rx-panel > p { margin: 5px 0; color: #6b7c84; font-size: 0.75rem; }

.visit4-quick-rx-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.visit4-quick-rx-list button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 42px;
    padding: 7px 10px;
    color: #263e49;
    border: 1px solid #c8dce5;
    border-radius: 7px;
    background: #fff;
    cursor: pointer;
    font-family: inherit;
    text-align: start;
}

.visit4-quick-rx-list button:hover { border-color: var(--clinic-accent-strong); background: rgba(var(--clinic-accent-rgb),.08); }
.visit4-quick-rx-list button span { color: #71858e; font-size: 0.625rem; white-space: nowrap; }

.quick-rx-page {
    display: grid;
    gap: 16px;
    width: min(var(--x2-page-max-width), calc(100% - var(--x2-page-inline-space)));
    margin: 18px auto 120px;
    direction: rtl;
    color: #263f4a;
}

.quick-rx-header,
.quick-rx-editor-title,
.quick-rx-templates article,
.quick-rx-templates article > a,
.quick-rx-drug-card > header {
    display: flex;
    align-items: center;
}

.quick-rx-header {
    justify-content: space-between;
    gap: 20px;
    padding: 24px 28px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 26px;
    background: linear-gradient(145deg, rgba(244, 252, 255, .82), rgba(205, 235, 245, .62));
    box-shadow: 0 18px 48px rgba(17, 67, 91, .16), inset 0 1px 0 rgba(255, 255, 255, .78);
}
.quick-rx-header > div { min-width: 0; }
.quick-rx-header span,
.quick-rx-editor-title span { color: var(--clinic-accent-strong); font-size: 0.75rem; font-weight: 900; }
.quick-rx-header h1 { margin: 3px 0; color: #203b48; font-size: 2rem; }
.quick-rx-header p { margin: 0; color: #607984; line-height: 1.7; }
.quick-rx-header .dark-btn {
    display: inline-flex;
    min-width: 118px;
    min-height: 46px;
    padding: 0 18px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    text-decoration: none;
}

.quick-rx-layout {
    display: grid;
    grid-template-columns: minmax(280px, 310px) minmax(0, 1fr);
    align-items: start;
    gap: 16px;
}

.quick-rx-templates,
.quick-rx-editor {
    min-width: 0;
    padding: 22px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(244, 252, 255, .8), rgba(207, 237, 246, .6));
    box-shadow: 0 16px 42px rgba(17, 67, 91, .15), inset 0 1px 0 rgba(255, 255, 255, .75);
}
.quick-rx-templates { position: sticky; top: 14px; }
.quick-rx-templates h2 { margin: 0 0 14px; color: #263f4a; font-size: 1.1875rem; }
.quick-rx-templates article { gap: 7px; margin-top: 9px; padding: 8px; border: 1px solid #d4e0e5; border-radius: 15px; background: rgba(255, 255, 255, .9); box-shadow: 0 6px 16px rgba(29, 73, 92, .06); }
.quick-rx-templates article.is-active { border-color: var(--clinic-accent-strong); box-shadow: 0 0 0 3px rgba(var(--clinic-accent-rgb),.1); }
.quick-rx-templates article > a { flex: 1; align-items: flex-start; flex-direction: column; gap: 2px; min-width: 0; padding: 5px; color: #273e48; text-decoration: none; }
.quick-rx-templates article > a strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-rx-templates article > a span { color: #73868f; font-size: 0.6875rem; }
.quick-rx-templates form button,
.quick-rx-drug-card > header button { padding: 8px 12px; color: #fff; border: 0; border-radius: 10px; background: #dc5360; cursor: pointer; font-family: inherit; font-weight: 800; }
.quick-rx-empty { padding: 24px; color: #6f848d; border: 1px dashed #b9d3dd; border-radius: 15px; background: rgba(255,255,255,.3); text-align: center; }

.quick-rx-editor-title { justify-content: space-between; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid #dce6ea; }
.quick-rx-editor-title h2 { margin: 3px 0 0; color: #263f4a; }
.quick-rx-editor-title .dark-btn { min-height: 46px; padding: 0 20px; border-radius: 13px; }
.quick-rx-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.quick-rx-fields label,
.quick-rx-drug-picker label { display: grid; gap: 6px; color: #4f6671; font-weight: 800; }
.quick-rx-fields input,
.quick-rx-fields textarea,
.quick-rx-drug-picker input { width: 100%; min-height: 50px; padding: 11px 14px; color: #263f4a; border: 1px solid #c3d6de; border-radius: 14px; background: rgba(255,255,255,.94); box-shadow: inset 0 1px 2px rgba(35,72,88,.04); font: inherit; outline: none; }
.quick-rx-fields input:focus,
.quick-rx-fields textarea:focus,
.quick-rx-drug-picker input:focus { border-color: var(--clinic-accent-strong); box-shadow: 0 0 0 3px rgba(var(--clinic-accent-rgb),.12); }
.quick-rx-fields textarea { resize: vertical; }

.quick-rx-drug-picker { position: relative; margin: 16px 0; }
.quick-rx-search-results { position: absolute; z-index: 30; top: calc(100% + 7px); right: 0; left: 0; max-height: 330px; padding: 7px; overflow: auto; border: 1px solid #bcd2dc; border-radius: 15px; background: #fff; box-shadow: 0 15px 35px rgba(28,57,69,.16); }
.quick-rx-search-results button { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 9px 11px; color: #263f4a; border: 0; border-bottom: 1px solid #edf2f4; background: transparent; cursor: pointer; font-family: inherit; text-align: start; }
.quick-rx-search-results button:hover { background: #effbfe; }
.quick-rx-search-results button:disabled { opacity: .55; cursor: default; }
.quick-rx-search-results button span { display: grid; gap: 2px; }
.quick-rx-search-results button small { color: #74868e; }
.quick-rx-search-results button b { color: var(--clinic-accent-strong); }

.quick-rx-selected { display: grid; gap: 10px; }
.quick-rx-drug-card { overflow: hidden; border: 1px solid #cfdee4; border-radius: 16px; background: #fff; box-shadow: 0 7px 18px rgba(29,73,92,.07); }
.quick-rx-drug-card > header { justify-content: space-between; gap: 12px; padding: 12px 14px; background: #f4f9fb; }
.quick-rx-drug-card > header > div { display: grid; gap: 2px; }
.quick-rx-drug-card > header span,
.quick-rx-drug-card > header small { color: #6d7f87; font-size: 0.6875rem; }

@media (max-width: 850px) {
    .quick-rx-layout,
    .quick-rx-fields { grid-template-columns: 1fr; }
    .quick-rx-header { align-items: flex-start; flex-direction: column; }
    .visit4-quick-rx-list { grid-template-columns: 1fr; }
}

.visit4-treatment-notes-slot .visit-field {
    display: grid;
    gap: 5px;
    padding: 0;
    border: 0;
    background: transparent;
}

.visit4-treatment-notes-slot .visit-field h4 {
    margin: 0;
    font-size: 0.75rem;
}

.visit4-treatment-notes-slot textarea {
    min-height: 300px;
    resize: vertical;
    background: #ffffff;
}

.visit4-frequent-drugs {
    display: grid;
    flex: 0 0 auto;
    grid-template-rows: minmax(0, 1fr);
    gap: 0;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: clamp(180px, 42vh, 620px);
    padding: 11px;
    box-sizing: border-box;
    overflow: hidden;
    border: 1px solid #cbd9df;
    border-radius: 8px;
    background: #fff;
}

.visit4-frequent-drugs > h3 {
    margin: 0;
    color: #263f49;
    font-size: 0.875rem;
    text-align: right;
}

.visit4-frequent-drugs > p {
    margin: 0;
    padding: 12px 5px;
    color: #77878e;
    font-size: 0.75rem;
    text-align: center;
}

.visit4-frequent-drug-list {
    display: grid;
    align-content: start;
    gap: 6px;
    min-width: 0;
    min-height: 0;
    max-height: none;
    overflow-x: hidden;
    overflow-y: auto;
}

.visit4-frequent-drug-list button {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 39px;
    padding: 6px 9px;
    box-sizing: border-box;
    border: 1px solid #d5e0e4;
    border-radius: 6px;
    color: #263f49;
    background: #f8fbfc;
    cursor: pointer;
    text-align: left;
}

.visit4-frequent-drug-list button:hover {
    border-color: var(--clinic-accent-strong);
    background: rgba(var(--clinic-accent-rgb),.08);
}

.visit4-frequent-drug-list button:disabled {
    opacity: .48;
    cursor: default;
}

.visit4-frequent-drug-list button span {
    display: block;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    font-size: 0.7188rem;
    font-weight: 800;
    line-height: 1.35;
    overflow-wrap: anywhere;
    white-space: normal;
    word-break: break-word;
}

.visit-dashboard-body [data-visit-section="treatment"] > .visit-section-title {
    display: none;
}

.visit-dashboard-body [data-visit-section="treatment"] > .visit4-treatment-rosetta {
    margin-bottom: 8px;
}

.visit-dashboard-body [data-visit-section="investigations"] > .visit-section-title {
    display: none;
}

.visit4-investigations-workspace {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    padding: 12px;
}

.visit4-investigations-title {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 11px;
    padding-bottom: 9px;
    border-bottom: 3px solid var(--clinic-secondary);
}

.visit4-investigations-title .visit-ui-icon {
    width: 25px;
    color: #ef5f70;
}

.visit4-investigations-title small {
    color: #687982;
    font-size: 0.625rem;
    font-weight: 800;
}

.visit4-investigations-title h3 {
    margin: 0;
    color: #1d3540;
    font-size: 1.1875rem;
}

.visit4-investigation-columns {
    display: grid;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
    gap: 12px;
}

.visit4-investigation-group {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    border: 1px solid #c9d8df;
    border-radius: 9px;
    background: #ffffff;
}

.visit4-investigation-group > header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 11px;
    color: #ffffff;
    background: var(--clinic-primary);
}

.visit4-investigation-group > header h4 {
    margin: 0;
    font-size: 0.875rem;
}

.visit4-investigation-list {
    display: grid;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 8px;
}

.visit4-investigation-item {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    align-self: start;
    overflow: hidden;
    border: 1px solid #d2dee3;
    border-radius: 7px;
    background: #f8fbfc;
}

.visit4-investigation-item > label {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 6px 8px;
    cursor: pointer;
}

.visit4-investigation-item > label input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.visit4-investigation-item > label span {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
    color: #304650;
    font-size: 0.75rem;
    font-weight: 800;
}

.visit4-investigation-item > label b {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 50%;
    color: var(--clinic-primary);
    background: var(--clinic-primary-soft);
}

.visit4-investigation-item.is-selected {
    border-color: var(--clinic-primary);
    background: var(--clinic-primary-soft);
}

.visit4-investigation-item.is-selected > label b {
    color: #ffffff;
    background: var(--clinic-primary);
}

.visit4-investigation-detail,
.visit4-investigation-note {
    width: calc(100% - 12px);
    min-width: 0;
    max-width: calc(100% - 12px);
    min-height: 34px;
    margin: 0 6px 6px;
    padding: 5px 8px;
    border: 1px solid #bfcfd6;
    border-radius: 6px;
    color: #263e49;
    background: #ffffff;
    font: inherit;
    font-size: 0.6875rem;
}

.visit4-investigation-detail[hidden],
.visit4-investigation-note[hidden] {
    display: none;
}

.visit-dashboard-body [data-visit-section="history"] > .visit-section-title {
    display: none;
}

.visit4-history-workspace {
    width: 100%;
    min-width: 0;
    padding: 12px;
    overflow: hidden;
}

.visit4-history-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding: 3px 3px 11px;
    border-bottom: 3px solid var(--clinic-secondary);
}

.visit4-history-title .visit-ui-icon {
    width: 27px;
    color: #ef5f70;
}

.visit4-history-title small,
.visit4-history-panel-heading small {
    color: #6a7d86;
    font-size: 0.625rem;
    font-weight: 800;
}

.visit4-history-title h3,
.visit4-history-panel-heading h4 {
    margin: 1px 0 0;
    color: #1d3540;
}

.visit4-history-title h3 { font-size: 1.1875rem; }

.visit4-history-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin-bottom: 12px;
    padding: 6px;
    border: 1px solid #d4dce9;
    border-radius: 13px;
    background: var(--clinic-primary-soft);
}

.visit4-history-tabs button {
    display: inline-flex;
    min-width: 0;
    min-height: 43px;
    padding: 7px 12px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 9px;
    color: #3f4f59;
    background: rgba(255,255,255,.72);
    cursor: pointer;
    font: inherit;
    font-weight: 900;
}

.visit4-history-tabs button > span {
    display: grid;
    width: 23px;
    height: 23px;
    place-items: center;
    border-radius: 50%;
    color: var(--clinic-primary);
    background: #e9e3ff;
    font-size: 0.6875rem;
}

.visit4-history-tabs button.is-active {
    color: #fff;
    background: var(--clinic-primary);
    box-shadow: 0 7px 17px rgba(67,38,151,.2);
}

.visit4-history-tabs button.is-active > span {
    color: var(--clinic-primary);
    background: #fff;
}
.visit4-history-add-surgery { min-height: 31px; padding: 5px 10px; border: 1px dashed var(--clinic-primary); border-radius: 8px; color: var(--clinic-primary); background: var(--clinic-primary-soft); cursor: pointer; font: inherit; font-size: 0.6875rem; font-weight: 900; }
.visit4-history-surgical-procedure.is-repeat { border-color: #e5b45c; background: #fff9eb; }
.visit4-history-surgical-procedure.is-repeat .visit4-exam-choice-field > strong,
.visit4-history-surgical-procedure.is-repeat .visit4-exam-input-field > strong { color: #9b6814; }

.visit4-history-panel {
    display: none;
    min-width: 0;
    padding: 13px;
    border: 1px solid #d4dee3;
    border-radius: 12px;
    background: rgba(255,255,255,.86);
}

.visit4-history-panel.is-active { display: block; }

.visit4-history-panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 13px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dbe4e8;
}

.visit4-history-panel-heading h4 { font-size: 1.0625rem; }

.visit4-history-grid,
.visit4-history-past-grid,
.visit4-ultrasound-grid,
.visit4-history-values-grid {
    display: grid;
    min-width: 0;
    gap: 10px;
}

.visit4-history-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.visit4-history-past-grid { grid-template-columns: minmax(260px, .75fr) minmax(0, 1.25fr); align-items: start; }
.visit4-ultrasound-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.visit4-history-values-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.visit4-history-prostate-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.visit4-history-field,
.visit4-history-expand-details > label,
.visit4-history-inline-detail > label,
.visit4-history-values-grid > label {
    display: grid;
    min-width: 0;
    gap: 5px;
}

.visit4-history-field > span,
.visit4-history-expand-details label > span,
.visit4-history-inline-detail label > span,
.visit4-history-values-grid label > span {
    color: #536a75;
    font-size: 0.6875rem;
    font-weight: 900;
}

.visit4-history-field.is-wide,
.visit4-history-field.is-full,
.visit4-history-expand-details > .is-full {
    grid-column: 1 / -1;
}

.visit4-history-field input,
.visit4-history-field select,
.visit4-history-field textarea,
.visit4-history-expand-details input,
.visit4-history-expand-details select,
.visit4-history-expand-details textarea,
.visit4-history-inline-detail input,
.visit4-history-inline-detail textarea,
.visit4-history-values-grid input,
.visit4-history-values-grid select {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid #c7d5dc;
    border-radius: 8px;
    outline: none;
    color: #243a45;
    background: #fff;
    font: inherit;
    font-size: 0.75rem;
}

.visit4-history-field textarea,
.visit4-history-expand-details textarea,
.visit4-history-inline-detail textarea { resize: vertical; }

.visit4-history-field input:focus,
.visit4-history-field select:focus,
.visit4-history-field textarea:focus,
.visit4-history-expand-details input:focus,
.visit4-history-expand-details select:focus,
.visit4-history-inline-detail input:focus,
.visit4-history-inline-detail textarea:focus,
.visit4-history-values-grid input:focus {
    border-color: var(--clinic-primary);
    box-shadow: 0 0 0 3px rgba(var(--clinic-primary-rgb),.1);
}

.visit4-history-choice-field,
.visit4-history-multi {
    min-width: 0;
    margin: 0;
    padding: 8px;
    border: 1px solid #d3dde2;
    border-radius: 9px;
    background: #f7fafb;
}

.visit4-history-choice-field legend,
.visit4-history-multi legend {
    padding: 0 5px;
    color: #536a75;
    font-size: 0.6875rem;
    font-weight: 900;
}

.visit4-history-choice-row {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    gap: 7px;
}

.visit4-history-choice-row label {
    position: relative;
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    cursor: pointer;
}

.visit4-history-choice-row input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.visit4-history-choice-row label > span {
    display: inline-flex;
    min-height: 34px;
    padding: 6px 12px;
    align-items: center;
    border: 1px solid #cbd8de;
    border-radius: 999px;
    color: #445d68;
    background: #fff;
    font-size: 0.6875rem;
    font-weight: 900;
}

.visit4-history-choice-row input:checked + span {
    border-color: var(--clinic-primary);
    color: #fff;
    background: var(--clinic-primary);
}

.visit4-history-inline-detail {
    margin-top: 9px;
    padding-top: 9px;
    border-top: 1px dashed #cedae0;
}

.visit4-history-inline-detail[hidden],
.visit4-history-expand-details[hidden] { display: none; }

.visit4-history-card,
.visit4-history-organ-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid #ccd9df;
    border-radius: 11px;
    background: #fff;
}

.visit4-history-exam-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid #cbd8de;
    border-radius: 9px;
    background: #fff;
}

.visit4-history-exam-card > summary {
    display: flex;
    min-height: 45px;
    padding: 9px 13px;
    align-items: center;
    justify-content: space-between;
    color: var(--clinic-primary-strong);
    background: var(--clinic-primary-soft);
    cursor: pointer;
    list-style: none;
    font-size: 0.9375rem;
    font-weight: 900;
}

.visit4-history-exam-card > summary::-webkit-details-marker { display: none; }
.visit4-history-exam-card > summary::after { content: "+"; display:grid; width:27px; height:27px; place-items:center; border-radius:50%; color:var(--clinic-primary); background:#fff; font-size:1.1875rem; line-height:1; }
.visit4-history-exam-card[open] > summary::after { content: "−"; color:#fff; background:var(--clinic-primary); }

.visit4-history-surgical-grid {
    display: grid;
    min-width: 0;
    padding: 8px;
}

.visit4-history-surgical-procedure {
    min-width: 0;
    border-bottom: 1px solid #e1e7ea;
}

.visit4-history-surgical-procedure:last-child { border-bottom: 0; }
.visit4-history-surgical-procedure > .visit4-exam-choice-field { background: #f7f8fa; }

.visit4-history-surgical-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
    padding-inline-start: 14px;
    border-inline-start: 3px solid #d8cdf7;
    background: #fff;
}

.visit4-history-surgical-details[hidden] { display: none !important; }
.visit4-history-surgical-details > .visit4-exam-choice-field,
.visit4-history-surgical-details > .visit4-exam-input-field { grid-template-columns:minmax(125px,31%) minmax(0,1fr); }

.visit4-history-card > header {
    padding: 11px 13px;
    color: #fff;
    background: var(--clinic-primary);
}

.visit4-history-card > header span { font-size: 0.5625rem; opacity: .82; }
.visit4-history-card > header h5 { margin: 2px 0 0; font-size: 0.875rem; }
.visit4-history-medical-list,
.visit4-history-surgery-list,
.visit4-history-organ-content { display: grid; min-width: 0; gap: 7px; padding: 10px; }

.visit4-history-check-row {
    display: flex;
    min-width: 0;
    min-height: 39px;
    padding: 7px 9px;
    align-items: center;
    gap: 8px;
    border: 1px solid #d5e0e4;
    border-radius: 8px;
    color: #304852;
    background: #f8fbfc;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 900;
}

.visit4-history-check-row input {
    width: 17px;
    height: 17px;
    accent-color: var(--clinic-primary);
}

.visit4-history-check-row > span {
    display: block;
    min-width: 0;
    margin: 0;
    flex: 1;
    color: #304852;
    background: transparent;
    font-size: 0.75rem;
    line-height: 1.35;
}
.visit4-history-check-row > b { display: grid; width: 23px; height: 23px; place-items: center; border-radius: 50%; color: var(--clinic-primary); background: var(--clinic-primary-soft); }
.visit4-history-check-row:has(input:checked) { border-color: rgba(var(--clinic-primary-rgb),.55); background: var(--clinic-primary-soft); }
.visit4-history-check-row:has(input:checked) > span { color: var(--clinic-primary-strong); }

.visit4-history-expand-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 9px;
    border: 1px solid #ded8f2;
    border-top: 0;
    border-radius: 0 0 8px 8px;
    background: #faf9ff;
}

.visit4-history-expand-details > .visit4-history-grade-field {
    grid-template-columns: 70px minmax(0, 1fr);
    min-height: 42px;
    padding: 0;
    border-bottom: 0;
}

.visit4-history-grade-field .visit4-exam-choices {
    flex-wrap: nowrap;
}

.visit4-history-expandable:has(> .visit4-history-expand-details:not([hidden])) > .visit4-history-check-row {
    border-radius: 8px 8px 0 0;
}

.visit4-history-organ-card > summary {
    display: flex;
    min-height: 45px;
    padding: 9px 12px;
    align-items: center;
    gap: 9px;
    color: #fff;
    background: var(--clinic-primary);
    cursor: pointer;
    list-style: none;
    font-size: 0.8125rem;
    font-weight: 900;
}

.visit4-history-organ-card > summary::-webkit-details-marker { display: none; }
.visit4-history-organ-card > summary span { min-width: 0; flex: 1; }
.visit4-history-organ-card > summary b { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 50%; color: var(--clinic-primary); background: #fff; }
.visit4-history-organ-card[open] { grid-column: 1 / -1; }
.visit4-history-organ-card[open] > .visit4-history-organ-content { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.visit4-history-bladder > .visit4-history-values-grid { grid-column: 1 / -1; }

@media (max-width: 850px) {
    .visit4-history-grid,
    .visit4-history-past-grid,
    .visit4-ultrasound-grid,
    .visit4-history-values-grid,
    .visit4-history-prostate-grid,
    .visit4-history-organ-card[open] > .visit4-history-organ-content,
    .visit4-history-expand-details,
    .visit4-history-surgical-details { grid-template-columns: 1fr; }
    .visit4-history-tabs { grid-template-columns: 1fr; }
    .visit4-history-organ-card[open] { grid-column: auto; }
}

.visit-dashboard-body [data-visit-section="services"] > .visit-section-title,
.visit-dashboard-body [data-visit-section="notifications"] > .visit-section-title,
.visit-dashboard-body [data-visit-section="prints"] > .visit-section-title { display: none; }
.visit4-services-workspace { padding: 12px; }
.visit4-services-title { display:flex; align-items:center; gap:8px; margin-bottom:12px; }
.visit4-services-title .visit-ui-icon { width:22px; color:#ef5f70; }
.visit4-services-title h3 { margin:0; font-size:1.25rem; }
.visit4-services-title span { height:3px; flex:1; background:var(--clinic-secondary); }
.visit4-service-form { display:grid; grid-template-columns:minmax(220px,1fr) 130px minmax(250px,1.4fr) 150px; gap:9px; align-items:end; padding-bottom:12px; }
.visit4-service-form label { display:grid; }
.visit4-service-form small { margin:0 0 -6px 8px; z-index:1; width:max-content; padding:0 4px; color:#6a7981; background:#fff; }
.visit4-service-form select,.visit4-service-form input { width:100%; min-height:46px; padding:10px; border:1px solid #c4d2d9; border-radius:7px; background:#fff; font:inherit; }
.visit-dashboard-body .visit4-service-form select,
.visit-dashboard-body .visit4-service-form input,
.visit-dashboard-body .visit4-service-form input[readonly] {
    color: #263f4a !important;
    background-color: #ffffff !important;
    -webkit-text-fill-color: #263f4a;
    opacity: 1;
}
.visit-dashboard-body .visit4-service-form select option { color:#263f4a; background:#ffffff; }
.visit4-service-form button { min-height:46px; border:0; border-radius:7px; color:#fff; background:var(--clinic-primary-strong); font-weight:900; cursor:pointer; }
.visit4-service-form button:disabled { opacity:.5; cursor:not-allowed; }
.visit4-service-columns { display:grid; grid-template-columns:1fr; gap:8px; }
.visit4-service-columns > details { overflow:hidden; border:1px solid #cad8de; border-radius:9px; background:#fff; }
.visit4-service-columns > details > summary { display:flex; justify-content:space-between; align-items:center; padding:10px 12px; color:#fff; background:var(--clinic-primary); list-style:none; cursor:pointer; }
.visit4-service-columns > details > summary::-webkit-details-marker { display:none; }
.visit4-service-columns h4 { margin:0; font-size:0.875rem; }
.visit4-service-columns summary > span { display:flex; align-items:center; gap:9px; }
.visit4-service-columns summary b { display:grid; min-width:25px; height:25px; padding:0 6px; place-items:center; border-radius:15px; background:rgba(255,255,255,.2); }
.visit4-service-columns summary i { display:block; width:9px; height:9px; border-right:2px solid currentColor; border-bottom:2px solid currentColor; transform:rotate(45deg); transition:.2s ease; }
.visit4-service-columns details[open] summary i { transform:rotate(225deg); }
.visit4-service-list { display:grid; gap:6px; padding:7px; max-height:320px; overflow:auto; }
.visit4-service-list article { display:grid; grid-template-columns:1fr auto; gap:3px 8px; padding:8px 9px; border-radius:7px; background:#f1f6f8; }
.visit4-service-list article div { display:grid; }
.visit4-service-list article strong { color:#263f4a; font-size:0.8125rem; }
.visit4-service-list article small { color:#6b7980; font-size:0.625rem; }
.visit4-service-list article > span { color:var(--clinic-primary-strong); font-size:0.75rem; font-weight:900; }
.visit4-service-list article p { grid-column:1/-1; margin:2px 0 0; color:#5e6f77; font-size:0.6875rem; }
.visit4-service-empty { margin:0; padding:18px; color:#6a7980; text-align:center; }
.visit4-notification-form { grid-template-columns:minmax(220px,1fr) 170px minmax(260px,1.5fr) 170px; }
.visit4-notifications-workspace .visit4-service-list article { grid-template-columns:1fr auto 30px; align-items:center; }
.visit4-notification-remove { display:grid; width:27px; height:27px; padding:0; place-items:center; border:0; border-radius:50%; color:#fff; background:#dd5366; font-size:1.125rem; cursor:pointer; }
.visit4-notifications-workspace .visit4-service-list article p { grid-column:1 / -1; }
.visit4-prints-workspace { padding:14px; }
.visit4-prints-hint { margin:0 0 14px; color:#65757d; }
  .visit4-print-buttons { display:grid; grid-template-columns:minmax(180px,320px); justify-content:center; gap:12px; }
.visit4-print-buttons button { display:flex; min-height:100px; padding:14px 10px; flex-direction:column; align-items:center; justify-content:center; gap:10px; border:1px solid #d1dce1; border-radius:10px; color:#273f49; background:#fff; font:inherit; font-weight:800; cursor:pointer; box-shadow:0 5px 15px rgba(31,53,62,.06); transition:.2s ease; }
.visit4-print-buttons button:hover { border-color:var(--clinic-primary); color:var(--clinic-primary-strong); transform:translateY(-2px); box-shadow:0 8px 20px rgba(var(--clinic-primary-rgb),.13); }
.visit4-print-buttons .visit-ui-icon { width:30px; height:30px; color:var(--clinic-primary); }
.visit4-prints-followup { margin-top:18px; padding-top:16px; border-top:2px solid #e0e5ef; }
.visit4-prints-followup > h3 { margin:0 0 14px; color:var(--clinic-primary-strong); font-size:1.25rem; }
.visit4-prints-followup .visit-fields-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
.visit4-prints-followup .visit-field { padding:12px; border:1px solid #d7e0e5; border-radius:9px; background:#f8fafc; }
.visit-section[data-visit-section="notifications"] { --visit-section-accent:#dd5366; }
.visit-section[data-visit-section="prints"] { --visit-section-accent:var(--clinic-primary); }

.visit-dashboard-body [data-visit-section="personal"] .visit-group {
    padding: 10px;
}

.visit-dashboard-body [data-visit-section="personal"] .visit-group > h3 {
    margin-bottom: 8px;
    font-size: 1rem;
}

.visit-dashboard-body [data-visit-section="personal"] .visit-group:has([data-visit-field="education"]) .visit-fields-grid,
.visit-dashboard-body [data-visit-section="personal"] .visit-group:has([data-visit-field="smoking_status"]) .visit-fields-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 7px;
}

.visit-dashboard-body [data-visit-section="personal"] [data-visit-field="education"] { grid-column: span 6; }
.visit-dashboard-body [data-visit-section="personal"] [data-visit-field="marital_status"] { grid-column: span 4; }
.visit-dashboard-body [data-visit-section="personal"] [data-visit-field="children_count"] { grid-column: span 2; }
.visit-dashboard-body [data-visit-section="personal"] [data-visit-field="smoking_status"] { grid-column: span 4; }
.visit-dashboard-body [data-visit-section="personal"] [data-visit-field="cigarettes_daily"] { grid-column: span 2; }
.visit-dashboard-body [data-visit-section="personal"] [data-visit-field="smoking_years"] { grid-column: span 2; }
.visit-dashboard-body [data-visit-section="personal"] [data-visit-field="alcohol"] { grid-column: span 4; }
.visit-dashboard-body [data-visit-section="personal"] [data-visit-field="other_habits"] { grid-column: span 7; }
.visit-dashboard-body [data-visit-section="personal"] [data-visit-field="other_habits_note"] { grid-column: span 5; }

.visit-dashboard-body [data-visit-section="personal"] .visit-field {
    padding: 8px;
    border-radius: 8px;
}

.visit-dashboard-body [data-visit-section="personal"] .visit-field h4 {
    gap: 5px;
    margin-bottom: 6px;
    font-size: 0.75rem;
}

.visit-dashboard-body [data-visit-section="personal"] .visit-field h4 > i {
    width: 27px;
    height: 27px;
    border-radius: 7px;
}

.visit-dashboard-body [data-visit-section="personal"] .visit-field h4 > i .visit-ui-icon {
    width: 16px;
    height: 16px;
}

.visit-dashboard-body [data-visit-section="personal"] .visit-choice-grid {
    gap: 5px;
}

.visit-dashboard-body [data-visit-section="personal"] .visit-choice span {
    min-height: 31px;
    padding: 4px 8px;
    border-radius: 7px;
    font-size: 0.6875rem;
}

.visit-dashboard-body [data-visit-section="personal"] .visit-choice span .visit-ui-icon {
    width: 14px;
    height: 14px;
    margin-inline-end: 4px;
}

.visit-dashboard-body [data-visit-section="personal"] .visit-stepper {
    grid-template-columns: 32px 48px 32px;
}

.visit-dashboard-body [data-visit-section="personal"] .visit-stepper button {
    font-size: 1.0625rem;
}

.visit-dashboard-body [data-visit-section="personal"] .visit-stepper input {
    min-height: 34px;
}

.visit-dashboard-body [data-visit-section="personal"] textarea {
    min-height: 42px;
    padding: 7px 9px;
}

.visit-dashboard-body [data-visit-section="personal"] .visit4-profile-control {
    display: grid;
    align-content: start;
    gap: 6px;
    padding: 10px;
    border: 1px solid #dbe7eb;
    background: #f8fbfc;
}

.visit-dashboard-body [data-visit-section="personal"] .visit4-profile-control h4 {
    margin: 0;
}

.visit4-profile-select select,
.visit4-profile-number {
    width: 100%;
    min-height: 42px;
    padding: 7px 11px;
    border: 1px solid #cddce2;
    border-radius: 8px;
    color: #263f4a;
    background: #fff;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 800;
}

.visit4-profile-select select:focus,
.visit4-profile-number:focus {
    border-color: var(--clinic-primary);
    outline: 3px solid var(--clinic-primary-strong);
    outline-offset: 2px;
}

.visit4-profile-checkboxes {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: start;
    align-content: start;
    gap: 6px;
}

.visit4-profile-checkboxes label {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    padding: 6px 9px;
    border: 1px solid #d4e0e5;
    border-radius: 8px;
    color: #344d58;
    background: #fff;
    font-size: 0.6875rem;
    font-weight: 800;
    cursor: pointer;
}

.visit4-profile-checkboxes label span {
    min-height: 0 !important;
    padding: 0 !important;
    color: #344d58 !important;
    background: transparent !important;
    font-size: 0.6875rem;
    line-height: 1.25;
}

.visit4-profile-checkboxes label:has(input:checked) {
    border-color: var(--clinic-primary);
    color: var(--clinic-primary-strong);
    background: var(--clinic-primary-soft);
}

.visit4-profile-checkboxes label:has(input:checked) span {
    color: var(--clinic-primary-strong) !important;
}

.visit4-profile-checkboxes input {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: var(--clinic-primary);
}

.visit-dashboard-body [data-visit-section="personal"] [data-visit-field="other_habits"] {
    grid-column: span 8;
}

.visit-dashboard-body [data-visit-section="personal"] [data-visit-field="other_habits_note"] {
    grid-column: span 4;
}

.visit-dashboard-body [data-visit-section="personal"] [data-visit-field="other_habits_note"] textarea {
    min-height: 42px;
    height: 42px;
    resize: vertical;
}

@media (max-width: 850px) {
    .visit4-profile-checkboxes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .visit-dashboard-body [data-visit-section="personal"] [data-visit-field="other_habits"],
    .visit-dashboard-body [data-visit-section="personal"] [data-visit-field="other_habits_note"] { grid-column: 1 / -1; }
}


.visit-prescription-builder .visit-group-heading h3 {
    margin-bottom: 3px;
}

.visit-prescription-builder .visit-group-heading p {
    margin: 0;
    color: #68777e;
    font-size: 0.8125rem;
    font-weight: 800;
}

.visit-drug-search-label {
    position: relative;
    display: grid;
    max-width: 850px;
    margin: 0 auto 15px;
}

.visit-drug-search-label > span {
    justify-content: center;
    color: #40515b;
    font-size: 1rem;
    text-align: center;
}

.visit-drug-search-label > input {
    color: #19313c;
    border-color: rgba(53, 89, 117, .3);
    background: #ffffff;
}

.visit-drug-results {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    z-index: 30;
    max-height: 370px;
    overflow-y: auto;
    padding: 7px;
    border: 1px solid #c5d5dc;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 20px 45px rgba(21, 48, 60, .24);
}

.visit-drug-results[hidden] {
    display: none;
}

.visit-drug-results button {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 12px;
    width: 100%;
    padding: 10px 11px;
    border: 0;
    border-bottom: 1px solid #e3eaed;
    color: #29414c;
    background: transparent;
    cursor: pointer;
    text-align: right;
}

.visit-drug-results button:hover:not(:disabled) {
    border-radius: 8px;
    background: #e7f6fb;
}

.visit-drug-results button:disabled {
    cursor: default;
    opacity: .55;
}

.visit-drug-results button > span {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.visit-drug-results small {
    overflow: hidden;
    color: #6b7980;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.visit-drug-results b {
    color: var(--clinic-primary-strong);
}

.visit-drug-result-names > small:nth-of-type(2) {
    margin-top: 5px;
}

.visit-drug-result-names > strong {
    color: var(--clinic-primary-deep);
    font-size: 1rem;
}

.visit-drug-no-results,
.visit-prescription-empty {
    padding: 16px;
    border-radius: 9px;
    color: #66777f;
    background: rgba(255, 255, 255, .72);
    text-align: center;
    font-weight: 800;
}

.visit-prescription-list {
    display: grid;
    gap: 11px;
}

.visit-prescription-drug {
    overflow: hidden;
    border: 1px solid #c9d9df;
    border-radius: 11px;
    background: #ffffff;
}

.visit-prescription-drug > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 13px;
    color: #243f4a;
    background: #dceff7;
}

.visit-prescription-drug > header > div {
    display: grid;
    gap: 2px;
}

.visit-prescription-names {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px !important;
    width: 100%;
}

.visit-prescription-names > div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.visit-prescription-names > div > small:first-child {
    color: #667780;
    font-size: 0.6875rem;
    font-weight: 900;
}

.visit-prescription-drug > header strong {
    color: var(--clinic-primary-deep);
    font-size: 1.0625rem;
}

.visit-prescription-drug > header span,
.visit-prescription-drug > header small {
    color: #5e7079;
}

.visit-prescription-drug > header button {
    min-height: 34px;
    padding: 0 12px;
    border: 0;
    border-radius: 8px;
    color: #ffffff;
    background: #dc5360;
    cursor: pointer;
    font-family: inherit;
    font-weight: 900;
}

.visit-prescription-instructions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
    padding: 12px;
}

.visit-prescription-instructions label span {
    color: #5d6f78;
    font-size: 0.75rem;
    font-weight: 900;
}

.visit-prescription-instructions select {
    min-height: 44px;
    padding: 0 10px;
    color: #203944;
    border-color: #c7d5db;
    border-radius: 9px;
    background: #ffffff;
}

.visit-dashboard-body .visit-prescription-instructions {
    display: flex;
    align-items: end;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
}

.visit-dashboard-body .visit-prescription-instructions > label {
    flex: 0 0 auto;
    width: 175px;
}

.visit-dashboard-body .visit-prescription-instructions > label:nth-child(2) {
    width: 195px;
}

.visit-dashboard-body .visit-prescription-instructions > label:nth-child(3) {
    width: 175px;
}

.visit-dashboard-body .visit-prescription-instructions > label:nth-child(4) {
    width: 145px;
}

.visit-dashboard-body .visit-prescription-instructions select {
    width: 100%;
    min-height: 40px;
}

.visit-dashboard-body .visit-prescription-list {
    gap: 7px;
}

.visit-dashboard-body .visit-prescription-drug {
    border-radius: 8px;
}

.visit-dashboard-body .visit-prescription-drug > header {
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
}

.visit-dashboard-body .visit-prescription-names {
    grid-template-columns: minmax(220px, 1fr) minmax(320px, 2fr);
    gap: 9px !important;
}

.visit-dashboard-body .visit-prescription-names > div {
    gap: 1px;
}

.visit-dashboard-body .visit-prescription-names > .visit-prescription-name {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 5px 9px !important;
}

.visit-dashboard-body .visit-prescription-names > .visit-prescription-name > strong,
.visit-dashboard-body .visit-prescription-names > .visit-prescription-name > span {
    min-width: 0;
}

.visit-dashboard-body .visit-prescription-names > .visit-prescription-name > strong {
    flex: 0 0 auto;
    white-space: nowrap;
}

.visit-dashboard-body .visit-prescription-names > .visit-prescription-name > span {
    flex: 1;
}

.visit-dashboard-body .visit-prescription-names > .visit-prescription-ingredient {
    display: flex;
    align-items: center;
    gap: 8px !important;
}

.visit-dashboard-body .visit-prescription-names > .visit-prescription-ingredient > small {
    flex: 0 0 auto;
    white-space: nowrap;
}

.visit-dashboard-body .visit-prescription-names > .visit-prescription-ingredient > span {
    flex: 1;
    min-width: 0;
}

.visit-dashboard-body .visit-prescription-names > div > small:first-child {
    font-size: 0.5625rem;
}

.visit-dashboard-body .visit-prescription-drug > header strong {
    font-size: 0.875rem;
}

.visit-dashboard-body .visit-prescription-names span {
    overflow: hidden;
    font-size: 0.75rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.visit-dashboard-body .visit-prescription-drug > header button {
    min-height: 32px;
    padding: 0 10px;
    font-size: 0.75rem;
}

.visit-dashboard-body .visit-prescription-instructions {
    gap: 6px;
    padding: 7px 10px;
}

.visit-dashboard-body .visit-prescription-instructions label span {
    font-size: 0.625rem;
}

.visit-dashboard-body .visit-prescription-instructions select {
    min-height: 35px;
    padding: 0 8px;
    border-radius: 7px;
    font-size: 0.75rem;
}

.visit-dashboard-body .visit4-floating-select {
    position: relative;
    display: block;
}

.visit-dashboard-body .visit4-floating-select::before {
    content: attr(data-label);
    position: absolute;
    top: 5px;
    inset-inline-start: 10px;
    z-index: 1;
    max-width: calc(100% - 32px);
    overflow: hidden;
    color: #73818a;
    font-size: 0.5625rem;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
}

.visit-dashboard-body .visit4-floating-select select {
    min-height: 47px;
    padding: 14px 28px 2px 10px;
    border: 1px solid #c7d5db;
    border-radius: 6px;
    background-color: #ffffff;
}

.visit-dashboard-body .visit-prescription-drug > footer {
    padding: 4px 10px;
    font-size: 0.625rem;
}

.visit-prescription-drug > footer {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 12px;
    color: #63747c;
    border-top: 1px solid #e4eaed;
    font-size: 0.75rem;
    font-weight: 800;
}

.visit-summary-count {
    padding: 6px 10px;
    border-radius: 999px;
    color: #ffffff;
    background: var(--clinic-primary-strong);
    font-size: 0.8125rem;
    font-weight: 900;
}

.visit-current-summary,
.visit-previous-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.visit-dashboard-body .visit-current-summary,
.visit-dashboard-body .visit-previous-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    overflow: hidden;
    padding: 6px;
    border: 1px solid #c7d6dc;
    border-radius: 9px;
    background: #ffffff;
    box-shadow: 0 5px 18px rgba(28, 55, 67, .08);
}

.visit-dashboard-body .visit-current-summary > div,
.visit-dashboard-body .visit-previous-summary > div {
    min-height: 0;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid #e1e8eb;
    border-radius: 0;
    background: transparent;
}

.visit-dashboard-body .visit-current-summary > div:nth-child(odd),
.visit-dashboard-body .visit-previous-summary > div:nth-child(odd) {
    border-inline-end: 1px solid #e1e8eb;
}

.visit-dashboard-body .visit-current-summary > .is-wide-summary,
.visit-dashboard-body .visit-previous-summary > .is-wide-summary {
    grid-column: 1 / -1;
    grid-template-columns: minmax(190px, .35fr) minmax(0, 1.65fr);
    align-items: start;
    gap: 12px;
    border-inline-end: 0;
}

.visit-dashboard-body .visit-current-summary > div span,
.visit-dashboard-body .visit-previous-summary > div span {
    font-size: 0.75rem;
    line-height: 1.3;
}

.visit-dashboard-body .visit-current-summary > div strong,
.visit-dashboard-body .visit-previous-summary > div strong {
    font-size: 0.9375rem;
    line-height: 1.45;
}

.visit-current-summary > div,
.visit-previous-summary > div {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid #d3dfe4;
    border-radius: 9px;
    background: #ffffff;
}

.visit-current-summary span,
.visit-previous-summary span {
    color: #68777e;
    font-size: 0.75rem;
    font-weight: 800;
}

.visit-current-summary strong,
.visit-previous-summary strong {
    color: #263e49;
    line-height: 1.55;
}

.visit-summary-labs {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 13px;
    margin-top: 14px;
    padding: 11px;
    border: 1px solid #9ed9bf;
    border-radius: 11px;
    background: #e8fbf2;
}

.visit-summary-labs > div:first-child {
    display: grid;
    color: #146b45;
}

.visit-summary-lab-thumbs {
    display: flex;
    gap: 6px;
}

.visit-summary-lab-thumbs a {
    display: block;
    width: 54px;
    height: 45px;
    overflow: hidden;
    border: 2px solid #ffffff;
    border-radius: 7px;
}

.visit-summary-lab-thumbs img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.visit-summary-labs button {
    min-height: 38px;
    padding: 0 12px;
    border: 0;
    border-radius: 8px;
    color: #ffffff;
    background: #168456;
    cursor: pointer;
    font-family: inherit;
    font-weight: 900;
}

.visit-summary-no-labs,
.visit-no-previous {
    margin: 12px 0 0;
    padding: 12px;
    border-radius: 9px;
    color: #61727a;
    background: rgba(255, 255, 255, .68);
    text-align: center;
    font-weight: 800;
}

.visit-previous-list {
    display: grid;
    gap: 9px;
}

.visit-previous-card {
    overflow: hidden;
    border: 1px solid #cfdae0;
    border-radius: 10px;
    background: #ffffff;
}

.visit-previous-card summary {
    display: grid;
    grid-template-columns: minmax(200px, 1fr) minmax(160px, auto) auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    cursor: pointer;
    list-style: none;
}

.visit-previous-card summary::-webkit-details-marker { display: none; }

.visit-previous-card summary > span {
    display: flex;
    gap: 9px;
    color: #53656e;
}

.visit-previous-card summary > span:first-child strong {
    color: var(--clinic-primary-strong);
}

.visit-previous-card summary > b {
    padding: 5px 9px;
    border-radius: 999px;
    color: #ffffff;
    background: #536772;
    font-size: 0.75rem;
    text-align: center;
}

.visit-previous-card > p,
.visit-previous-summary {
    margin: 0;
    padding: 12px;
    border-top: 1px solid #e0e8eb;
}

.visit-previous-labs {
    padding: 12px;
    border-top: 1px solid #e0e8eb;
    background: #f4fafc;
}

.visit-previous-labs h4 {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 9px;
    color: #28434e;
}

.visit-previous-labs h4 span {
    display: grid;
    min-width: 23px;
    height: 23px;
    place-items: center;
    border-radius: 999px;
    color: #ffffff;
    background: #168456;
    font-size: 0.75rem;
}

.visit-previous-labs > p {
    margin: 0;
    color: #697980;
    font-weight: 800;
}

.visit-previous-labs > div {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
    gap: 8px;
}

.visit-previous-labs a {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 5px;
    overflow: hidden;
    border: 1px solid #cad9df;
    border-radius: 8px;
    color: #3c525c;
    background: #ffffff;
    text-decoration: none;
}

.visit-previous-labs img {
    width: 100%;
    height: 75px;
    border-radius: 5px;
    object-fit: cover;
}

.visit-previous-labs a span {
    overflow: hidden;
    font-size: 0.6875rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.visit-action-bar {
    position: fixed;
    right: 50%;
    bottom: 86px;
    z-index: 25;
    display: flex;
    gap: 9px;
    padding: 9px;
    border-radius: 13px;
    transform: translateX(50%);
}

.visit-action-bar button.is-primary {
    background: var(--clinic-primary-strong);
}

.visit-action-bar button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.visit-action-bar .visit-ui-icon {
    width: 19px;
    height: 19px;
}

body.lab-viewer-open {
    overflow: hidden;
}

.visit-lab-viewer[hidden] {
    display: none;
}

.visit-lab-viewer {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: grid;
    padding: 18px;
    place-items: center;
}

.visit-lab-viewer-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(3, 14, 20, .88);
    cursor: zoom-out;
}

.visit-lab-viewer-dialog {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    width: min(1180px, 100%);
    height: min(900px, calc(100vh - 36px));
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .32);
    border-radius: 16px;
    color: #eef9fc;
    background: #10242d;
    box-shadow: 0 30px 100px rgba(0, 0, 0, .55);
}

.visit-lab-viewer-dialog > header,
.visit-lab-viewer-dialog > footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    background: #17323d;
}

.visit-lab-viewer-dialog > header > div {
    display: grid;
    min-width: 0;
}

.visit-lab-viewer-dialog > header strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.visit-lab-viewer-dialog > header span {
    color: #a8c3cd;
    font-size: 0.8125rem;
}

.visit-lab-viewer-dialog > header small {
    margin-top: 2px;
    color: #8eabb6;
    font-size: 0.6875rem;
}

.visit-lab-viewer-dialog button {
    min-height: 40px;
    padding: 0 15px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 9px;
    color: #ffffff;
    background: #294955;
    cursor: pointer;
    font-family: inherit;
    font-weight: 900;
}

.visit-lab-viewer-dialog > header > button {
    width: 42px;
    padding: 0;
    color: #ffffff;
    background: #d74c58;
    font-size: 1.5625rem;
}

.visit-lab-viewer-stage {
    display: grid;
    min-height: 0;
    overflow: hidden;
    place-items: center;
    background:
        linear-gradient(45deg, #192d35 25%, transparent 25%),
        linear-gradient(-45deg, #192d35 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #192d35 75%),
        linear-gradient(-45deg, transparent 75%, #192d35 75%),
        #14262e;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0;
    background-size: 20px 20px;
}

.visit-lab-viewer-stage img {
    display: block;
    max-width: 92%;
    max-height: 92%;
    object-fit: contain;
    user-select: none;
    touch-action: none;
    transition: transform .12s ease;
}

.visit-lab-viewer-stage img.is-zoomed {
    cursor: grab;
}

.visit-lab-viewer-stage img.is-zoomed:active {
    cursor: grabbing;
    transition: none;
}

.visit-lab-zoom-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.visit-lab-zoom-controls span {
    min-width: 58px;
    color: #dff4fa;
    text-align: center;
    font-weight: 900;
}

.visit-lab-zoom-controls button:not(:last-child) {
    width: 42px;
    padding: 0;
    font-size: 1.3125rem;
}

.secretariat-page { display:grid; gap:12px; width:min(var(--x2-page-max-width),calc(100% - var(--x2-page-inline-space))); margin:12px auto 110px; direction:rtl; }
.secretariat-page > .patient-panel.is-active[data-patient-panel="info"] { display:grid; gap:12px; }
.secretariat-page > .patient-tabs { grid-template-columns:repeat(3,minmax(0,1fr)); }
.secretariat-hero { display:block; padding:0; }
.secretariat-hero,.secretariat-search,.secretariat-empty,.secretariat-results { border-radius:16px; }
.secretariat-search { display:grid; grid-template-columns:1fr 140px; gap:10px; padding:14px; }
.secretariat-hero .secretariat-search { width:100%; margin:0; padding:18px; border-radius:16px; }
.secretariat-hero .secretariat-search { grid-template-columns:minmax(0,1fr) 210px; }
.secretariat-search > .patient-section-title { grid-column:1/-1; margin-bottom:0; }
.secretariat-search > .patient-notes-field { grid-column:1; }
.secretariat-search > .general-note-actions { grid-column:2; align-self:end; margin:0; }
.secretariat-search > .general-note-actions button { width:100%; min-height:46px; }
.secretariat-search label { display:grid; }
.secretariat-search label span { margin:0 10px -7px 0; z-index:1; width:max-content; padding:0 5px; color:#68777e; background:#fff; font-size:0.75rem; }
.secretariat-search input { min-height:50px; padding:10px 14px; border:1px solid #bed0d8; border-radius:8px; color:#203944; background:#fff; font:inherit; }
.secretariat-search-field { position:relative; }
.secretariat-search-field input { padding-left:54px; }
.secretariat-search-field #secretariatClearSearch { position:absolute; left:9px; bottom:7px; z-index:2; display:grid; place-items:center; width:36px; min-height:36px; padding:0; border:0; border-radius:50%; color:#5d6570; background:#eef3f6; box-shadow:none; }
.secretariat-search-field #secretariatClearSearch[hidden] { display:none; }
.secretariat-search-field #secretariatClearSearch:hover { color:#fff; background:var(--clinic-primary); }
.secretariat-search-field #secretariatClearSearch svg { width:21px; height:21px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; }
.secretariat-search button { border:0; border-radius:8px; color:#fff; background:var(--clinic-accent-strong); font-weight:900; cursor:pointer; }
.secretariat-search button.is-add-patient { background:var(--clinic-primary-strong); }
.secretariat-empty { width:min(900px,100%); margin:0 auto; padding:26px; text-align:center; }
.secretariat-empty h2 { margin-top:0; }
.secretariat-empty h2 { color:#263e49 !important; }
.secretariat-empty p { margin-bottom:24px; color:#68777e !important; }
.secretariat-results { overflow:hidden; padding:12px; }
#secretariatSearchOutput { display:grid; gap:12px; }
.secretariat-results h2 { margin:0 0 10px; }
.secretariat-results h2 span { color:var(--clinic-primary); }
.secretariat-results > a,.secretariat-results > button { display:grid; grid-template-columns:1fr 120px 160px; gap:10px; width:100%; padding:11px; border:0; border-bottom:1px solid #dbe5e9; color:#29414c; background:transparent; font:inherit; text-align:right; text-decoration:none; cursor:pointer; }
.secretariat-results > a:hover,.secretariat-results > button:hover { background:#edf8fb; }
.secretariat-patient { overflow:hidden; }
.secretariat-patient > header { display:flex; justify-content:space-between; align-items:center; padding:15px 18px; color:#fff; background:var(--clinic-primary); }
.secretariat-patient > header h2 { margin:3px 0 0; }
.secretariat-patient > header > strong { padding:7px 12px; border-radius:20px; background:rgba(255,255,255,.18); }
.secretariat-patient-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; padding:12px; }
.secretariat-patient-grid > div { display:grid; gap:4px; padding:11px; border:1px solid #d3e0e5; border-radius:8px; background:#fff; }
.secretariat-patient-grid small { color:#68777e; font-weight:800; }
.secretariat-patient-grid strong { color:#203944; font-size:0.9375rem; }
.secretariat-patient-grid .wide { grid-column:span 2; }
.secretariat-patient-grid .full { grid-column:1/-1; }
.secretariat-patient-grid p { margin:0; color:#344b55; line-height:1.7; }
.secretariat-patient-form input[readonly],.secretariat-patient-form textarea[readonly],.secretariat-patient-form select:disabled { color:#263e49; background:#fff; -webkit-text-fill-color:#263e49; opacity:1; }
.secretariat-edit-patient { display:grid; place-items:center; width:38px; height:38px; margin-inline-start:2px; border:0; border-radius:50%; color:#fff; background:var(--clinic-primary); cursor:pointer; }
.secretariat-edit-patient.is-cancel { background:#d64555; box-shadow:0 7px 18px rgba(214,69,85,.28); }
.secretariat-edit-patient svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.secretariat-patient-form.is-editing [data-patient-edit-field] { color:#263e49; background:#fff; -webkit-text-fill-color:#263e49; opacity:1; box-shadow:0 0 0 3px rgba(var(--clinic-primary-rgb),.12); }
.secretariat-patient-form [data-patient-save-wrap] { display:grid; gap:6px; }
.secretariat-patient-form [data-patient-save-wrap][hidden] { display:none; }
.secretariat-patient-form [data-patient-edit-status],.patient-note-save-status { min-height:18px; color:#405660; font-size:0.75rem; font-weight:800; text-align:center; }
.secretariat-patient-form [data-patient-auto-note] { color:#263e49; background:rgba(255,255,255,.82); -webkit-text-fill-color:#263e49; }
.secretariat-booking-history { width:100%; margin-top:0; background:rgba(255,255,255,.82); }
.secretariat-booking-history .history-table { width:100%; }
.secretariat-booking-history td { color:#304650; text-align:center; }
.secretariat-create-message { margin:10px 0 0; color:#b52e3d; font-weight:900; text-align:center; }
.secretariat-create-message:empty { display:none; }
.secretariat-create-form .secretariat-booking-toggle { display:flex; align-items:center; gap:9px; padding:10px 12px; border:1px solid #9fc3d2; border-radius:9px; background:rgba(255,255,255,.78); cursor:pointer; }
.secretariat-create-form .secretariat-booking-toggle input { width:18px; height:18px; min-height:0; flex:0 0 18px; accent-color:var(--clinic-primary); }
.secretariat-create-form .secretariat-booking-toggle span { margin:0; color:#263e49; font-weight:900; }
.secretariat-create-form input[readonly] { color:#263e49; background:rgba(255,255,255,.72); -webkit-text-fill-color:#263e49; opacity:1; font-weight:800; }
.secretariat-doctor-state { display:block; min-height:18px; margin-top:4px; color:#b42318; font-weight:800; font-size:0.75rem; }
.secretariat-staging-actions { display:grid; grid-template-columns:repeat(2,minmax(0,220px)) 1fr; gap:10px; align-items:center; padding:12px; border:1px solid rgba(var(--clinic-primary-rgb),.22); border-radius:12px; background:rgba(255,255,255,.55); }
.secretariat-staging-actions button { min-height:46px; border:0; border-radius:10px; color:#fff; background:var(--clinic-primary); font:inherit; font-weight:900; cursor:pointer; }
.secretariat-staging-actions button b { display:inline-grid; place-items:center; min-width:24px; height:24px; margin-inline-start:7px; border-radius:20px; background:rgba(255,255,255,.2); }
.secretariat-staging-actions small { color:#405660; font-weight:800; }
.secretariat-staging-field { display:grid; gap:6px; }
.secretariat-staging-field > span { font-weight:800; }
.secretariat-staging-field > button { width:100%; min-height:52px; border:0; border-radius:16px; color:#fff; background:linear-gradient(135deg,var(--clinic-primary),var(--clinic-secondary)); font:inherit; font-weight:900; cursor:pointer; box-shadow:0 8px 20px rgba(var(--clinic-primary-rgb),.18); }
.secretariat-staging-field > button b { display:inline-grid; place-items:center; min-width:25px; height:25px; margin-inline-start:7px; border-radius:20px; background:rgba(255,255,255,.2); }
.secretariat-staging-note { margin-top:-3px; color:#405660; font-weight:800; text-align:center; }
.secretariat-staged-service-list { display:grid; gap:7px; margin-top:14px; }
.secretariat-staged-service-list > div { display:grid; grid-template-columns:1fr auto; gap:4px 12px; align-items:center; padding:10px; border:1px solid #d3e0e5; border-radius:9px; color:#263e49; background:#fff; }
.secretariat-staged-service-list small { grid-column:1/-1; color:#68777e; }
.secretariat-staged-service-list button { grid-column:2; grid-row:1; border:0; color:#c52e43; background:transparent; font-weight:900; cursor:pointer; }
.secretariat-staged-service-list p { color:#68777e; text-align:center; }
.secretariat-stage-modal .lab-selected-preview span { overflow:hidden; padding:8px; border-radius:7px; color:#263e49; background:#fff; text-overflow:ellipsis; white-space:nowrap; }
[data-existing-lab-preview] span { overflow:hidden; padding:8px; border-radius:7px; color:#263e49; background:#fff; text-overflow:ellipsis; white-space:nowrap; }
.secretariat-existing-booking { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:14px; padding:14px; border:1px solid rgba(var(--clinic-primary-rgb),.22); border-radius:12px; background:rgba(255,255,255,.62); }
.secretariat-existing-booking p { margin:0; color:#405660; font-weight:800; }
.secretariat-existing-booking button { flex:1 1 210px; min-height:50px; border:0; border-radius:12px; color:#fff; background:linear-gradient(135deg,var(--clinic-primary),var(--clinic-secondary)); font:inherit; font-weight:900; cursor:pointer; }
.secretariat-existing-booking-root { margin-top:8px; }
.secretariat-existing-booking-form { display:grid; gap:12px; padding:16px; border:1px solid rgba(var(--clinic-primary-rgb),.22); border-radius:14px; background:rgba(255,255,255,.22); }
.secretariat-existing-booking-form > .patient-section-title { margin:0; }
.secretariat-existing-services { display:flex; flex-wrap:wrap; gap:8px; }
.secretariat-existing-services > span { display:flex; align-items:center; gap:7px; padding:7px 10px; border-radius:20px; color:#263e49; background:#fff; font-weight:800; }
.secretariat-existing-services > span button { border:0; color:#c52e43; background:transparent; font-size:1.125rem; cursor:pointer; }
.secretariat-inline-service-picker { display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:8px; width:100%; padding:10px; border-radius:10px; background:rgba(255,255,255,.72); }
.secretariat-inline-service-picker select,.secretariat-inline-service-picker input { color:#263e49; background:#fff; }
.secretariat-inline-service-picker button { border:0; border-radius:10px; padding:0 18px; color:#fff; background:var(--clinic-primary); font-weight:900; cursor:pointer; }
.secretariat-appointments-panel { text-align:center; }
.secretariat-appointments-panel p { color:#66777f; }
.secretariat-appointments-panel > a { display:inline-block; margin-top:8px; color:#fff; text-decoration:none; }
.secretariat-attendance-frame { overflow:hidden; padding:6px; border-radius:16px; }
.secretariat-attendance-frame iframe { display:block; width:100%; height:900px; border:0; border-radius:12px; background:transparent; }
.secretariat-attendance-component > .attendance-page { width:100%; margin:0; padding:0; }
.secretariat-attendance-component .attendance-card { margin:0; }
.secretariat-attendance-component #toggleFinishedRows { border:0; font-family:inherit; cursor:pointer; }
.attendance-embed-body .bottom-dock { display:none !important; }
.attendance-embed-body .dashboard-canvas { min-height:0; padding:6px; }
.attendance-embed-body .attendance-page { width:100%; margin:0; padding:0 0 12px; }

.visit-medical-print { display:none; }

@media print {
    body.visit-medical-print-mode * { visibility:hidden !important; }
    body.visit-medical-print-mode .visit-page > :not(.visit-medical-print) { display:none !important; }
    body.visit-medical-print-mode .visit-medical-print,
    body.visit-medical-print-mode .visit-medical-print * { visibility:visible !important; }
    body.visit-medical-print-mode .visit-medical-print {
        position:static;
        display:block;
        width:100%;
        height:auto;
        min-height:0;
        margin:0;
        padding:20px 28px;
        color:#111;
        background:#fff;
        font-family:Arial, sans-serif;
    }
    body.visit-medical-print-mode .dashboard-canvas,
    body.visit-medical-print-mode .visit-page { display:block; width:100%; min-height:0; margin:0; padding:0; }
    .visit-medical-print > header { display:flex; justify-content:space-between; gap:25px; padding-bottom:14px; border-bottom:3px solid #33208f; }
    .visit-medical-print h1 { margin:3px 0; font-size:1.5rem; }
    .visit-medical-print header p,.visit-medical-print header span { margin:0; color:#555; }
    .visit-medical-print header > div:last-child { display:grid; align-content:start; justify-items:end; gap:5px; }
    .visit-medical-print > article { margin-top:18px; break-inside:avoid; }
    .visit-medical-print h2 { margin:0 0 9px; padding:7px 10px; color:#fff; background:#4d31b1; font-size:1.0625rem; }
    .visit-medical-print h3 { margin:9px 0 5px; font-size:0.875rem; }
    .visit-medical-print ul,.visit-medical-print ol { margin:0; padding-inline-start:25px; }
    .visit-medical-print li { padding:6px 4px; border-bottom:1px solid #ddd; }
    .visit-medical-print li span { display:block; margin-top:3px; color:#444; font-size:0.75rem; }
    .visit-medical-print li div { display:flex; align-items:baseline; gap:10px; }
    .visit-medical-print li div strong { font-size:1rem; }
    .visit-medical-print li div b { color:#333; font-size:0.875rem; }
    .visit-medical-print > footer { display:flex; justify-content:space-between; margin-top:35px; padding-top:12px; border-top:1px solid #999; }
    .visit-print-empty { padding:15px; border:1px dashed #aaa; color:#666; text-align:center; }
    body { color: #000; background: #fff; }
    body::before, body::after, .bottom-dock, .visit-tabs, .visit-action-bar, .visit-section-nav, .visit-lab-viewer { display: none !important; }
    .visit-page { width: 100%; padding: 0; }
    .visit-patient-bar, .visit-section { border: 1px solid #aaa; box-shadow: none; background: #fff; }
    .visit-section { display: block !important; margin-top: 10px; break-inside: avoid; }
    .visit-choice input:not(:checked) + span { display: none; }
    .visit-choice input:checked + span { color: #000; border-color: #333; background: #eee; box-shadow: none; }
    .visit-action-bar { display: none; }
}

@media print {
    @page { size:A4 portrait; margin:0; }
    html:has(body.visit-medical-print-mode),
    body.visit-medical-print-mode { width:210mm !important; height:297mm !important; min-height:297mm !important; margin:0 !important; padding:0 !important; overflow:hidden !important; background:#fff !important; }
    body.visit-medical-print-mode .visit-medical-print.visit-prescription-sheet {
        position:fixed !important;
        top:0 !important;
        right:auto !important;
        bottom:auto !important;
        left:0 !important;
        display:block !important;
        width:210mm !important;
        height:297mm !important;
        min-height:297mm !important;
        max-height:297mm !important;
        margin:0 !important;
        padding:0 !important;
        overflow:hidden !important;
        color:#17202a !important;
        background:#fff !important;
        font-family:"Arial","Tahoma",sans-serif !important;
        print-color-adjust:exact;
        -webkit-print-color-adjust:exact;
        break-after:avoid-page;
        page-break-after:avoid;
    }
    .visit-prescription-background { position:absolute; inset:0; z-index:0; display:block; width:100%; height:100%; margin:0; padding:0; object-fit:fill; }
    .visit-prescription-file { position:absolute; z-index:2; top:30.5mm; right:33mm; width:26mm; overflow:hidden; color:#e81752; font-size:16pt; font-weight:800; line-height:7mm; text-align:center; white-space:nowrap; font-variant-numeric:tabular-nums; }
    .visit-prescription-patient { position:static !important; display:block !important; padding:0 !important; border:0 !important; }
    .visit-prescription-patient > span { position:absolute; z-index:2; top:67.5mm; overflow:hidden; color:#17202a !important; font-size:11.5pt; font-weight:700; line-height:7mm; text-align:center; white-space:nowrap; }
    .visit-prescription-patient .is-name { right:21mm; width:72mm; }
    .visit-prescription-patient .is-age { right:98mm; width:28mm; }
    .visit-prescription-patient .is-date-part { top:69mm; width:11mm; direction:ltr; font-size:12pt; line-height:6mm; font-variant-numeric:tabular-nums; }
    .visit-prescription-patient .is-day { left:47mm; }
    .visit-prescription-patient .is-month { left:32.5mm; }
    .visit-prescription-patient .is-year { left:17.5mm; }
    .visit-prescription-content { position:absolute; z-index:2; top:89mm; right:15mm; left:15mm; height:155mm; overflow:hidden; direction:rtl; }
    .visit-prescription-content > article { margin:0 !important; break-inside:avoid; }
    .visit-prescription-treatment { min-height:35mm; padding:4mm 4mm 0; }
    .visit-prescription-content > .visit-prescription-investigations { margin-top:25mm !important; padding:0 4mm; }
    #visitPrintInvestigations { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); column-gap:12mm; align-items:start; direction:rtl; }
    #visitPrintInvestigations > section { min-width:0; margin:0; }
    .visit-prescription-investigations h2 { margin:0 0 2mm !important; padding:0 0 1.5mm !important; border-bottom:1px solid rgba(22,74,158,.45); color:#164a9e !important; background:transparent !important; font-size:12pt !important; }
    .visit-prescription-sheet ul,.visit-prescription-sheet ol { margin:0 !important; padding:0 7mm 0 0 !important; }
    .visit-prescription-sheet li { padding:1.2mm 1mm !important; border-bottom:1px solid rgba(30,65,110,.14) !important; font-size:10.5pt; }
    .visit-prescription-investigations li { border-bottom:0 !important; }
    .visit-prescription-sheet li div { display:flex; align-items:baseline; gap:2.5mm; }
    .visit-prescription-sheet li div strong { color:#111; font-size:11.5pt; }
    .visit-prescription-sheet li div b { color:#164a9e; font-size:10.5pt; }
    .visit-prescription-sheet li span { display:block; margin-top:.7mm; color:#333 !important; font-size:9.5pt; }
    .visit-prescription-treatment ol { padding:0 !important; list-style:none !important; }
    .visit-prescription-treatment li { border-bottom:0 !important; text-align:left; }
    .visit-prescription-treatment li div { direction:ltr; justify-content:flex-start; text-align:left; }
    .visit-prescription-treatment li div b { display:block; width:100%; text-align:left; }
    .visit-prescription-treatment li > span { text-align:left; }
    .visit-prescription-treatment li div b { font-size:14pt; }
    .visit-prescription-treatment li span { font-size:10.5pt; }
    .visit-prescription-sheet h3 { margin:1.5mm 0 1mm; color:#164a9e; font-size:10.5pt; }
    .visit-prescription-sheet .visit-print-empty { margin:0; padding:2mm; border:1px dashed rgba(22,74,158,.35); color:#666; font-size:9.5pt; text-align:center; }
    .visit-prescription-type { position:absolute; z-index:2; right:48mm; bottom:34mm; width:58mm; margin:0 !important; padding:0 !important; border:0 !important; color:#17202a; font-size:11.5pt; font-weight:800; text-align:center; white-space:nowrap; }
}

@media (min-width:761px) {
    .bottom-dock {
        display:flex;
        justify-content:center;
    }
    .bottom-dock > .dock-chat-toggle,
    .bottom-dock > .dock-group {
        flex:1 1 0;
        min-width:0;
        max-width:110px;
    }
    .dock-group > .dock-item { z-index:2; }
    .dock-menu {
        bottom:calc(100% + 14px);
        padding-bottom:8px;
        border-bottom-right-radius:18px;
        border-bottom-left-radius:18px;
    }
}

@media (hover:none) {
    .dock-group:not(.is-open):hover .dock-menu { opacity:0; pointer-events:none; }
    .dock-group.is-open .dock-menu { opacity:1; pointer-events:auto; }
}

@media (max-width: 760px) {
    .auth-card {
        padding: 24px;
        border-radius: 22px;
    }

    .auth-form.two-cols,
    .hero-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-canvas {
        padding-bottom: 88px;
    }

    .bottom-dock {
        right: 10px;
        bottom: 10px;
        display: flex;
        gap: 2px;
        width: calc(100% - 20px);
        min-height: 58px;
        padding: 5px 4px;
        overflow: visible;
        border-radius: 20px;
        transform: none;
    }

    .dock-chat-toggle { flex:0 0 44px; min-width:44px; padding:3px 2px; font-size:0.5625rem; }
    .dock-chat-toggle > span { display:block; max-width:100%; overflow:hidden; line-height:1.1; text-overflow:clip; white-space:nowrap; }
    .dock-chat-toggle svg { width:19px; height:19px; }
    .dock-chat-panel { right:10px; bottom:78px; height:min(430px,calc(100vh - 100px)); }
    .dock-notifications-toggle { flex:0 0 58px; }
    .dock-notifications-panel { right:10px; left:10px; bottom:78px; width:auto; height:min(390px,calc(100vh - 100px)); }

    .bottom-dock::-webkit-scrollbar {
        display: none;
    }

    .dock-group { flex:1 1 0; min-width:0; }
    .dock-group-doctor,
    .dock-group-assistant,
    .dock-group-settings,
    .dock-group-logout { display:none; }
    .dock-group-home { flex:1 1 auto; }
    .dock-group-doctor .dock-item > span,
    .dock-group-assistant .dock-item > span,
    .dock-group-home .dock-item > span { display:block; width:100%; max-width:100%; overflow:hidden; font-size:0.6563rem; line-height:1.1; text-align:center; text-overflow:clip; white-space:nowrap; }
    .dock-group-home .dock-item > span { font-size:0.875rem !important; }

    .mobile-home-nav[hidden] { display:none !important; }
    .mobile-home-nav { position:fixed; top:auto; right:auto; bottom:80px; left:50%; z-index:30; display:flex; width:min(320px,calc(100vw - 28px)); max-height:min(560px,calc(100vh - 110px)); overflow:hidden; flex-direction:column; border:1px solid rgba(255,255,255,.72); border-radius:22px; color:#fff; background:linear-gradient(160deg,rgba(23,71,133,.97),rgba(35,153,181,.94)); box-shadow:0 24px 70px rgba(5,34,58,.4); backdrop-filter:blur(26px); transform:translateX(-50%); }
    .mobile-home-nav > header { display:flex; min-height:52px; padding:10px 14px; align-items:center; justify-content:space-between; border-bottom:1px solid rgba(255,255,255,.18); }
    .mobile-home-nav > header strong { font-size:1.0625rem; }
    .mobile-home-nav > header button { display:grid; width:30px; height:30px; padding:0; place-items:center; border:0; border-radius:50%; color:#fff; background:rgba(255,255,255,.14); font:inherit; font-size:1.3125rem; line-height:1; cursor:pointer; }
    .mobile-home-nav-list { display:grid; gap:6px; padding:10px; overflow-y:auto; }
    .mobile-home-nav-main,
    .mobile-home-nav-toggle { display:grid; width:100%; min-height:48px; padding:8px 12px; align-items:center; grid-template-columns:27px 1fr auto; gap:10px; border:1px solid transparent; border-radius:13px; color:#fff; background:rgba(255,255,255,.08); font:inherit; font-size:0.9375rem; font-weight:900; text-align:right; text-decoration:none; cursor:pointer; }
    .mobile-home-nav-main:hover,
    .mobile-home-nav-toggle:hover,
    .mobile-home-nav-group.is-open .mobile-home-nav-toggle { border-color:rgba(255,255,255,.65); color:var(--clinic-primary-strong); background:linear-gradient(135deg,#fff,var(--clinic-primary-soft)); }
    .mobile-home-nav-main svg,
    .mobile-home-nav-toggle svg { width:23px; height:23px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
    .mobile-home-nav-toggle b { font-size:1.25rem; font-weight:500; }
    .mobile-home-submenu { display:grid; gap:4px; padding:5px 12px 4px 4px; }
    .mobile-home-submenu[hidden] { display:none !important; }
    .mobile-home-submenu a { display:grid; min-height:42px; padding:7px 11px; align-items:center; grid-template-columns:23px 1fr; gap:9px; border-radius:11px; color:#fff; background:rgba(var(--clinic-primary-strong-rgb),.28); font-size:0.8125rem; font-weight:800; text-decoration:none; }
    .mobile-home-submenu a:hover { color:var(--clinic-primary-strong); background:var(--clinic-primary-soft); }
    .mobile-home-submenu .menu-icon { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }

    .dock-item {
        min-height: 48px;
        border-radius: 14px;
        padding: 5px 4px;
    }

    .dock-menu {
        position: absolute;
        right: 50%;
        left: auto;
        bottom: calc(100% + 14px) !important;
        width: min(220px, calc(100vw - 20px));
        max-height: min(430px, calc(100vh - 100px));
        overflow-y: auto;
        padding-bottom: 8px;
        border-bottom-right-radius: 18px;
        border-bottom-left-radius: 18px;
        transform: translate(50%, -12px) scale(.96);
        transform-origin: top center;
    }

    .dock-group:first-of-type .dock-menu { right:0; transform:translate(0,-12px) scale(.96); }
    .dock-group:nth-of-type(4) .dock-menu { right:auto; left:0; transform:translate(0,-12px) scale(.96); }

    .dock-menu::after {
        right: auto;
        left: 50%;
        transform: translateX(-50%) rotate(45deg);
    }

    .dock-group:hover .dock-menu,
    .dock-group.is-open .dock-menu {
        transform: translate(50%,0) scale(1);
    }

    .dock-group:first-of-type:hover .dock-menu,
    .dock-group:first-of-type.is-open .dock-menu,
    .dock-group:nth-of-type(4):hover .dock-menu,
    .dock-group:nth-of-type(4).is-open .dock-menu { transform:translate(0,0) scale(1); }

    .dock-item svg {
        width: 19px;
        height: 19px;
    }

    .dock-item span {
        font-size: 0.9375rem;
        line-height: 1.15;
    }

    .dock-menu a {
        min-height: 48px;
        font-size: 1.0625rem;
    }

    .dock-menu .menu-icon {
        width: 21px;
        height: 21px;
    }

    .dock-item.is-active {
        transform: none;
    }

    .dock-group.is-home {
        flex-basis: 0;
    }

    .dock-group.is-home .dock-item {
        min-height: 48px;
        border-radius: 14px;
    }

    .dock-group.is-home .dock-item svg {
        width: 19px;
        height: 19px;
    }

    .dock-group.is-home .dock-item.is-active {
        transform: none;
    }

    .patient-page {
        width: min(var(--x2-page-max-width), calc(100% - var(--x2-page-inline-space)));
        padding-top: 12px;
        padding-bottom: 112px;
    }

    .patient-tabs,
    .summary-tabs,
    .patient-actions {
        grid-template-columns: 1fr;
    }

    .patient-form,
    .patient-summary {
        padding: 14px;
    }

    .patient-grid {
        grid-template-columns: 1fr;
    }

    .patient-grid .wide,
    .patient-grid .full {
        grid-column: auto;
    }

    .patient-section-title {
        font-size: 1.125rem;
    }

    .patient-notes-grid {
        grid-template-columns: 1fr;
    }

    .patients-list-page {
        width: min(var(--x2-page-max-width), calc(100% - var(--x2-page-inline-space)));
        padding-top: 10px;
        padding-bottom: 112px;
    }

    .patients-list-header {
        align-items: stretch;
        flex-direction: column;
    }

    .patients-list-header .secondary-btn {
        width: 100%;
        min-width: 0;
    }

    .patients-list-stats,
    .patients-list-tools {
        grid-template-columns: 1fr;
    }

    .patients-list-stats.drugs-directory-stats,
    .drugs-directory-tools {
        grid-template-columns: 1fr;
    }

    #patientsListCount,
    #drugsCount {
        width: 100%;
    }

    .patients-list-table-wrap {
        overflow: visible;
        border: 0;
    }

    .patients-list-table,
    .patients-list-table tbody,
    .patients-list-table tr,
    .patients-list-table td {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .patients-list-table thead {
        display: none;
    }

    .patients-list-table {
        background: transparent;
    }

    .patients-list-table tr {
        margin-bottom: 12px;
        overflow: hidden;
        border: 1px solid rgba(53, 89, 117, .28);
        border-radius: 12px;
        background: rgba(255, 255, 255, .72);
    }

    .patients-list-table td {
        display: grid;
        grid-template-columns: 112px minmax(0, 1fr);
        gap: 10px;
        padding: 10px 12px;
        text-align: right;
    }

    .patients-list-table td::before {
        color: #40515b;
        font-weight: 900;
    }

    .patients-list-table td:nth-child(1)::before { content: "رقم الملف"; }
    .patients-list-table td:nth-child(2)::before { content: "اسم المريض"; }
    .patients-list-table td:nth-child(3)::before { content: "الهاتف"; }
    .patients-list-table td:nth-child(4)::before { content: "النوع"; }
    .patients-list-table td:nth-child(5)::before { content: "أول زيارة"; }
    .patients-list-table td:nth-child(6)::before { content: "آخر زيارة"; }
    .patients-list-table td:nth-child(7)::before { content: "عدد الزيارات"; }
    .patients-list-table td:nth-child(8)::before { content: "الخصم"; }
    .patients-list-table td:nth-child(9)::before { content: "ملاحظات"; }
    .patients-list-table.is-discount-hidden td:nth-child(8)::before { content: "ملاحظات"; }

    .drugs-directory-table td:nth-child(1)::before { content: "الاسم التجاري"; }
    .drugs-directory-table td:nth-child(2)::before { content: "المادة الفعالة"; }
    .drugs-directory-table td:nth-child(3)::before { content: "الشركة المصنعة"; }
    .drugs-directory-table td:nth-child(4)::before { content: "التصنيف"; }
    .drugs-directory-table td:nth-child(5)::before { content: "طريقة الاستخدام"; }
    .drugs-directory-table td:nth-child(6)::before { content: "السعر"; }

    .drugs-directory-table .drugs-empty {
        display: block;
    }

    .drugs-directory-table .drugs-empty::before {
        content: none;
    }

    .appointments-page {
        width: min(var(--x2-page-max-width), calc(100% - var(--x2-page-inline-space)));
        padding-top: 10px;
        padding-bottom: 112px;
    }

    .appointments-toolbar,
    .calendar-toolbar {
        grid-template-columns: 1fr;
    }

    .calendar-toolbar strong {
        font-size: 1.5rem;
    }

    .date-nav,
    .view-switcher {
        flex-wrap: wrap;
        justify-content: center;
    }

    .calendar-grid {
        grid-template-columns: 54px repeat(var(--days), minmax(170px, 1fr));
    }

    .booking-grid {
        grid-template-columns: 1fr;
    }

    .attendance-page {
        width: min(var(--x2-page-max-width), calc(100% - var(--x2-page-inline-space)));
        padding-top: 10px;
        padding-bottom: 112px;
    }

    .attendance-toolbar {
        grid-template-columns: 1fr;
    }

    .attendance-form-grid,
    .attendance-modal-tabs {
        grid-template-columns: 1fr;
    }

    .attendance-table-wrap {
        overflow: visible;
        border: 0;
        background: transparent;
        direction: rtl;
    }

    .attendance-table,
    .attendance-table thead,
    .attendance-table tbody,
    .attendance-table tr,
    .attendance-table th,
    .attendance-table td {
        display: block;
        width: 100% !important;
        max-width: none !important;
    }

    .attendance-table {
        min-width: 0;
        border-collapse: separate;
        border-spacing: 0 10px;
        direction: rtl;
    }

    .attendance-table thead {
        display: none;
    }

    .attendance-table tr[data-attendance-row] {
        display: flex;
        flex-direction: column-reverse;
        overflow: hidden;
        margin-bottom: 10px;
        border: 1px solid rgba(255, 255, 255, .48);
        border-radius: 12px;
        box-shadow: 0 10px 26px rgba(0, 0, 0, .14);
    }

    .attendance-table td {
        display: grid;
        grid-template-columns: 104px minmax(0, 1fr);
        align-items: center;
        min-height: 44px;
        padding: 9px 12px;
        border-width: 0 0 1px;
        text-align: right;
        font-size: 1.125rem;
        line-height: 1.35;
    }

    .attendance-table td:last-child {
        border-bottom: 0;
    }

    .attendance-table td::before {
        color: rgba(5, 31, 42, .74);
        font-size: 0.8125rem;
        font-weight: 900;
    }

    .attendance-table td:nth-child(1)::before { content: "الملف"; }
    .attendance-table td:nth-child(2)::before { content: "وقت الدخول"; }
    .attendance-table td:nth-child(3)::before { content: "وقت الحضور"; }
    .attendance-table td:nth-child(4)::before { content: "وقت الحجز"; }
    .attendance-table td:nth-child(5)::before { content: "خدمات"; }
    .attendance-table td:nth-child(6)::before { content: "تحاليل"; }
    .attendance-table td:nth-child(7)::before { content: "السعر"; }
    .attendance-table td:nth-child(8)::before { content: "نوع الكشف"; }
    .attendance-table td:nth-child(9)::before { content: "الحالة"; }
    .attendance-table td:nth-child(10)::before { content: "الدكتور"; }
    .attendance-table td:nth-child(11)::before { content: "اسم المريض"; }
    .attendance-table td:nth-child(12)::before { content: "الترتيب"; }

    .attendance-table .empty-attendance {
        display: block;
        border-radius: 12px;
        text-align: center;
    }

    .patient-labs-page {
        width: min(var(--x2-page-max-width), calc(100% - var(--x2-page-inline-space)));
        padding-top: 10px;
    }

    .patient-labs-header,
    .patient-labs-search-card,
    .patient-labs-workspace {
        padding: 15px;
    }

    .patient-labs-header {
        align-items: stretch;
        flex-direction: column;
    }

    .patient-labs-header-note {
        white-space: normal;
    }

    .patient-labs-selected {
        align-items: stretch;
        flex-direction: column;
    }

    .patient-labs-meta {
        display: grid;
        grid-template-columns: 1fr;
    }

    .attendance-status-control {
        max-width: 100%;
        min-height: 38px;
    }

    .mini-add {
        justify-self: start;
    }

    .reception-screen {
        width: min(var(--x2-page-max-width), calc(100% - var(--x2-page-inline-space)));
        height: calc(100vh - 10px);
        padding-top: 10px;
        padding-bottom: 0;
        }

    .reception-header,
    .reception-section-title {
        align-items: stretch;
        flex-direction: column;
    }

    .reception-clock {
        min-width: 0;
    }

    .reception-filters,
    .reception-hero-grid {
        grid-template-columns: 1fr;
    }

    .reception-now,
    .reception-next {
        min-height: 220px;
    }

    .reception-table th,
    .reception-table td {
        padding: 10px 8px;
        font-size: 1rem;
    }

    .visit-page {
        width: min(var(--x2-page-max-width), calc(100% - var(--x2-page-inline-space)));
        padding-top: 6px;
        padding-bottom: 155px;
    }

    .visit-vertical-body .visit-page {
        display: block;
    }

    .visit-vertical-body .visit-patient-bar {
        margin-bottom: 9px;
    }

    .visit-vertical-body .visit-tabs {
        position: static;
        display: flex;
        max-height: none;
        margin-bottom: 9px;
        overflow: visible;
        flex-direction: column;
    }

    .visit-vertical-body .visit-tabs button {
        min-height: 48px;
    }

    .visit-dashboard-body .visit-patient-bar {
        grid-template-columns: 1fr;
    }

    .visit4-toolbar-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .visit4-toolbar-actions a.is-dark {
        margin-left: 0;
    }

    .visit4-primary-tabs {
        grid-template-columns: repeat(2, minmax(130px, 1fr));
        overflow: visible;
    }

    .visit4-module-tabs {
        position: static;
    }

    .visit4-exam-tabs,
    .visit4-compact-grid,
    .visit4-vitals-grid,
    .visit4-bp-guide {
        grid-template-columns: 1fr;
    }

    .visit4-complaint-workspace {
        grid-template-columns: 1fr;
    }

    .visit4-complaint-table {
        overflow-x: auto;
    }

    .visit4-complaint-table > header,
    .visit4-complaint-row {
        min-width: 760px;
    }

    .visit4-compact-field {
        grid-template-columns: 1fr;
    }

    .visit4-bp-guide > * {
        border-right: 0;
        border-bottom: 1px solid #b9ceda;
    }

    .visit-patient-bar {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .visit-patient-facts {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .visit-save-state {
        min-width: 0;
    }

    .visit-tabs {
        position: sticky;
        top: 0;
        z-index: 20;
    }

    .visit-tabs button {
        min-height: 40px;
        font-size: 0.8125rem;
    }

    .visit-section {
        padding: 12px;
    }

    .visit-section-title h2 {
        font-size: 1.4375rem;
    }

    .visit-group {
        padding: 10px;
    }

    .visit-fields-grid,
    .visit-personal-summary,
    .visit-current-summary,
    .visit-previous-summary {
        grid-template-columns: 1fr;
    }

    .visit-choice span {
        min-height: 42px;
    }

    .ipss-options {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .ipss-score-card {
        float: none;
        width: 100%;
        margin: 0 0 12px;
    }

    .visit-action-bar {
        bottom: 78px;
        width: calc(100% - 16px);
        justify-content: center;
    }

    .visit-action-bar button {
        flex: 1;
        min-width: 0;
        padding: 0 8px;
        font-size: 0.8125rem;
    }

    .visit-summary-labs {
        grid-template-columns: 1fr;
    }

    .visit-drug-results button,
    .visit-prescription-instructions {
        grid-template-columns: 1fr;
    }

    .visit-prescription-drug > header {
        align-items: stretch;
        flex-direction: column;
    }

    .visit-prescription-names {
        grid-template-columns: 1fr;
    }

    .visit-summary-lab-thumbs {
        overflow-x: auto;
    }

    .visit-previous-card summary {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .visit-lab-viewer {
        padding: 5px;
    }

    .visit-lab-viewer-dialog {
        height: calc(100vh - 10px);
        border-radius: 10px;
    }

    .visit-lab-viewer-dialog > footer {
        flex-wrap: wrap;
        justify-content: center;
    }

    .visit-lab-viewer-dialog > footer > button {
        flex: 1;
    }

    .visit-lab-zoom-controls {
        order: -1;
        width: 100%;
        justify-content: center;
    }

    .visit4-drawing-table-head {
        grid-template-columns: 125px minmax(0, 1fr);
    }

    .visit-dashboard-body .visit4-drawing-panel .visit-field {
        grid-template-columns: 1fr;
        align-items: stretch;
        gap: 5px;
    }

    .visit-dashboard-body .visit4-drawing-panel .visit-field > h4 {
        padding-bottom: 5px;
    }

    .visit4-treatment-toolbar {
        grid-template-columns: 1fr;
    }

    .visit4-treatment-workspace {
        grid-template-columns: 1fr;
    }

    .visit4-treatment-workspace > main {
        padding-inline-start: 0;
        border-inline-start: 0;
    }

    .visit4-treatment-notes-slot textarea {
        min-height: 150px;
    }

    .visit4-treatment-toolbar button {
        width: 100%;
    }

    .visit4-treatment-toolbar .visit-drug-search-label,
    .visit4-treatment-toolbar .visit4-add-treatment {
        grid-column: auto;
    }

    .visit4-treatment-title {
        flex-wrap: wrap;
    }

    .visit4-treatment-title > span {
        min-width: 60px;
    }

    .visit-dashboard-body .visit-prescription-instructions > label,
    .visit-dashboard-body .visit-prescription-instructions > label:nth-child(2),
    .visit-dashboard-body .visit-prescription-instructions > label:nth-child(3),
    .visit-dashboard-body .visit-prescription-instructions > label:nth-child(4) {
        width: calc(50% - 4px);
    }

    .visit4-investigation-columns,
    .visit4-investigation-list {
        grid-template-columns: 1fr;
    }

    .visit4-service-form,
    .visit4-service-columns {
        grid-template-columns: 1fr;
    }
    .visit4-print-buttons { grid-template-columns:minmax(0,1fr); }
    .visit4-prints-followup .visit-fields-grid { grid-template-columns:1fr; }

    .visit-dashboard-body [data-visit-section="personal"] .visit-group:has([data-visit-field="education"]) .visit-fields-grid,
    .visit-dashboard-body [data-visit-section="personal"] .visit-group:has([data-visit-field="smoking_status"]) .visit-fields-grid {
        grid-template-columns: 1fr;
    }

    .visit-dashboard-body [data-visit-section="personal"] [data-visit-field] {
        grid-column: auto;
    }

    .visit-dashboard-body .visit-personal-summary {
        grid-template-columns: 1fr;
    }

    .visit-dashboard-body .visit-current-summary,
    .visit-dashboard-body .visit-previous-summary {
        grid-template-columns: 1fr;
    }

    .visit-dashboard-body .visit-current-summary > div:nth-child(odd),
    .visit-dashboard-body .visit-previous-summary > div:nth-child(odd) {
        border-inline-end: 0;
    }

    .visit-dashboard-body .visit-current-summary > .is-wide-summary,
    .visit-dashboard-body .visit-previous-summary > .is-wide-summary {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .secretariat-hero { grid-template-columns:1fr; align-items:stretch; }
    .secretariat-hero a { text-align:center; }
    .secretariat-search,.secretariat-patient-grid,.secretariat-results > a,.secretariat-results > button { grid-template-columns:1fr; }
    .secretariat-hero .secretariat-search { grid-template-columns:1fr; }
    .secretariat-search > .patient-notes-field,
    .secretariat-search > .general-note-actions { grid-column:1; }
    .secretariat-search button { min-height:46px; }
    .secretariat-patient-grid .wide { grid-column:auto; }
}
