/* Shared registry dialog: isolate scrolling from the title and explicit actions,
   including when opened from another module's dialog. */
.central-patient-create-overlay {
    /* A containing form grid must not turn this full-screen layer into a
       start-aligned grid item when the registry dialog is nested. */
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
}
.central-patient-create-overlay > .central-patient-create-modal {
    display: flex !important;
    flex-direction: column;
    width: min(92vw, 760px);
    max-height: calc(100dvh - 2rem) !important;
    min-height: 0;
    margin: auto !important;
    padding: 0 !important;
    overflow: hidden !important;
}
.central-patient-create-modal > .perm-modal-head {
    position: relative !important;
    top: auto !important;
    flex: 0 0 auto;
    margin: 0 !important;
    padding: 1rem !important;
    background: #fff;
    z-index: 2;
}
.central-patient-create-modal .central-patient-close {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex: 0 0 2.5rem;
    width: 2.5rem;
    min-height: 2.5rem;
    padding: 0;
}
.central-patient-create-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 1rem;
    -webkit-overflow-scrolling: touch;
}
.central-patient-create-modal > .perm-actions {
    position: relative;
    flex: 0 0 auto;
    margin: 0 !important;
    padding: .85rem 1rem;
    border-top: 1px solid var(--lab-border, #ffe4e6);
    background: #fff;
    z-index: 2;
}
.central-patient-create-modal .card-title { min-width: 0; }
.central-patient-create-body .form-label { display: block; margin-bottom: .4rem; }
@media (max-width: 480px) {
    .central-patient-create-modal > .perm-modal-head { gap: .6rem; }
    .central-patient-create-modal > .perm-modal-head .card-title { font-size: .88rem; line-height: 1.4; }
    .central-patient-create-modal > .perm-actions { gap: .6rem; }
    .central-patient-create-modal > .perm-actions .btn { flex: 1 1 auto; justify-content: center; }
}
.central-patient-editor{display:flex!important;flex-direction:column;max-height:calc(100vh - 2rem);max-height:calc(100dvh - 2rem);padding:0!important;overflow:hidden!important}
.central-patient-editor>.perm-modal-head{flex:0 0 auto;margin:0;padding:16px;background:#fff;border-bottom:1px solid #ffcbd0;gap:12px}
.central-patient-editor>.perm-modal-head .card-title{min-width:0;flex:1;white-space:nowrap;font-size:clamp(.85rem,2.8vw,1rem)}
.central-patient-editor>.perm-modal-head .perm-modal-close{flex:0 0 36px;width:36px;height:36px;padding:0;display:inline-flex;align-items:center;justify-content:center}
.central-patient-editor-body{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:16px}
.central-patient-editor .entity-form-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
.central-patient-editor .central-patient-editor-body .form-label{display:block;margin:0 0 6px;line-height:1.4}
.general-administration-page{grid-template-columns:minmax(0,1fr)}
.general-administration-page .general-patient-record{min-width:0;grid-template-columns:minmax(0,1fr)}
.general-administration-page .general-patient-record-header{flex-wrap:wrap;min-width:0;grid-template-columns:minmax(0,1fr)}
.general-administration-page .general-patient-record-header>.general-patient-heading{display:flex;flex:0 1 auto;width:max-content;flex-direction:row;align-items:center;justify-content:space-between;flex-wrap:nowrap;gap:12px;min-width:0;max-width:100%;overflow:visible}
.general-administration-page .general-patient-heading-title{flex:1 1 auto;flex-wrap:nowrap;white-space:nowrap}
.general-administration-page .general-patient-heading-title>span{flex-shrink:0}
.general-administration-page .general-patient-heading-title strong{flex:0 1 auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;overflow-wrap:normal;word-break:normal}
.general-administration-page .general-patient-identity{flex:0 0 auto;flex-direction:row;flex-wrap:nowrap;white-space:nowrap}
@media(max-width:480px){.general-administration-page .general-patient-heading-title>span:not(.card-dot){display:none}}
.central-patient-editor>.perm-actions{flex:0 0 auto;display:flex;gap:10px;margin:0;padding:14px 16px;background:#fff;border-top:1px solid #ffcbd0}
.central-patient-edit-error{padding:10px 12px;margin-bottom:12px;border:1px solid #ffc4cc;border-radius:12px;background:#fff3f4;color:#9e1524;white-space:normal}
.central-relative-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.central-relative-actions>.btn{width:auto!important}
.general-relatives-panel>header{gap:12px;flex-wrap:wrap}
.central-relative-fields{display:grid;gap:14px}
.general-relatives-table th,.general-relatives-table td{width:auto!important}
@media(max-width:640px){.general-relatives-table-wrap{overflow:visible}.general-relatives-table,.general-relatives-table tbody{display:block;width:100%;min-width:0}.general-relatives-table thead{display:none}.general-relatives-table tr{display:grid;grid-template-columns:minmax(0,1fr);gap:10px;padding:14px;border:1px solid #ffe4e6;border-radius:12px;margin-bottom:12px}.general-relatives-table td{display:flex;width:100%!important;align-items:center;justify-content:space-between;gap:12px;border:0;min-width:0;overflow-wrap:anywhere}.general-relatives-table td::before{content:attr(data-label);flex:0 0 auto;font-size:.78rem;color:#64748b}.general-relatives-table td .btn{width:auto!important;white-space:nowrap}}
@media(max-width:600px){.central-patient-editor .entity-form-grid{grid-template-columns:minmax(0,1fr)!important}.central-patient-editor>.perm-actions>.btn{flex:1;min-width:0}.central-patient-editor-body{padding:14px}}
