
.patients-col {
    grid-column: 2 / -1;
    grid-row: 1;
    display: none;
    flex-direction: column;
    min-height: 0;
    padding: 22px 28px;
    background: #fff;
    overflow: hidden;
}

    .patients-col[hidden] {
        display: none;
    }

    .patients-col:not([hidden]) {
        display: flex;
    }

.patients-stage {
    flex: 1;
    min-height: 0;
    position: relative;
    overflow: hidden;
}

    /* generic screen wrapper, reused across all patients screens */
    .patients-stage .screen {
        position: absolute;
        inset: 0;
        opacity: 0;
        pointer-events: none;
        transform: translateY(8px);
        transition: opacity .35s ease, transform .35s ease;
        overflow-y: auto;
    }

        .patients-stage .screen.active {
            opacity: 1;
            pointer-events: auto;
            transform: translateY(0);
        }

/* ---------- shared avatar ---------- */
.patient-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--navy);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
}

    .patient-avatar.lg {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }


.patients-list-screen {
    padding: 4px 2px 20px;
}

.patients-list-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

    .patients-list-topbar .btn-primary {
        padding: 12px 20px;
    }

.patients-search-row {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 420px;
    min-width: 220px;
}

    .patients-search-row .search-box {
        margin-top: 0;
        flex: 1;
    }

.patients-filter-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid var(--gray-line);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-mute);
    flex-shrink: 0;
}

    .patients-filter-btn:hover {
        background: var(--gray-bg);
    }

    .patients-filter-btn svg {
        width: 17px;
        height: 17px;
    }

.patients-pagination {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 13px;
    color: var(--text-mute);
    white-space: nowrap;
}

    .patients-pagination select {
        border: 1px solid var(--gray-line);
        border-radius: 6px;
        padding: 6px 10px;
        font-size: 13px;
        color: var(--text);
        background: #fff;
    }

.pager-btns {
    display: flex;
    gap: 4px;
}

    .pager-btns button {
        width: 28px;
        height: 28px;
        border-radius: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--text-mute);
    }

        .pager-btns button:hover {
            background: var(--gray-bg);
        }

    .pager-btns svg {
        width: 15px;
        height: 15px;
    }

.patients-list-head {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 16px 10px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-mute);
    border-bottom: 1px solid var(--gray-line);
    margin-bottom: 4px;
}

.patients-list-body {
    display: flex;
    flex-direction: column;
    flex: 0 1 auto;
}

/* shown when there are no rows (or as a bottom-of-list cap) so the
   panel doesn't read as a big empty grey rectangle under a short list */
.patients-list-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 60px 20px;
    color: var(--text-mute);
    font-size: 14px;
    text-align: center;
}

    .patients-list-empty svg {
        width: 34px;
        height: 34px;
        color: #c7cfdb;
    }

.patient-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-line);
    cursor: pointer;
    transition: background .15s ease;
    animation: fadeSlideIn .3s ease;
}

    .patient-row:hover {
        background: var(--gray-bg);
    }

.patient-row-info {
    flex: 1;
    min-width: 0;
}

.patient-row-name {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--blue);
}

.patient-row-id {
    font-size: 12.5px;
    color: var(--text-mute);
    margin-top: 1px;
}

.patient-row-dash {
    color: var(--text-mute);
    width: 180px;
}

.patient-row-date {
    margin-left: auto;
    font-size: 13px;
    color: var(--text-mute);
    white-space: nowrap;
}


.patient-slideover-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15,42,77,0.16);
    backdrop-filter: blur(1px);
    display: flex;
    justify-content: flex-end;
    z-index: 20;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
}

    .patient-slideover-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }

.patient-slideover {
    width: 460px;
    max-width: 92%;
    height: 100%;
    background: #fff;
    box-shadow: -8px 0 24px rgba(15,42,77,0.14), -2px 0 6px rgba(15,42,77,0.08);
    border-left: 1px solid var(--gray-line);
    padding: 26px 28px 22px;
    display: flex;
    flex-direction: column;
    transform: translateX(24px);
    transition: transform .28s ease;
    overflow: hidden;
}

.patient-slideover-overlay.active .patient-slideover {
    transform: translateX(0);
}

.patient-slideover-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 14px;
}

.bloodgroup-pill {
    text-align: right;
    font-size: 12.5px;
    color: var(--text-mute);
}

    .bloodgroup-pill b {
        display: block;
        font-size: 16px;
        color: var(--text);
        margin-top: 2px;
    }

.patient-slideover-name {
    font-size: 19px;
    font-weight: 800;
    margin-bottom: 2px;
}

