﻿/* =========================================================
   GLOBAL PATIENT CARD
   ========================================================= */

.patient-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: 22px;
    background: linear-gradient( 180deg, #ffffff, #f8fafc );
    border: 1px solid rgba(226,232,240,.9);
    transition: .25s ease;
    position: relative;
    overflow: hidden;
}

    /* HOVER */
    .patient-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 14px 28px rgba(15,23,42,.08);
    }

    /* COMPACT */
    .patient-card.compact {
        padding: 10px 12px;
        background: transparent;
        border: none;
        box-shadow: none;
    }

/* =========================================================
   Loader
   ========================================================= */

.loader-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 40px 16px;
    color: #888;
    font-size: 14px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e0e0e0;
    border-top-color: #1D9E75;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


/* STATUS */
.patient-status-dot {
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid white;
}

    /* ACTIVE */
    .patient-status-dot.active {
        background: #22c55e;
    }

    /* INACTIVE */
    .patient-status-dot.inactive {
        background: #ef4444;
    }

/* =========================================================
   INFO
   ========================================================= */

.patient-card-info {
    flex: 1;
    min-width: 0;
}

/* TOP */
.patient-card-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

    /* NAME */
    .patient-card-top h4 {
        margin: 0;
        font-size: 15px;
        font-weight: 800;
        color: var(--text);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

/* META */
.patient-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-light);
}

/* EXTRA */
.patient-card-extra {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 13px;
}

/* =========================================================
   VIP BADGE
   ========================================================= */

