/* Paciente Selector — modal reutilizable */

.ps-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ps-modal {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 95%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    font-family: system-ui, -apple-system, sans-serif;
}

.ps-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #2c5aa0;
    color: #fff;
    border-radius: 6px 6px 0 0;
}

.ps-modal__title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.ps-modal__close {
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    padding: 0 6px;
    line-height: 1;
}

.ps-modal__body {
    padding: 14px 16px;
    overflow-y: auto;
    flex: 1;
}

.ps-modal__footer {
    padding: 10px 16px;
    border-top: 1px solid #ddd;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    background: #f9f9f9;
    border-radius: 0 0 6px 6px;
}

.ps-form {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 16px;
    margin-bottom: 12px;
}

.ps-field {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ps-field label {
    font-size: 13px;
    color: #444;
    min-width: 90px;
}

.ps-field input,
.ps-field select {
    flex: 1;
    padding: 4px 6px;
    font-size: 13px;
    border: 1px solid #aaa;
    border-radius: 3px;
}

.ps-field input.ps-error {
    border-color: #c00;
    background: #fff5f5;
}

.ps-field-error {
    color: #c00;
    font-size: 12px;
    margin-left: 96px;
}

.ps-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.ps-button {
    padding: 5px 12px;
    font-size: 13px;
    cursor: pointer;
    border: 1px solid #888;
    border-radius: 3px;
    background: #f0f0f0;
}

.ps-button:hover:not(:disabled) {
    background: #e0e0e0;
}

.ps-button--primary {
    background: #2c5aa0;
    color: #fff;
    border-color: #1d3f73;
}

.ps-button--primary:hover:not(:disabled) {
    background: #1d3f73;
}

.ps-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.ps-selected {
    padding: 8px 10px;
    background: #ffffd0;
    border: 1px solid #d4d495;
    border-radius: 3px;
    font-size: 13px;
    margin-bottom: 12px;
}

.ps-selected strong {
    color: #2c5aa0;
}

.ps-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 13px;
}

.ps-banner {
    padding: 6px 10px;
    margin-bottom: 8px;
    border-radius: 3px;
    font-size: 13px;
}

.ps-banner--info {
    background: #fff3cd;
    border: 1px solid #ffe08a;
    color: #6b5400;
}

.ps-banner--error {
    background: #ffe5e5;
    border: 1px solid #f5b8b8;
    color: #8a1a1a;
}

.ps-table-wrap {
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid #ccc;
    border-radius: 3px;
}

.ps-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.ps-table thead {
    position: sticky;
    top: 0;
    background: #e9eef5;
    z-index: 1;
}

.ps-table th {
    text-align: left;
    padding: 6px 8px;
    border-bottom: 1px solid #c7d2e3;
    cursor: pointer;
    user-select: none;
}

.ps-table th:hover {
    background: #d4dceb;
}

.ps-table td {
    padding: 5px 8px;
    border-bottom: 1px solid #eee;
}

.ps-table tbody tr {
    cursor: pointer;
}

.ps-table tbody tr:hover {
    background: #f5f9ff;
}

.ps-table tbody tr.ps-selected-row {
    background: #cce4ff !important;
}

.ps-empty {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}

/* Standalone view */
.ps-standalone .ps-overlay {
    position: static;
    background: transparent;
    padding: 20px;
}