.patient-slideover-sub {
    font-size: 13px;
    color: var(--text-mute);
}

.patient-slideover-sub2 {
    font-size: 13px;
    color: var(--text-mute);
    margin-bottom: 18px;
}

.pv-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 18px;
}

.pv-tab {
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text);
    background: var(--gray-bg);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}

    .pv-tab:hover:not(.active) {
        background: #e7ebf1;
        border-color: var(--gray-line);
    }

    .pv-tab.active {
        background: var(--navy);
        color: #fff;
    }

.pv-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: #b7bfcb transparent;
}

    .pv-body::-webkit-scrollbar {
        width: 6px;
    }

    .pv-body::-webkit-scrollbar-thumb {
        background: #b7bfcb;
        border-radius: 6px;
    }

    .pv-body::-webkit-scrollbar-thumb:hover {
        background: #97a1b1;
    }

    .pv-body::-webkit-scrollbar-track {
        background: transparent;
    }

    .pv-body h4 {
        font-size: 15px;
        font-weight: 800;
        margin: 14px 0 8px;
    }

        .pv-body h4:first-child {
            margin-top: 0;
        }

    .pv-body p {
        font-size: 14px;
        line-height: 1.65;
        color: var(--text);
        margin-bottom: 6px;
    }

.pv-file-row, .pv-timeline-entry {
    border: 1px solid var(--gray-line);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 10px;
}

.pv-file-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

    .pv-file-row .doc-icon {
        width: 34px;
        height: 42px;
        background: #dbe8ff;
        color: #2860c9;
        border-radius: 4px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

        .pv-file-row .doc-icon svg {
            width: 17px;
            height: 17px;
        }

.pv-file-name {
    font-weight: 700;
    font-size: 14px;
}

.pv-file-meta {
    font-size: 12px;
    color: var(--text-mute);
    margin-top: 1px;
}

.pv-file-actions {
    margin-left: auto;
    display: flex;
    gap: 14px;
}

    .pv-file-actions a, .pv-file-actions button {
        color: var(--blue);
        font-weight: 700;
        font-size: 13.5px;
    }

        .pv-file-actions a:hover, .pv-file-actions button:hover {
            text-decoration: underline;
        }

.pv-timeline-date {
    font-size: 13px;
    color: var(--text-mute);
    font-weight: 700;
    margin-bottom: 8px;
}

.patient-slideover-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-line);
}


.patient-details-screen {
    padding: 2px 2px 24px;
}

.pd-breadcrumb {
    font-size: 13.5px;
    color: var(--text-mute);
    margin-bottom: 14px;
}

    .pd-breadcrumb .crumb-link {
        color: var(--text-mute);
        font-weight: 600;
        cursor: pointer;
    }

        .pd-breadcrumb .crumb-link:hover {
            color: var(--blue);
            text-decoration: underline;
        }

    .pd-breadcrumb .crumb-current {
        color: #b7bfcb;
    }

.pd-headrow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 14px;
}

    .pd-headrow h1 {
        font-size: 26px;
        font-weight: 800;
    }

.pd-head-actions {
    display: flex;
    gap: 12px;
}

    .pd-head-actions .btn {
        padding: 11px 20px;
    }

.patient-details-body {
    display: flex;
    gap: 26px;
    align-items: flex-start;
}

.pd-card {
    width: 300px;
    flex-shrink: 0;
    border: 1px solid var(--gray-line);
    border-radius: 12px;
    padding: 22px 22px 24px;
}

.pd-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}

