:root {
    --ink: #1e4a86;
    --muted: #7d92ad;
    --line: #e3eef8;
    --card: #ffffff;
    --blue: #1c84e3;
    --blue-deep: #1665e6;
    --green: #2ec38b;
    --purple: #b274f1;
    --orange: #f4a03a;
    --teal: #22a3dc;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
    margin: 0;
    min-height: 100%;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    color: var(--ink);
    font-family: "Readex Pro", sans-serif;
    background: linear-gradient(180deg, #e7f4fe 0%, #f5fbff 46%, #e9f4fc 100%);
    overflow-x: hidden;
}

body::before,
body::after {
    content: "";
    position: fixed;
    z-index: 0;
    pointer-events: none;
    border-radius: 50%;
}

body::before {
    width: 380px;
    height: 280px;
    left: -80px;
    bottom: -40px;
    background: radial-gradient(circle, rgba(176, 220, 248, 0.7), transparent 70%);
}

body::after {
    width: 320px;
    height: 220px;
    right: -60px;
    top: -50px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.85), transparent 70%);
}

.shell {
    position: relative;
    z-index: 1;
    direction: ltr;
    width: min(1120px, calc(100% - 28px));
    max-width: 100%;
    min-width: 0;
    margin: 0 auto;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100dvh;
    min-height: 100dvh;
    padding: 0;
    position: relative;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-logo {
    width: 68px;
    height: 68px;
    object-fit: contain;
    flex: 0 0 auto;
}

.brand-rule {
    width: 1px;
    height: 42px;
    background: #d5e6f4;
    flex: 0 0 auto;
}

.brand-copy {
    direction: rtl;
    text-align: right;
    min-width: 0;
}

.brand-copy strong {
    display: block;
    font-size: clamp(16px, 1.7vw, 22px);
    font-weight: 700;
    line-height: 1.35;
    color: #1b4f9c;
}

.brand-copy span {
    display: block;
    margin-top: 2px;
    color: #8aa0b8;
    font-size: 13px;
    font-weight: 500;
}

.health-mark {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.health-mark span {
    direction: rtl;
    color: #2a74d6;
    font-weight: 700;
    font-size: 18px;
}

.health-mark svg {
    width: 46px;
    height: 42px;
}

.floaters {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.floater {
    position: absolute;
    width: 52px;
    height: 52px;
    object-fit: contain;
    opacity: 0.28;
    animation: drift-a 9s ease-in-out infinite;
    animation-delay: calc(var(--i) * -0.7s);
}

.floater:nth-child(4n + 2) { animation-name: drift-b; opacity: 0.24; }
.floater:nth-child(4n + 3) { animation-name: drift-c; opacity: 0.22; }
.floater:nth-child(4n) { animation-name: drift-d; opacity: 0.26; }

.floater:nth-child(1) { left: 2%; top: 8%; }
.floater:nth-child(2) { left: 18%; top: 28%; }
.floater:nth-child(3) { left: 74%; top: 6%; }
.floater:nth-child(4) { left: 86%; top: 34%; }
.floater:nth-child(5) { left: 4%; top: 72%; }
.floater:nth-child(6) { left: 68%; top: 70%; }
.floater:nth-child(7) { left: 40%; top: 2%; }
.floater:nth-child(8) { left: 90%; top: 78%; }
.floater:nth-child(9) { left: 24%; top: 4%; }
.floater:nth-child(10) { left: 52%; top: 82%; }
.floater:nth-child(11) { left: 1%; top: 42%; }
.floater:nth-child(12) { left: 80%; top: 18%; }
.floater:nth-child(13) { left: 12%; top: 88%; }
.floater:nth-child(14) { left: 34%; top: 76%; }
.floater:nth-child(15) { left: 58%; top: 12%; }
.floater:nth-child(16) { left: 94%; top: 56%; }
.floater:nth-child(17) { left: 8%; top: 18%; }
.floater:nth-child(18) { left: 46%; top: 90%; }
.floater:nth-child(19) { left: 30%; top: 48%; }
.floater:nth-child(20) { left: 72%; top: 48%; }
.floater:nth-child(21) { left: 16%; top: 58%; }
.floater:nth-child(22) { left: 62%; top: 32%; }

.stage {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.pair {
    direction: ltr;
    width: 100%;
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 28px;
}

.logo-side {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-orbit {
    height: 100%;
    width: auto;
    max-width: min(440px, 100%);
    object-fit: contain;
    animation: logo-float 3.6s ease-in-out infinite;
}

.scene {
    position: relative;
    height: 360px;
}

.bokeh {
    position: absolute;
    border-radius: 50%;
    filter: blur(2px);
}

.bokeh-a {
    width: 180px;
    height: 180px;
    left: 18px;
    top: 36px;
    background: rgba(255, 255, 255, 0.55);
}

.bokeh-b {
    width: 120px;
    height: 120px;
    left: 150px;
    top: 8px;
    background: rgba(186, 224, 255, 0.45);
}

.rack {
    position: absolute;
    left: 6px;
    top: 132px;
    display: flex;
    align-items: flex-end;
    gap: 6px;
    z-index: 2;
}

.tube {
    display: block;
    width: 18px;
    border: 2px solid rgba(198, 220, 234, 0.95);
    border-top: 0;
    border-radius: 0 0 10px 10px;
    position: relative;
    box-shadow: inset -3px 0 0 rgba(255, 255, 255, 0.7);
}

.tube::before {
    content: "";
    position: absolute;
    left: 1px;
    right: 1px;
    top: -7px;
    height: 7px;
    border-radius: 3px 3px 0 0;
    background: #d7e4ee;
}

.tube-a { height: 78px; background: linear-gradient(#f7fbff 28%, #e85d6c 28%); }
.tube-b { height: 96px; background: linear-gradient(#f7fbff 34%, #3aa0f4 34%); }
.tube-c { height: 70px; background: linear-gradient(#f7fbff 30%, #8b6adf 30%); }

.laptop {
    position: absolute;
    left: 42px;
    top: 12px;
    width: 286px;
    z-index: 1;
    filter: drop-shadow(0 16px 18px rgba(55, 100, 140, 0.16));
}

.lid {
    background: linear-gradient(180deg, #e7eef5, #c5d4e2);
    border-radius: 14px 14px 6px 6px;
    padding: 8px;
}

.screen {
    direction: rtl;
    min-height: 196px;
    border-radius: 6px;
    background: linear-gradient(180deg, #e8f5ff, #d7ecff);
    display: flex;
    gap: 8px;
    padding: 10px 8px;
}

.rail {
    width: 22px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 4px;
}

.rail i {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.8);
    display: block;
}

.sheet {
    flex: 1;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(70, 120, 170, 0.12);
    text-align: center;
    padding: 8px 8px 10px;
    color: #1e4a86;
}

.sheet-art svg {
    width: 78px;
    height: 78px;
    display: block;
    margin: 0 auto 2px;
}

.sheet b {
    display: block;
    font-size: 13px;
    line-height: 1.35;
}

.sheet small {
    display: block;
    margin-top: 2px;
    color: #7d92ad;
    font-size: 10px;
    font-weight: 500;
}

.base {
    height: 12px;
    margin: 0 22px;
    background: linear-gradient(180deg, #f4f7fa, #c5d3e0);
    border-radius: 0 0 12px 12px;
    position: relative;
}

.base::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    width: 64px;
    height: 5px;
    transform: translateX(-50%);
    background: #a9bccb;
    border-radius: 0 0 6px 6px;
}

.scope {
    position: absolute;
    left: 4px;
    bottom: 8px;
    width: 210px;
    height: 78px;
    z-index: 3;
}

.login-card {
    direction: rtl;
    --tone: #2f86c4;
    --tone-deep: #1f6eab;
    position: relative;
    z-index: 1;
    overflow: visible;
    width: min(920px, 92vw);
    min-height: 0;
    margin: clamp(40px, 7vh, 84px) 0 0;
    padding: calc(clamp(168px, 26vh, 244px) * 0.72 + 36px) 42px clamp(14px, 2vh, 22px);
    background: linear-gradient(180deg, #ffffff 0%, #f4f9fc 100%);
    border: 1px solid #d5e7f3;
    border-radius: 28px;
    box-shadow: 0 18px 40px rgba(90, 150, 190, 0.14);
}

.login-card[data-party="patient"] {
    --tone: #2f86c4;
    --tone-deep: #1f6eab;
    background: linear-gradient(180deg, #ffffff 0%, #e7f3fb 100%);
    border-color: #b7d7ee;
    box-shadow: 0 18px 40px rgba(47, 134, 196, 0.18);
}
.login-card[data-party="doctor"] {
    --tone: #2a9aa8;
    --tone-deep: #1c7c88;
    background: linear-gradient(180deg, #ffffff 0%, #e5f6f6 100%);
    border-color: #b7e0e2;
    box-shadow: 0 18px 40px rgba(42, 154, 168, 0.18);
}
.login-card[data-party="contract"] {
    --tone: #e08a3a;
    --tone-deep: #c56e1e;
    background: linear-gradient(180deg, #ffffff 0%, #fbf1e4 100%);
    border-color: #f0d2ae;
    box-shadow: 0 18px 40px rgba(224, 138, 58, 0.18);
}
.login-card[data-party="lab"] {
    --tone: #8b68c9;
    --tone-deep: #6e4eae;
    background: linear-gradient(180deg, #ffffff 0%, #f3ecf9 100%);
    border-color: #d9c8ee;
    box-shadow: 0 18px 40px rgba(139, 104, 201, 0.18);
}

.hero-badge {
    position: absolute;
    z-index: 5;
    top: 0;
    left: 50%;
    width: clamp(168px, 26vh, 244px);
    height: clamp(168px, 26vh, 244px);
    transform: translate(-50%, -28%);
    display: grid;
    place-items: center;
    border-radius: 50%;
    overflow: visible;
    pointer-events: none;
    background:
        radial-gradient(circle at 50% 38%, #ffffff 0%, #f5fafd 48%, #dbe8f3 100%);
    box-shadow:
        inset 0 3px 4px rgba(255, 255, 255, 0.95),
        inset 0 -16px 22px rgba(48, 92, 130, 0.16),
        0 10px 16px rgba(24, 64, 104, 0.14),
        0 20px 34px rgba(24, 64, 104, 0.2),
        0 0 0 8px #fff,
        0 0 0 12px color-mix(in srgb, var(--tone) 72%, #fff);
}

.hero-badge::before {
    content: "";
    position: absolute;
    top: 7%;
    left: 20%;
    width: 42%;
    height: 18%;
    border-radius: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0));
    z-index: 2;
}

.hero-badge img {
    position: relative;
    z-index: 1;
    width: 86%;
    height: 86%;
    object-fit: contain;
    animation: logo-float 3.6s ease-in-out infinite;
    filter: drop-shadow(0 8px 10px rgba(20, 70, 110, 0.18));
}

.login-card h1 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    width: 100%;
    margin: 2px 0 clamp(18px, 2.6vh, 30px);
    padding: 0 8px;
    text-align: center;
    font-size: clamp(22px, 2.2vw, 30px);
    font-weight: 700;
    line-height: 1.45;
    color: #163e78;
}

.login-card h1::before,
.login-card h1::after {
    content: "";
    flex: 1 1 48px;
    max-width: 140px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, var(--tone));
}

.login-card h1::after {
    background: linear-gradient(90deg, var(--tone), transparent);
}

.tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.tab {
    min-height: clamp(78px, 12vh, 96px);
    border: 1px solid #e6eef6;
    border-radius: 14px;
    background: #f7fbfe;
    color: #6d84a0;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 2px;
    cursor: pointer;
    min-width: 0;
    white-space: normal;
}

.tab img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(20, 70, 110, 0.16));
}
.tab span { text-align: center; line-height: 1.25; }
.tab[data-tab="patient"] { color: #1f6eab; background: #e3f2fb; }
.tab[data-tab="doctor"] { color: #1c7c88; background: #e3f5f5; }
.tab[data-tab="contract"] { color: #c56e1e; background: #fbead6; }
.tab[data-tab="lab"] { color: #6e4eae; background: #f0e6f8; }
.tab.is-on {
    color: #fff;
}
.tab.is-on {
    border-color: transparent;
    background: linear-gradient(180deg, color-mix(in srgb, var(--tone) 55%, #fff), var(--tone-deep));
    box-shadow: 0 8px 14px color-mix(in srgb, var(--tone) 28%, transparent);
}

.party-head {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 4px 0 10px;
}

.party-badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    background: var(--tone);
}

.party-badge svg { width: 18px; height: 18px; display: none; }
.login-card[data-party="patient"] .for-patient,
.login-card[data-party="doctor"] .for-doctor,
.login-card[data-party="contract"] .for-contract,
.login-card[data-party="lab"] .for-lab { display: block; }

.party-line {
    display: flex;
    align-items: baseline;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    text-align: center;
}

.party-title {
    font-size: 18px;
    color: #1e4a86;
}

.party-hint {
    margin: 0;
    color: var(--tone-deep);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.45;
}

fieldset {
    border: 0;
    margin: 0;
    padding: 0;
    min-inline-size: 0;
    display: grid;
    gap: 8px;
}

.field {
    position: relative;
    display: block;
}

.field svg {
    position: absolute;
    top: 50%;
    inset-inline-start: 12px;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    color: var(--tone-deep);
    pointer-events: none;
}

.field input {
    width: 100%;
    height: clamp(48px, 7vh, 56px);
    border: 1px solid #e4eef7;
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-size: 14px;
    padding-inline-start: 40px;
    padding-inline-end: 12px;
}

.field input::placeholder { color: #a3b6cb; }
.field input:focus {
    outline: 2px solid #b9dcff;
    border-color: var(--tone);
}
.field input.is-bad {
    border-color: #e11d48;
    background: #fff7f8;
}

.sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.form-alert {
    margin: 8px 0 0;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
}

.form-alert[data-kind="error"] {
    background: #fff1f3;
    color: #b4233a;
}

.form-alert[data-kind="info"] {
    background: #eef6ff;
    color: #1d4f91;
}

.go {
    width: 100%;
    height: clamp(48px, 7vh, 58px);
    margin-top: clamp(8px, 1.4vh, 12px);
    border: 0;
    border-radius: 999px;
    color: #fff;
    font: inherit;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--tone) 58%, #fff) 0%, var(--tone-deep) 100%);
    box-shadow: 0 10px 16px color-mix(in srgb, var(--tone) 32%, transparent);
}

.go svg { width: 20px; height: 20px; }
.go:focus-visible, .tab:focus-visible, .contact-link:focus-visible {
    outline: 2px solid #8ec5ff;
    outline-offset: 2px;
}

.result-hello {
    margin: 8px 0 12px;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    color: var(--tone-deep);
}

.result-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.result-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #d5e7f3;
    color: #1e4a86;
    font-weight: 700;
    text-decoration: none;
}

.result-empty {
    margin: 12px 0;
    text-align: center;
    color: #7d92ad;
    font-weight: 600;
}

.result-logout { margin-top: 14px; }

.contact {
    margin: 10px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #8aa0b8;
    font-size: 13px;
    font-weight: 500;
}

.contact-link {
    border: 0;
    background: transparent;
    color: var(--tone-deep);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
}

.contact-link svg { width: 16px; height: 16px; }

.features {
    direction: rtl;
    width: min(240px, 100%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.features-left { grid-area: side-left; justify-self: end; }
.features-right { grid-area: side-right; justify-self: start; }

.feat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    padding: 12px 12px;
    margin: 0;
    border: 1px solid #e8f1f9;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 18px rgba(70, 130, 190, 0.08);
}

.feat div { min-width: 0; }

.feat strong {
    display: block;
    font-size: 14px;
    color: #1e4a86;
}

.feat span {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.45;
}

.bubble {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}

.bubble svg { width: 22px; height: 22px; }
.bubble-green { background: var(--green); }
.bubble-blue { background: var(--blue); }
.bubble-purple { background: var(--purple); }
.bubble-orange { background: var(--orange); }

@keyframes logo-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes drift-a {
    0% { transform: translate(0, 0); }
    50% { transform: translate(70px, -64px); }
    100% { transform: translate(0, 0); }
}
@keyframes drift-b {
    0% { transform: translate(0, 0); }
    50% { transform: translate(-78px, 54px); }
    100% { transform: translate(0, 0); }
}
@keyframes drift-c {
    0% { transform: translate(0, 0); }
    50% { transform: translate(56px, 72px); }
    100% { transform: translate(0, 0); }
}
@keyframes drift-d {
    0% { transform: translate(0, 0); }
    50% { transform: translate(-64px, -70px); }
    100% { transform: translate(0, 0); }
}

@media (max-width: 1100px) {
    .shell { width: min(1120px, calc(100% - 20px)); }
    .login-card { width: min(920px, 94vw); }
}

@media (max-width: 640px) {
    .login-card { padding: 168px 14px 16px; min-height: 0; }
    .hero-badge { width: 176px; height: 176px; }
    .login-card h1 { font-size: 18px; gap: 10px; margin-bottom: 16px; }
    .login-card h1::before, .login-card h1::after { max-width: 40px; }
    .tab { min-height: 72px; font-size: 12px; }
    .tab img { width: 36px; height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
    .floater, .hero-badge img { animation: none; }
}

body.is-desk { overflow: hidden; background: #F4F9FC; }
body.is-desk .floaters,
body.is-desk .shell { display: none; }
#patientDesk.st-app {
    --st-ink: #0F172A;
    --st-muted: #64748B;
    --st-line: #D6E4EE;
    --st-card: #fff;
    --st-primary: #0F766E;
    --primary: #0F766E;
    --background: #F4F9FC;
    --text: #0F172A;
    --text-muted: #64748B;
    --border: #D6E4EE;
    --shadow: 0 4px 14px rgba(7, 142, 173, 0.08);
    position: fixed;
    inset: 0;
    z-index: 20;
    height: 100dvh;
    background: #F4F9FC;
    font-family: "Readex Pro", sans-serif;
}
#patientDesk .st-body { grid-template-columns: minmax(0, 1fr) 440px; }
#patientDesk .st-test-list li { grid-template-columns: minmax(0, 1fr) auto; }
#patientDesk .st-test-list strong { font-size: 1.45rem; line-height: 1.35; color: #0f4c5c; }
#patientDesk .st-sample-facts { direction: rtl; text-align: right; }
.lims-dp { font-family: "Readex Pro", sans-serif; }

#patientDesk .re-patient-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    direction: rtl;
    text-align: right;
    padding: 12px 16px;
    background: linear-gradient(135deg, #b6e3ee 0%, #d4eef5 100%);
    border: 1px solid #9fd4e4;
    border-inline-start: 5px solid #0e7490;
    border-radius: 16px;
    box-shadow: 0 6px 18px rgba(14, 116, 144, 0.12);
    color: #115e59;
}
#patientDesk .re-patient-avatar-wrap { position: relative; flex: 0 0 auto; display: inline-flex; }
#patientDesk .re-patient-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #fff;
    background: #fff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.18);
}
#patientDesk .re-patient-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
#patientDesk .re-patient-stage {
    position: absolute;
    bottom: -4px;
    inset-inline-end: -6px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px var(--re-stage-ring, #9fd4e4), 0 6px 14px rgba(15, 23, 42, 0.22);
}
#patientDesk .re-patient-stage img { width: 32px; height: 32px; object-fit: contain; }
#patientDesk .re-stage-pending { --re-stage-ring: #38bdf8; }
#patientDesk .re-stage-collected { --re-stage-ring: #14b8a6; }
#patientDesk .re-stage-received { --re-stage-ring: #c2410c; }
#patientDesk .re-stage-rejected { --re-stage-ring: #ef4444; }
#patientDesk .re-stage-completed { --re-stage-ring: #22c55e; }
#patientDesk .re-stage-approved { --re-stage-ring: #facc15; }
#patientDesk .re-stage-approved img { transform: scale(1.2); }
#patientDesk .re-patient-info { flex: 1; min-width: 0; }
#patientDesk .re-patient-meta {
    display: grid;
    grid-template-columns: 1.75fr 1.4fr 1.4fr 1fr 1fr;
    grid-template-rows: repeat(2, minmax(3.6rem, 1fr));
    align-items: stretch;
    gap: 1px;
    background: #9fd4e4;
    border: 1px solid #9fd4e4;
    border-radius: 14px;
    overflow: hidden;
}
#patientDesk .re-meta-chip {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0;
    min-width: 0;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(145deg, #ccfbf1 0%, #5eead4 100%);
    color: #115e59;
    font-size: inherit;
}
#patientDesk .re-meta-chip i {
    order: -1;
    flex: 0 0 1.9rem;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.85);
    color: #115e59;
    font-size: 0.9rem;
}
#patientDesk .re-meta-text { display: flex; flex-direction: column; align-items: flex-start; gap: 0.1rem; min-width: 0; line-height: 1.2; }
#patientDesk .re-meta-chip em { font-style: normal; font-size: 0.78rem; font-weight: 700; white-space: nowrap; }
#patientDesk .re-meta-chip strong {
    display: block;
    max-width: 100%;
    font-size: 1.02rem;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#patientDesk .re-meta-name { grid-row: span 2; }
#patientDesk .re-meta-name strong { font-size: 1.15rem; white-space: normal; line-height: 1.35; }
#patientDesk .re-meta-file strong,
#patientDesk .re-meta-visit strong { direction: ltr; font-size: 0.95rem; overflow: visible; text-overflow: clip; }

#patientDesk .dq-tests { padding: 0.75rem 0.95rem 0.95rem; background: #fff7ed; }
#patientDesk .re-abn-table-wrap { border: 1px solid #fdba74; border-radius: 14px; overflow: auto; background: #fff; }
#patientDesk .re-abn-table { width: 100%; border-collapse: collapse; font-size: 1rem; }
#patientDesk .re-abn-table th { padding: 9px 12px; text-align: left; font-weight: 900; border-bottom: 1px solid #e2e8f0; }
#patientDesk .re-abn-table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
#patientDesk .re-abn-table tr:last-child td { border-bottom: 0; }
#patientDesk .re-abn-table th.is-test { background: #cffafe; color: #155e75; box-shadow: inset 0 -3px 0 #0f9fb5; }
#patientDesk .re-abn-table th.is-flag { background: #ffe4e6; color: #9f1239; box-shadow: inset 0 -3px 0 #e11d48; }
#patientDesk .re-abn-name { font-weight: 900; color: #0f172a; font-size: 1.15rem; }
#patientDesk .re-abn-name small { display: block; margin-top: 2px; font-size: 0.95rem; font-weight: 700; color: #0f4c5c; text-align: left; }
#patientDesk .re-abn-flag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 900;
    white-space: nowrap;
    border: 1px solid transparent;
}
#patientDesk .re-abn-flag img { width: 22px; height: 22px; object-fit: contain; }
#patientDesk .re-abn-flag.is-high { background: #ffedd5; color: #9a3412; border-color: #fdba74; }
#patientDesk .re-abn-flag.is-abnormal { background: #ede9fe; color: #5b21b6; border-color: #c4b5fd; }
#patientDesk .re-abn-flag.is-critical { background: #dc2626; color: #fff; border-color: #b91c1c; }
#patientDesk tr.is-critical td { background: #fff5f5; }

#patientDesk .st-patient-links {
    justify-content: center;
    gap: 1rem;
    margin: 0.4rem 0 0;
    padding: 1.1rem;
    border-radius: 18px;
    background: linear-gradient(135deg, #eef8fb 0%, #e0f2fe 100%);
    border: 1px solid #b6e3ee;
}
#patientDesk .st-link-btn {
    min-width: 13rem;
    min-height: 3.4rem;
    padding: 0.7rem 1.6rem;
    border: 0;
    border-radius: 14px;
    font-size: 1.12rem;
    font-weight: 800;
    color: #fff;
    gap: 0.6rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
#patientDesk .st-link-btn i { font-size: 1.25rem; }
#patientDesk .st-link-btn.is-report { background: linear-gradient(135deg, #2f86c4 0%, #1f6eab 100%); box-shadow: 0 8px 18px rgba(31, 110, 171, 0.32); }
#patientDesk .st-link-btn.is-print { background: linear-gradient(135deg, #16a34a 0%, #047857 100%); box-shadow: 0 8px 18px rgba(4, 120, 87, 0.3); }
#patientDesk .st-link-btn:hover { transform: translateY(-2px); filter: brightness(1.06); }
#patientDesk .st-link-btn.is-off { opacity: 0.45; pointer-events: none; box-shadow: none; }
#patientDesk .st-report-note { margin: 0.4rem 0 0; text-align: center; color: #5d7890; font-weight: 700; }

#patientDesk .pdesk-who {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin: 0.45rem 0.45rem 0;
    padding: 0.6rem 0.75rem;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #9fd4e4;
    box-shadow: 0 4px 14px rgba(7, 142, 173, 0.08);
    direction: rtl;
    text-align: right;
}
#patientDesk .pdesk-who-icon {
    flex: 0 0 3rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #e0f2fe 0%, #ccfbf1 100%);
    box-shadow: inset 0 0 0 2px #fff, 0 3px 8px rgba(15, 118, 110, 0.18);
}
#patientDesk .pdesk-who-icon img { width: 2.3rem; height: 2.3rem; object-fit: contain; }
#patientDesk .pdesk-who-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
#patientDesk .pdesk-who-text em { font-style: normal; font-size: 0.78rem; font-weight: 700; color: #0f766e; }
#patientDesk .pdesk-who-text strong { font-size: 1rem; font-weight: 800; color: #0f172a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#patientDesk .pdesk-who-out {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 2.4rem;
    padding: 0 0.85rem;
    border: 1px solid #fda4af;
    border-radius: 12px;
    background: linear-gradient(145deg, #fff1f2, #ffe4e6);
    color: #9f1239;
    font: 800 0.85rem "Readex Pro", sans-serif;
    cursor: pointer;
}
#patientDesk .pdesk-who-out:hover { filter: brightness(0.97); }
#patientDesk .st-filters input[type="search"] {
    width: 100%;
    min-height: 2.3rem;
    padding: 0.35rem 0.7rem;
    border: 1px solid #9fd4e4;
    border-radius: 10px;
    background: #fff;
    font: 600 0.9rem "Readex Pro", sans-serif;
    color: #0f172a;
}
#patientDesk .st-visit-avatar {
    width: 2.6rem;
    height: 2.6rem;
    flex: 0 0 2.6rem;
    border-radius: 50%;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.15);
}
#patientDesk .st-visit-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
#patientDesk .st-visit-name { font-size: 0.98rem; }
#patientDesk .st-visit-meta { font-size: 0.78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#patientDesk .st-visit-body { min-width: 0; }

@media (max-width: 900px) {
    body.is-desk { overflow: auto; }
    #patientDesk.st-app {
        position: relative;
        inset: auto;
        height: auto;
        min-height: 100dvh;
        overflow: visible;
    }
    #patientDesk .st-body {
        display: flex;
        flex-direction: column;
        height: auto;
        overflow: visible;
        padding: 0.5rem;
        gap: 0.6rem;
    }
    #patientDesk .st-sidebar { order: -1; height: auto; overflow: visible; }
    #patientDesk .st-visit-list { max-height: 40vh; flex: 0 0 auto; }
    #patientDesk .st-visit-meta { white-space: normal; line-height: 1.5; }
    #patientDesk .st-visit-meta bdi { white-space: nowrap; }
    #patientDesk .st-workspace { height: auto; overflow: visible; }
    #patientDesk .st-main { overflow: visible; scroll-margin-top: 0.5rem; }
    #patientDesk .st-desk { padding: 0.6rem; gap: 0.75rem; }

    #patientDesk .re-patient-bar { flex-direction: column; align-items: stretch; padding: 10px; }
    #patientDesk .re-patient-avatar-wrap { align-self: center; }
    #patientDesk .re-patient-avatar { width: 84px; height: 84px; }
    #patientDesk .re-patient-meta { grid-template-columns: 1fr 1fr; grid-template-rows: none; grid-auto-rows: minmax(3.3rem, auto); }
    #patientDesk .re-meta-name { grid-column: 1 / -1; grid-row: auto; }
    #patientDesk .re-meta-chip { padding: 0.45rem 0.55rem; gap: 0.45rem; }
    #patientDesk .re-meta-chip i { flex-basis: 1.7rem; width: 1.7rem; height: 1.7rem; }
    #patientDesk .re-meta-chip strong { font-size: 0.95rem; white-space: normal; overflow-wrap: anywhere; }

    #patientDesk .st-visit-journey { justify-content: flex-start; min-width: max-content; }
    #patientDesk .st-visit-journey .st-stage { min-width: 4.6rem; }
    #patientDesk .st-visit-journey .st-vj-icon img { width: 40px; height: 40px; }

    #patientDesk .st-sample-head { grid-template-columns: 1fr; }
    #patientDesk .st-sample-flags { justify-content: flex-start; }
    #patientDesk .st-sample-facts { grid-template-columns: 1fr 1fr; padding: 0.6rem; }
    #patientDesk .dq-tests { padding: 0.6rem; }
    #patientDesk .re-abn-name { font-size: 1rem; }
    #patientDesk .re-abn-table th,
    #patientDesk .re-abn-table td { padding: 8px 9px; }

    #patientDesk .st-patient-links { flex-direction: column; align-items: stretch; padding: 0.8rem; gap: 0.6rem; }
    #patientDesk .st-link-btn { min-width: 0; width: 100%; }
}

@media (max-width: 420px) {
    #patientDesk .re-meta-chip { padding: 0.4rem 0.5rem; gap: 0.35rem; }
    #patientDesk .re-meta-chip:not(.re-meta-name) i { display: none; }
    #patientDesk .re-meta-chip:not(.re-meta-name) strong { font-size: 0.86rem; white-space: nowrap; overflow-wrap: normal; }
    #patientDesk .st-sample-facts { grid-template-columns: 1fr 1fr; gap: 0.4rem; }
    #patientDesk .pdesk-who-out span { display: none; }
}
#patientDesk .st-filter-actions .btn {
    width: 1.8rem;
    height: 1.8rem;
    border: 0;
    border-radius: 999px;
    background: #fff;
    color: #0f766e;
    cursor: pointer;
}

.pdesk {
    position: fixed;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    background: #e7f3fb;
    color: #14324f;
    font-family: "Readex Pro", sans-serif;
}
.pdesk-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 18px;
    background: #fff;
    border-bottom: 1px solid #c5dff0;
}
.pdesk-bar img { width: 52px; height: 52px; object-fit: contain; }
.pdesk-bar strong { display: block; font-size: 18px; }
.pdesk-bar span { color: #5d7890; font-size: 13px; }
.pdesk-bar button {
    margin-inline-start: auto;
    border: 0;
    border-radius: 999px;
    padding: 8px 18px;
    background: #0878d1;
    color: #fff;
    font: 700 14px "Readex Pro", sans-serif;
    cursor: pointer;
}
.pdesk-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: row;
}
.pdesk-side {
    width: 400px;
    flex: 0 0 400px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    min-height: 0;
}
.pdesk-filter,
.pdesk-list-head,
.pdesk-visit,
.pdesk-card,
.pdesk-patient,
.pdesk-journey {
    background: #fff;
    border: 1px solid #b9daf0;
    border-radius: 16px;
}
.pdesk-filter { padding: 14px; }
.pdesk-filter h2 {
    margin: 0 0 12px;
    font-size: 16px;
    color: #0755a0;
}
.pdesk-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pdesk-dates label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #0755a0;
}
.pdesk-dates input {
    border: 1px solid #c5dff0;
    border-radius: 10px;
    padding: 8px 10px;
    font: 600 14px "Readex Pro", sans-serif;
    color: #14324f;
    background: #f7fbfe;
}
.pdesk-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    font-weight: 800;
    color: #0755a0;
}
.pdesk-list-head em {
    font-style: normal;
    background: #e7f3fb;
    border-radius: 999px;
    padding: 2px 10px;
}
.pdesk-list {
    flex: 1;
    min-height: 0;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.pdesk-visit {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    text-align: right;
    padding: 12px 14px;
    cursor: pointer;
    font: inherit;
}
.pdesk-visit.is-on { outline: 2px solid #0878d1; }
.pdesk-visit strong { display: block; font-size: 15px; }
.pdesk-visit em { display: block; margin-top: 3px; color: #5d7890; font-style: normal; font-size: 12px; }
.pdesk-stage {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 800;
    background: #e7f3fb;
    color: #0755a0;
}
.pdesk-stage.is-approved, .pdesk-stage.is-sent { background: #dcfce7; color: #166534; }
.pdesk-stage.is-completed, .pdesk-stage.is-printed { background: #ede9fe; color: #5b21b6; }
.pdesk-stage.is-rejected { background: #fee2e2; color: #991b1b; }
.pdesk-stage.is-collected, .pdesk-stage.is-received { background: #e0f2fe; color: #075985; }
.pdesk-work {
    flex: 1;
    min-width: 0;
    overflow: auto;
    padding: 12px 12px 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.pdesk-empty { margin: auto; color: #5d7890; font-weight: 700; }
.pdesk-patient { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px; }
.pdesk-patient h2 { margin: 0; width: 100%; font-size: 22px; }
.pdesk-chip {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 120px;
    padding: 8px 12px;
    border-radius: 12px;
    background: #f4f9fd;
    border: 1px solid #d7ebf8;
}
.pdesk-chip em { font-style: normal; font-size: 11px; color: #5d7890; }
.pdesk-chip strong { font-size: 14px; }
.pdesk-journey { padding: 14px 8px; overflow-x: auto; }
.pdesk-steps { display: flex; align-items: flex-start; min-width: max-content; }
.pdesk-step { display: flex; flex-direction: column; align-items: center; width: 108px; gap: 6px; }
.pdesk-step img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 50%;
    border: 3px solid #d5e3ea;
    background: #fff;
    padding: 6px;
}
.pdesk-step.is-done img { border-color: #22c55e; background: #f0fdf4; }
.pdesk-step.is-current img { border-color: #078ead; background: #ecfeff; transform: scale(1.08); }
.pdesk-step.is-upcoming img { filter: grayscale(1); opacity: 0.45; border-style: dashed; }
.pdesk-step b { font-size: 13px; text-align: center; }
.pdesk-step.is-current b { color: #056a82; }
.pdesk-step small {
    background: #078ead;
    color: #fff;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 11px;
}
.pdesk-line { flex: 1; height: 5px; margin-top: 32px; min-width: 18px; border-radius: 999px; background: #e2e8f0; }
.pdesk-line.is-done { background: #22c55e; }
.pdesk-card { padding: 14px; }
.pdesk-card-top { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.pdesk-card-top strong { font-size: 16px; color: #0755a0; }
.pdesk-card-top span { color: #5d7890; font-size: 13px; }
.pdesk-test {
    margin: 12px 0 4px;
    font-size: 28px;
    line-height: 1.25;
    color: #0b3f73;
}
.pdesk-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.pdesk-facts div { background: #f7fbfe; border-radius: 12px; padding: 8px 10px; }
.pdesk-facts dt { color: #5d7890; font-size: 12px; }
.pdesk-facts dd { margin: 3px 0 0; font-weight: 800; }
.pdesk-actions { display: flex; gap: 10px; justify-content: flex-start; }
.pdesk-actions a, .pdesk-actions button {
    border: 0;
    border-radius: 12px;
    padding: 12px 18px;
    font: 800 15px "Readex Pro", sans-serif;
    text-decoration: none;
    cursor: pointer;
}
.pdesk-actions .is-view { background: #0878d1; color: #fff; }
.pdesk-actions .is-down { background: #0f9f6e; color: #fff; }
.pdesk-actions .is-off { background: #d7e3ee; color: #6b7f92; pointer-events: none; }
.pdesk-note { margin: 0; color: #5d7890; font-size: 13px; }

@media (max-width: 900px) {
    .pdesk-body { flex-direction: column; }
    .pdesk-side { width: auto; flex-basis: auto; max-height: 46vh; }
    .pdesk-facts { grid-template-columns: 1fr 1fr; }
    .pdesk-test { font-size: 22px; }
}

/* Results desk (every party): one typeface, including buttons and date fields that browsers style on their own. */
#patientDesk,
#patientDesk :is(button, input, select, textarea, table, th, td, bdi, em, strong, dt, dd, label, span, p, a, h1, h2, h3) {
    font-family: "Readex Pro", sans-serif;
}
#patientDesk input[type="date"] { font-size: 14px; font-variant-numeric: tabular-nums; }
#patientDesk .st-visit-item { font-size: 15px; }
#patientDesk .st-visit-name { font-size: 15px; }
#patientDesk .st-visit-meta,
#patientDesk .st-visit-meta bdi { font-size: 13px; }
#patientDesk .st-visit-stage em,
#patientDesk .st-vj-here,
#patientDesk .st-arrival-chip,
#patientDesk .st-status-chip,
#patientDesk .st-sample-facts dt { font-size: 13px; }
#patientDesk .st-sample-facts dd { font-size: 14px; }
#patientDesk .re-meta-chip em,
#patientDesk .pdesk-who-text em,
#patientDesk .st-time em,
#patientDesk label > span { font-size: 13px; }
