/* === Search Bar === */
.search-bar {
    position: relative;
    display: flex;
    align-items: center;
}

.search-bar__icon {
    position: absolute;
    left: 12px;
    color: #9e9e9e;
    pointer-events: none;
}

.search-bar__input {
    width: 100%;
    padding: 10px 36px 10px 40px;
    border: 1px solid #333;
    border-radius: 10px;
    background: #2a2a2a;
    color: #fff;
    font-size: 15px;
    outline: none;
    transition: border-color .2s;
}

.search-bar__input:focus {
    border-color: #4fc3f7;
}

.search-bar__input::placeholder {
    color: #777;
}

.search-bar__clear {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: #9e9e9e;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 6px;
    display: none;
}

.search-bar__clear--visible {
    display: block;
}

/* === Patient List === */
.patient-list {
    list-style: none;
    width: 100%;
    max-width: 640px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.patient-card {
    display: flex;
    align-items: center;
    background: #1e1e1e;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    transition: background .15s, border-color .15s;
    overflow: hidden;
}

.patient-card:hover {
    background: #262626;
    border-color: #4fc3f7;
}

.patient-card__link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 8px 14px 16px;
    flex: 1;
    min-width: 0;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.patient-card__avatar {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    color: #4fc3f7;
    text-transform: uppercase;
}

.patient-card__info {
    flex: 1;
    min-width: 0;
}

.patient-card__name {
    font-size: 15px;
    font-weight: 500;
    color: #e0e0e0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.patient-card__meta {
    font-size: 12px;
    color: #777;
    margin-top: 3px;
    display: flex;
    gap: 12px;
}

.patient-card__appointments {
    display: flex;
    align-items: center;
    gap: 4px;
}

.patient-card__arrow {
    color: #555;
    font-size: 18px;
    flex-shrink: 0;
}

.patient-card__new-apt {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    min-height: 100%;
    background: none;
    border: none;
    border-left: 1px solid #2a2a2a;
    color: #4fc3f7;
    cursor: pointer;
    transition: background .15s, color .15s;
    flex-shrink: 0;
    padding: 0;
}

.patient-card__new-apt:hover {
    background: rgba(79, 195, 247, .12);
    color: #81d4fa;
}

.patient-card__new-apt:active {
    background: rgba(79, 195, 247, .2);
}

/* === Create Patient Button === */
.btn--create-patient {
    background: rgba(79, 195, 247, .12);
    color: #4fc3f7;
    border: 1px dashed #4fc3f7;
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
    gap: 8px;
    transition: background .2s, border-color .2s;
}

.btn--create-patient:hover {
    background: rgba(79, 195, 247, .2);
    border-color: #81d4fa;
}

.btn--create-patient:active {
    transform: scale(.96);
}

/* === Empty state add-patient form === */
.empty-hint {
    font-size: 14px;
    color: #777;
    margin: 0;
}

.add-patient-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 360px;
    margin-top: 8px;
}

.add-patient-form__input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #333;
    border-radius: 10px;
    background: #2a2a2a;
    color: #fff;
    font-size: 15px;
    outline: none;
    transition: border-color .2s;
    text-align: center;
    box-sizing: border-box;
}

.add-patient-form__input:focus {
    border-color: #4fc3f7;
}

.add-patient-form__input::placeholder {
    color: #666;
}

.add-patient-form__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 15px;
    border-radius: 10px;
    transition: opacity .2s, transform .15s;
}

.add-patient-form__btn:disabled {
    opacity: .4;
    cursor: default;
}

.add-patient-form__btn:not(:disabled):active {
    transform: scale(.96);
}

/* === FAB (floating action button) === */
.fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: #4fc3f7;
    color: #111;
    box-shadow: 0 4px 14px rgba(0,0,0,.45);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: transform .15s, box-shadow .15s, background .15s;
}

.fab:hover {
    background: #81d4fa;
    box-shadow: 0 6px 20px rgba(0,0,0,.5);
    transform: scale(1.08);
}

.fab:active {
    transform: scale(.94);
}

/* === Modal overlay === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
}

.modal-overlay--visible {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 16px;
    width: 92%;
    max-width: 380px;
    padding: 20px;
    transform: translateY(20px);
    transition: transform .2s;
}

.modal-overlay--visible .modal {
    transform: translateY(0);
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.modal__title {
    font-size: 18px;
    font-weight: 600;
    color: #e0e0e0;
    margin: 0;
}

.modal__close {
    background: none;
    border: none;
    color: #9e9e9e;
    font-size: 24px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.modal__close:hover {
    color: #fff;
}

.modal__input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #333;
    border-radius: 10px;
    background: #2a2a2a;
    color: #fff;
    font-size: 16px;
    outline: none;
    transition: border-color .2s;
    box-sizing: border-box;
}

.modal__input:focus {
    border-color: #4fc3f7;
}

.modal__input::placeholder {
    color: #666;
}

.modal__footer {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
}

.modal__submit {
    padding: 10px 28px;
    font-size: 15px;
    border-radius: 10px;
    transition: opacity .2s, transform .15s;
}

.modal__submit:disabled {
    opacity: .4;
    cursor: default;
}

.modal__submit:not(:disabled):active {
    transform: scale(.96);
}

/* === Counter badge === */
.patients-count {
    font-size: 13px;
    color: #777;
    width: 100%;
    max-width: 640px;
    padding: 0 4px;
}

/* === Responsive === */
@media (max-width: 480px) {
    .search-bar__input {
        font-size: 14px;
        padding: 9px 36px 9px 38px;
    }

    .patient-card__link {
        padding: 12px 6px 12px 14px;
        gap: 12px;
    }

    .patient-card__avatar {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }

    .patient-card__name {
        font-size: 14px;
    }

    .patient-card__new-apt {
        width: 40px;
    }
}