.pd-edit-btn {
    color: var(--text-mute);
    width: 30px;
    height: 30px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .pd-edit-btn:hover {
        background: var(--gray-bg);
        color: var(--blue);
    }

    .pd-edit-btn svg {
        width: 16px;
        height: 16px;
    }

.pd-card-name {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 1px;
}

.pd-card-id {
    font-size: 13px;
    color: var(--text-mute);
}

.pd-card-gender {
    font-size: 13px;
    color: var(--text-mute);
    margin-bottom: 18px;
}

.pd-field-row {
    padding: 12px 0;
    border-top: 1px solid var(--gray-line);
}

    .pd-field-row:first-of-type {
        border-top: 1px solid var(--gray-line);
        margin-top: 4px;
    }

    .pd-field-row label {
        display: block;
        font-size: 12px;
        color: var(--text-mute);
        margin-bottom: 3px;
    }

    .pd-field-row span {
        font-size: 14px;
        font-weight: 600;
        color: var(--text);
    }

.patient-details-main {
    flex: 1;
    min-width: 0;
}

.pd-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.pd-tab {
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    border: 1px solid var(--gray-line);
    background: #fff;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}

    .pd-tab:hover:not(.active) {
        background: var(--gray-bg);
    }

    .pd-tab.active {
        background: var(--blue-light);
        color: var(--navy);
        border-color: #c7d7f2;
    }

.pd-search-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    max-width: 420px;
}

    .pd-search-row .search-box {
        margin-top: 0;
        flex: 1;
    }

.pd-body-panel h4 {
    font-size: 15px;
    font-weight: 800;
    margin: 18px 0 8px;
}

    .pd-body-panel h4:first-child {
        margin-top: 0;
    }

.pd-body-panel p {
    font-size: 14.5px;
    line-height: 1.7;
    color: var(--text);
    margin-bottom: 8px;
}

.pd-timeline-entry, .pd-file-row {
    border: 1px solid var(--gray-line);
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 12px;
}

.pd-timeline-date {
    font-size: 13.5px;
    color: var(--text-mute);
    margin-bottom: 8px;
}

.pd-timeline-text {
    font-size: 14.5px;
    line-height: 1.65;
    color: var(--text);
}

.pd-readmore {
    display: inline-block;
    margin-top: 8px;
    color: var(--blue);
    font-weight: 700;
    font-size: 13.5px;
}

    .pd-readmore:hover {
        text-decoration: underline;
    }

.pd-file-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

    .pd-file-row .doc-icon {
        width: 36px;
        height: 44px;
        background: #dbe8ff;
        color: #2860c9;
        border-radius: 4px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

        .pd-file-row .doc-icon svg {
            width: 18px;
            height: 18px;
        }

.pd-file-name {
    font-weight: 700;
    font-size: 15px;
    color: var(--navy);
}

.pd-file-meta {
    font-size: 12.5px;
    color: var(--text-mute);
    margin-top: 1px;
}

.pd-file-actions {
    margin-left: auto;
    display: flex;
    gap: 18px;
}

    .pd-file-actions a, .pd-file-actions button {
        color: var(--blue);
        font-weight: 700;
        font-size: 14px;
    }

        .pd-file-actions a:hover, .pd-file-actions button:hover {
            text-decoration: underline;
        }

.pd-file-date {
    font-size: 13px;
    color: var(--text-mute);
    margin-bottom: 10px;
}


.pd-form-screen {
    padding: 2px 2px 24px;
    max-width: 1080px;
}

.pd-form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 26px 30px;
    margin-top: 6px;
}

.pd-form-field label {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 8px;
}

    .pd-form-field label .req {
        color: #d1452b;
    }

.pd-form-field input {
    width: 100%;
    border: 1px solid var(--gray-line);
    border-radius: 8px;
    padding: 13px 16px;
    font-size: 14.5px;
    outline: none;
    color: var(--text);
    background: #fff;
}

    .pd-form-field input::placeholder {
        color: #b7bfcb;
    }

    .pd-form-field input:focus {
        border-color: var(--navy);
        box-shadow: 0 0 0 1px var(--navy);
    }

.pd-form-field.span2 {
    grid-column: span 2;
}

.pd-form-field.span3 {
    grid-column: span 3;
}

.pd-phone-field {
    display: flex;
}

    .pd-phone-field .pd-cc {
        display: flex;
        align-items: center;
        gap: 6px;
        border: 1px solid var(--gray-line);
        border-right: none;
        border-radius: 8px 0 0 8px;
        padding: 0 14px;
        font-size: 14.5px;
        color: var(--text);
        background: var(--gray-bg);
        white-space: nowrap;
    }

    .pd-phone-field input {
        border-radius: 0 8px 8px 0;
    }

.pd-date-field {
    position: relative;
}

    .pd-date-field svg {
        position: absolute;
        right: 14px;
        top: 50%;
        transform: translateY(-50%);
        width: 17px;
        height: 17px;
        color: var(--text-mute);
        pointer-events: none;
    }

@media (max-width: 980px) {
    .pd-form-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .pd-form-field.span3 {
        grid-column: span 2;
    }

    .patient-details-body {
        flex-direction: column;
    }

    .pd-card {
        width: 100%;
    }
}

@media (max-width: 620px) {
    .pd-form-grid {
        grid-template-columns: 1fr;
    }

    .pd-form-field.span2, .pd-form-field.span3 {
        grid-column: span 1;
    }

    .patient-slideover {
        width: 100%;
        max-width: 100%;
    }
}