.formulario-fotografia-flex {
    display: flex;
}

.fotografia-flex-1 {
    flex: 1;
}

.datos-fotografia {
    flex: 3;
}

.campo-100 {
    width: 100%;
}

.datos-fotografia-flex {
    display: flex;
    justify-content: space-between;
}

.formulario-fotografia-flex {
    display: flex;
}

.datos-fotografia {
    flex: 3;
}

.campo-100 {
    width: 100%;
}

.datos-fotografia-flex {
    display: flex;
    justify-content: space-between;
}

.expediente-card {
    margin-bottom: 1rem;
}

.expediente-card legend {
    color: #1A2C5B;
    font-size: 20px;
    font-weight: 700;
}

.expediente-card fieldset {
    width: 100%;
    border: 1px solid #1A2C5B;
    box-shadow: 0 0 16px -2px var(--shadow-color);;
}
.card-formulario-expediente {
    border: 1px solid #1A2C5B;
    box-shadow: 0 0 16px -2px var(--shadow-color);
}
.card-formulario-expediente 
input,
select {
    border: 1px solid #1A2C5B;
} 
.select2-container 
.select2-selection--single {
    height: 46px !important;
}
.select2-container--default 
.select2-selection--single{
    border: 1px solid #1A2C5B !important;
}
.select2-container--default 
.select2-selection--single 
.select2-selection__rendered {
    line-height: 44px !important;
    font-size: 20px;
    font-weight: 500;
    color: #1A2C5B !important;
}
.select2-container--default 
.select2-selection--single 
.select2-selection__arrow {
    height: 46px !important;
}
.select2-container--default 
.select2-selection--single 
.select2-selection__arrow b {
    border-color: #1A2C5B transparent transparent transparent !important;
}
.select2-dropdown {
    border: 1px solid #1A2C5B !important;
}
.select2-container--default 
.select2-search--dropdown 
.select2-search__field {
    border: 1px solid #1A2C5B !important;
}
.select2-container--default 
.select2-results__option--highlighted.select2-results__option--selectable {
    background-color: #1A2C5B !important;
    font-weight: 500;
}
.select2-results__option--selectable {
    color: #1A2C5B;
}

/* El bloque de la foto */
.form-g.fotografia-flex-1:has(#photo) {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Ocultar el input file nativo */
input[type="file"]#photo {
    display: none;
}

/* El label que actúa como botón de subida */
label[for="photo"] {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(26, 44, 91, 0.06);
    border: 2px dashed rgba(26, 44, 91, 0.3);
    cursor: pointer;
    color: rgba(26, 44, 91, 0.5);
    font-size: 11px;
    text-align: center;
    transition: border-color 0.2s, background 0.2s;
}

label[for="photo"]:hover {
    border-color: #1A2C5B;
    background: rgba(26, 44, 91, 0.1);
}

label[for="photo"] i.fa-upload {
    font-size: 22px;
    margin-bottom: 6px;
    color: #1A2C5B;
}

/* Preview de la foto cuando ya existe */
.photo_preview img,
.photo_preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    overflow: hidden;
}

/* Ocultar el input nativo */
input#photo {
    display: none;
}

/* El círculo */
label#photo-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: rgba(26, 44, 91, 0.06);
    border: 2px dashed rgba(26, 44, 91, 0.35);
    cursor: pointer;
    color: rgba(26, 44, 91, 0.5);
    font-size: 11px;
    text-align: center;
    gap: 6px;
    overflow: hidden;
    /* para que la foto no se salga del círculo */
    transition: border-color 0.2s, background 0.2s;
}

label#photo-label:hover {
    border-color: #1A2C5B;
    background: rgba(26, 44, 91, 0.12);
}

label#photo-label i {
    font-size: 26px;
    color: #1A2C5B;
}

/* Foto ya guardada dentro del círculo */
label#photo-label img {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: 50%;
}


/* ── PERFIL HERO ── */
.profile-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 36px 24px 28px;
    margin-bottom: 12px;
    background: #1A2C5B;
    border-radius: 22px;
    position: relative;
    overflow: visible;
    box-shadow: 0 0 16px -2px #000;
}

.profile-hero::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    pointer-events: none;
}

.profile-hero::after {
    content: '';
    position: absolute;
    bottom: -40px;
    left: -40px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    pointer-events: none;
}

/* ── AVATAR ── */
.avatar-wrap {
    position: relative;
    margin-bottom: 14px;
    z-index: 10;
}

.avatar-circle {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    border: 2.5px solid rgba(255, 255, 255, 0.25);
    transition: background 0.2s;
    user-select: none;
}

.avatar-circle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.avatar-circle svg {
    width: 28px;
    height: 28px;
    fill: rgba(255, 255, 255, 0.5);
}

.avatar-circle img {
    width: 88px;
    height: 88px;
    object-fit: cover;
    border-radius: 50%;
}

/* ── POPOVER ── */
.popover {
    display: none;
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22), 0 2px 8px rgba(0, 0, 0, 0.1);
    min-width: 210px;
    z-index: 100;
}

.popover.open {
    display: block;
}

.popover::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 7px solid rgba(255, 255, 255, 0.97);
}

.pop-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    cursor: pointer;
    transition: background 0.12s;
}

.pop-item:not(:last-child) {
    border-bottom: 0.5px solid rgba(26, 44, 91, 0.07);
}

.pop-item:hover {
    background: rgba(26, 44, 91, 0.05);
}

.pop-item svg {
    width: 17px;
    height: 17px;
    fill: #1A2C5B;
    flex-shrink: 0;
}

.pop-item span {
    font-size: 14px;
    font-weight: 500;
    color: #1A2C5B;
}

/* Inputs ocultos */
#photo-file,
#photo-camera {
    display: none;
}

/* ── NOMBRE Y SUB ── */
.profile-name {
    font-size: 22px;
    font-weight: 600;
    color: #fff;
    letter-spacing: -0.3px;
    margin-bottom: 4px;
    text-align: center;
    z-index: 1;
}

.profile-sub {
    font-size: 13px;
    color: #FFF;
    font-weight: 400;
    text-align: center;
    z-index: 1;
}