.vip-badge {
    height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    background: linear-gradient( 135deg, #f59e0b, #fbbf24 );
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
}

/* =========================================================
   VISIT BADGE
   ========================================================= */

.visit-badge {
    min-height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    background: #eff6ff;
    color: #2563eb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

/* =========================================================
   MOBILE
   ========================================================= */

@media(max-width:768px) {

    .patient-card {
        padding: 14px;
    }

    .patient-card-avatar {
        width: 52px;
        height: 52px;
        min-width: 52px;
    }

    .patient-card-extra {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}


/* =========================================================
   GLOBAL PATIENT SEARCH
   ========================================================= */

.patient-search {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    width: 100%;
}

/* =========================================================
   SEARCH BOX
   ========================================================= */

.patient-search-box {
    flex: 1;
    min-width: 490px;
    height: 60px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient( 180deg, #ffffff, #f8fafc );
    border: 1px solid rgba(226,232,240,.9);
    border-radius: 22px;
    transition: .25s ease;
    box-shadow: 0 6px 16px rgba(15,23,42,.04);
}

    /* FOCUS */
    .patient-search-box:focus-within {
        border-color: rgba(59,130,246,.5);
        box-shadow: 0 0 0 5px rgba(59,130,246,.08), 0 14px 28px rgba(37,99,235,.08);
    }

/* =========================================================
   SEARCH ICON
   ========================================================= */

.search-icon {
    font-size: 16px;
    opacity: .7;
}

/* =========================================================
   INPUT
   ========================================================= */

.patient-search-box input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

    /* PLACEHOLDER */
    .patient-search-box input::placeholder {
        color: #94a3b8;
    }

/* =========================================================
   ACTION BUTTONS
   ========================================================= */

.search-action-btn {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 12px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: .2s ease;
    font-size: 14px;
}

    /* HOVER */
    .search-action-btn:hover {
        background: #eff6ff;
        transform: translateY(-1px);
    }

/* =========================================================
   FILTER
   ========================================================= */

.patient-search-filter {
    min-width: 250px;
    height: 60px;
    padding: 0 18px;
    border-radius: 20px;
    border: 1px solid rgba(226,232,240,.9);
    background: linear-gradient( 180deg, #ffffff, #f8fafc );
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    outline: none;
    cursor: pointer;
    transition: .25s ease;
    box-shadow: 0 4px 14px rgba(15,23,42,.04);
}

    /* FOCUS */
    .patient-search-filter:focus {
        border-color: rgba(59,130,246,.5);
        box-shadow: 0 0 0 5px rgba(59,130,246,.08);
    }

/* =========================================================
   SEARCH BUTTON
   ========================================================= */

.patient-search-btn {
    min-width: 130px;
}
.input-error {
    border: 1.5px solid #e53e3e !important;
    background-color: #fff5f5;
}

.error-msg {
    color: #e53e3e;
    font-size: 0.78rem;
    margin-top: 4px;
    display: block;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media(max-width:992px) {

    .patient-search {
        flex-direction: column;
        align-items: stretch;
    }

    .patient-search-box {
        min-width: 100%;
    }

    .patient-search-filter {
        width: 100%;
    }

    .patient-search-btn {
        width: 100%;
    }
}



/*Investigation selector Component*/

.investigation-selector {
    background: #fff;
    border: 1px solid #e4e9ef;
    border-radius: 14px;
    overflow: hidden;
    color: #172033;
}

.is-head {
    padding: 15px 17px;
    border-bottom: 1px solid #edf0f4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.is-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.is-title-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #eef4ff;
    color: #2563eb;
}

.is-title h5 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
}

.is-title p {
    margin: 3px 0 0;
    color: #8993a4;
    font-size: 10px;
}

.selected-count {
    background: #eef4ff;
    color: #2563eb;
    padding: 6px 10px;
    border-radius: 15px;
    font-size: 10px;
    font-weight: 700;
}

.is-search-area {
    padding: 13px 17px 8px;
}

.is-search {
    position: relative;
}

    .is-search > i {
        position: absolute;
        left: 13px;
        top: 12px;
        color: #98a2b3;
        font-size: 13px;
    }

    .is-search input {
        width: 100%;
        border: 1px solid #dfe4ea;
        border-radius: 9px;
        padding: 9px 38px 9px 36px;
        outline: none;
        font-size: 12px;
    }

        .is-search input:focus {
            border-color: #8db3ff;
            box-shadow: 0 0 0 3px #eef4ff;
        }

.clear-search {
    position: absolute;
    right: 9px;
    top: 7px;
    border: 0;
    background: transparent;
    color: #98a2b3;
}

.category-row {
    display: flex;
    gap: 5px;
    padding: 4px 17px 12px;
    overflow-x: auto;
}

.category-chip {
    border: 1px solid #e2e7ed;
    background: #fff;
    color: #667085;
    padding: 6px 10px;
    border-radius: 7px;
    font-size: 10px;
    white-space: nowrap;
}

    .category-chip.active {
        background: #eef4ff;
        border-color: #cfe0ff;
        color: #2563eb;
        font-weight: 700;
    }

.search-results {
    margin: 0 17px 13px;
    border: 1px solid #e3e8ef;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.results-caption {
    padding: 8px 11px;
    background: #f8fafc;
    display: flex;
    justify-content: space-between;
    color: #667085;
}

    .results-caption span {
        font-size: 9px;
        font-weight: 700;
    }

    .results-caption small {
        font-size: 9px;
    }

.search-result {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 0;
    border-bottom: 1px solid #edf0f4;
    background: #fff;
    padding: 10px 11px;
    text-align: left;
}

    .search-result:last-child {
        border-bottom: 0;
    }

    .search-result:hover {
        background: #f8fbff;
    }

    .search-result.already-selected {
        background: #f7fbff;
    }

.test-icon,
.quick-icon,
.selected-test-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.test-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.test-main {
    flex: 1;
}

    .test-main strong,
    .test-main small {
        display: block;
    }

    .test-main strong {
        font-size: 11px;
    }

    .test-main small {
        color: #98a2b3;
        font-size: 9px;
        margin-top: 2px;
    }

.test-price {
    font-size: 10px;
    color: #667085;
}

.add-icon,
.added {
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.add-icon {
    background: #f1f4f7;
    color: #667085;
}

.added {
    color: #16803c;
    font-size: 14px;
}

.empty-search {
    padding: 22px;
    text-align: center;
    color: #98a2b3;
}

    .empty-search i,
    .empty-search strong,
    .empty-search span {
        display: block;
    }

    .empty-search i {
        font-size: 20px;
        margin-bottom: 6px;
    }

    .empty-search strong {
        color: #667085;
        font-size: 11px;
    }

    .empty-search span {
        font-size: 9px;
        margin-top: 3px;
    }

.quick-section,
.selected-section,
.clinical-section {
    padding: 0 17px 15px;
}

.section-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

    .section-label > span {
        color: #667085;
        font-size: 9px;
        font-weight: 700;
        letter-spacing: .3px;
    }

    .section-label small {
        color: #98a2b3;
        font-size: 9px;
    }

.quick-list {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

.quick-test {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #e2e7ed;
    background: #fff;
    color: #344054;
    padding: 6px 9px 6px 6px;
    border-radius: 8px;
    font-size: 10px;
}

    .quick-test:hover,
    .quick-test.selected {
        background: #eef4ff;
        border-color: #cfe0ff;
        color: #2563eb;
    }

.quick-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
}

.selected-check {
    font-size: 10px;
}

.pathology {
    background: #fff4e5;
    color: #c77900;
}

.radiology {
    background: #f1edff;
    color: #7c3aed;
}

.other {
    background: #eafaf1;
    color: #16803c;
}

.selected-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.selected-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 10px;
    border: 1px solid #e5eaf0;
    border-radius: 9px;
    background: #fbfcfd;
}

.selected-test-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
}

.selected-test {
    flex: 1;
    min-width: 0;
}

    .selected-test strong,
    .selected-test span {
        display: block;
    }

    .selected-test strong {
        font-size: 11px;
    }

    .selected-test span {
        font-size: 9px;
        color: #98a2b3;
        margin-top: 2px;
    }

.selected-meta {
    display: flex;
    align-items: center;
    gap: 7px;
}

.price {
    color: #667085;
    font-size: 10px;
}

.priority-select {
    width: 100px;
    font-size: 9px;
    padding: 5px 7px;
}

.remove-test {
    border: 0;
    background: #f3f5f7;
    color: #98a2b3;
    width: 27px;
    height: 27px;
    border-radius: 6px;
}

    .remove-test:hover {
        color: #dc3545;
        background: #fff0f1;
    }

.clear-all {
    border: 0;
    background: transparent;
    color: #dc3545;
    font-size: 9px;
}

.empty-selected {
    border: 1px dashed #d9dfe7;
    border-radius: 10px;
    padding: 22px 10px;
    text-align: center;
    color: #98a2b3;
}

.empty-icon {
    width: 38px;
    height: 38px;
    margin: 0 auto 7px;
    border-radius: 10px;
    background: #f4f6f8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
}

.empty-selected strong,
.empty-selected span {
    display: block;
}

.empty-selected strong {
    color: #667085;
    font-size: 11px;
}

.empty-selected span {
    font-size: 9px;
    margin-top: 3px;
}

.clinical-section {
    padding-top: 0;
}

    .clinical-section label {
        display: block;
        color: #344054;
        font-size: 10px;
        font-weight: 600;
        margin-bottom: 5px;
    }

        .clinical-section label span {
            color: #98a2b3;
            font-weight: 400;
            margin-left: 4px;
        }

    .clinical-section textarea {
        width: 100%;
        border: 1px solid #dfe4ea;
        border-radius: 8px;
        padding: 8px 10px;
        font-size: 10px;
        resize: vertical;
        outline: none;
    }

        .clinical-section textarea:focus {
            border-color: #8db3ff;
            box-shadow: 0 0 0 3px #eef4ff;
        }

.is-footer {
    border-top: 1px solid #edf0f4;
    background: #fafbfc;
    padding: 11px 17px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.footer-summary {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

    .footer-summary strong {
        font-size: 16px;
    }

    .footer-summary span {
        color: #667085;
        font-size: 10px;
    }

    .footer-summary b {
        color: #2563eb;
        font-size: 12px;
        margin-left: 8px;
    }

.add-order-btn {
    font-size: 11px;
}

.success-message {
    margin: 10px 17px 15px;
    padding: 9px 11px;
    background: #eafaf1;
    color: #16803c;
    border: 1px solid #c7ebd5;
    border-radius: 8px;
    font-size: 10px;
}

@media (max-width: 700px) {
    .selected-item {
        flex-wrap: wrap;
    }

    .selected-test {
        width: calc(100% - 50px);
    }

    .selected-meta {
        width: 100%;
        padding-left: 43px;
    }

    .priority-select {
        flex: 1;
    }

    .is-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .add-order-btn {
        width: 100%;
    }
}