.expiry-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    gap: 0.4rem;
}

.expiry-badge.safe {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.expiry-badge.warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.expiry-badge.danger {
    background-color: #ffeeba;
    color: #856404;
    border: 1px solid #f6c23e;
}

.expiry-badge.expired {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.account-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.7rem;
    font-weight: 600;
    gap: 0.3rem;
}

.account-badge.active {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.account-badge.locked {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

#mysqlUsersTable_processing.dataTables_processing {
    display: none !important;
}

.dataTables_processing {
    z-index: 1000;
}

#mysqlUsersTable {
    width: 100% !important;
    table-layout: fixed;
}

#mysqlUsersTable th,
#mysqlUsersTable td {
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0.5rem 0.3rem;
    vertical-align: middle;
}

#mysqlUsersTable tbody tr:hover {
    background-color: #f8f9fc;
}

.column-filter {
    font-size: 0.875rem;
}

.form-label {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    color: #5a5c69;
}

.form-label i {
    color: #858796;
    width: 14px;
}

.btn-circle {
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 50%;
    font-size: 0.75rem;
    line-height: 28px;
}

.btn-circle:hover {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

#mysqlUserDetailsModal .modal-dialog {
    max-width: 1200px;
    display: flex;
    align-items: center;
    min-height: calc(100% - 1rem);
    margin: 0.5rem auto;
}

@media (min-width: 576px) {
    #mysqlUserDetailsModal .modal-dialog {
        min-height: calc(100% - 3.5rem);
        margin: 1.75rem auto;
    }
}

#mysqlUserDetailsModal .detail-info-item {
    padding: 0.5rem;
}

#mysqlUserDetailsModal .detail-info-grid {
    gap: 0.5rem;
}

#mysqlUserDetailsModal .detail-card-header {
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
}

#mysqlUserDetailsModal .user-detail-card {
    padding: 1rem;
}

#mysqlUserDetailsModal .modal-body {
    padding: 1rem;
}

#mysqlUserDetailsModal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom: none;
    padding: 1.5rem;
}

#mysqlUserDetailsModal .modal-header .modal-title {
    font-weight: 700;
    font-size: 1.25rem;
}

#mysqlUserDetailsModal .modal-header .close {
    color: white;
    opacity: 0.9;
    text-shadow: none;
    font-size: 1.75rem;
}

#mysqlUserDetailsModal .modal-header .close:hover {
    opacity: 1;
    color: white;
}

#mysqlUserDetailsModal .modal-body {
    padding: 1.5rem;
    background-color: #f8f9fc;
}

#mysqlUserDetailsModal .modal-footer {
    background-color: #f8f9fc;
    border-top: 1px solid #e3e6f0;
    padding: 1rem 1.5rem;
}

.user-detail-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.25rem;
    height: 100%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-left: 4px solid #4e73df;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.user-detail-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.user-detail-card.user-card {
    border-left-color: #4e73df;
}

.user-detail-card.database-card {
    border-left-color: #1cc88a;
}

.detail-card-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e3e6f0;
}

.detail-card-header-icon {
    width: 36px;
    height: 36px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

.detail-card-header-icon.user-icon {
    background: linear-gradient(135deg, #4e73df 0%, #224abe 100%);
    color: white;
}

.detail-card-header-icon.database-icon {
    background: linear-gradient(135deg, #1cc88a 0%, #17a673 100%);
    color: white;
}

.detail-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #5a5c69;
    margin: 0;
}

.detail-info-grid {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.detail-info-item {
    background: #f8f9fc;
    padding: 0.75rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s ease;
}

.detail-info-item:hover {
    background: #e9ecf4;
}

.detail-info-label {
    display: flex;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: #858796;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.4rem;
}

.detail-info-label i {
    margin-right: 0.4rem;
    color: #4e73df;
    font-size: 0.75rem;
}

.detail-info-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: #5a5c69;
    word-break: break-word;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.6rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    gap: 0.4rem;
}

.status-badge.vigente {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

.status-badge.por-vencer {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
}

.status-badge.critico {
    background: linear-gradient(135deg, #ffeeba 0%, #f6c23e 100%);
    color: #856404;
}

.status-badge.vencido {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
}

.host-port-badge {
    display: inline-block;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #5a5c69;
    background: #f8f9fc;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.breadcrumb {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.breadcrumb > div:first-child {
    display: flex;
    align-items: center;
}

.breadcrumb > div:last-child {
    display: flex;
    align-items: center;
    margin-left: auto;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-detail-card {
    animation: fadeInUp 0.3s ease;
}

.user-detail-card:nth-child(2) {
    animation-delay: 0.1s;
}

.user-detail-card.password-card {
    border-left-color: #f6c23e;
}

.user-detail-card.grants-card {
    border-left-color: #e74a3b;
}

.detail-card-header-icon.password-icon {
    background: linear-gradient(135deg, #f6c23e 0%, #dda20a 100%);
    color: white;
}

.detail-card-header-icon.grants-icon {
    background: linear-gradient(135deg, #e74a3b 0%, #be2617 100%);
    color: white;
}

.user-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

.user-type-badge.type-app {
    background-color: #cce5ff;
    color: #004085;
    border: 1px solid #b8daff;
}

.user-type-badge.type-inferred-app {
    background-color: #e7f1ff;
    color: #004085;
    border: 1px dashed #b8daff;
}

.user-type-badge.type-nominal {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.user-type-badge.type-inferred-nominal {
    background-color: #e8f5e9;
    color: #155724;
    border: 1px dashed #c3e6cb;
}

.user-type-badge.type-system {
    background-color: #e2e3e5;
    color: #383d41;
    border: 1px solid #d6d8db;
}

.user-type-badge.type-unknown {
    background-color: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.grant-option-icon {
    color: #f6c23e;
    font-size: 0.7rem;
    vertical-align: middle;
}

.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    color: white;
    z-index: 9999;
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.15);
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.3s ease;
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(0);
}

#editUserTypeModal .modal-header {
    color: #333;
}

#editUserTypeModal .modal-header .close {
    color: #333;
}

#editUserTypeModal .modal-dialog {
    max-width: 450px;
}

.user-type-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.user-type-option {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border: 2px solid #e3e6f0;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f8f9fc;
}

.user-type-option:hover {
    border-color: #4e73df;
    background: #fff;
}

.user-type-option.selected {
    border-color: #f6c23e;
    background: #fff8e1;
    box-shadow: 0 0 0 3px rgba(246, 194, 62, 0.2);
}

.user-type-option i {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #e3e6f0;
    color: #5a5c69;
    margin-right: 0.75rem;
    font-size: 0.9rem;
}

.user-type-option.selected i {
    background: #f6c23e;
    color: #fff;
}

.user-type-option span {
    font-weight: 600;
    color: #5a5c69;
}

.user-type-option.selected span {
    color: #333;
}

.action-btn-circle {
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    border-width: 1px;
}

.action-btn-circle:hover {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

.grants-list {
    overflow-y: auto;
    padding-right: 0.5rem;
}

#mysqlUserDetailsModal .row {
    display: flex;
    flex-wrap: wrap;
}

#mysqlUserDetailsModal .row > [class*="col-"] {
    display: flex;
}

#mysqlUserDetailsModal .user-detail-card {
    width: 100%;
    display: flex;
    flex-direction: column;
}

#mysqlUserDetailsModal .detail-info-grid {
    flex: 1;
}

#mysqlUserDetailsModal .grants-card .grants-list,
#mysqlUserDetailsModal .grants-card .text-muted {
    flex: 1;
}

.grants-showgrants {
    background: #f8f9fc;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e3e6f0;
}

.grant-statement {
    padding: 0.4rem 0;
    border-bottom: 1px solid #e3e6f0;
}

.grant-statement:last-child {
    border-bottom: none;
}

.grant-statement code {
    color: #5a5c69;
    font-size: 0.7rem;
    word-break: break-all;
    background: transparent;
    font-family: 'Courier New', monospace;
}

.grants-table-section {
    margin-top: 0.5rem;
}

.grants-table-header {
    font-size: 0.75rem;
    font-weight: 600;
    color: #5a5c69;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.grants-matrix {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.grants-matrix thead th {
    background: #f8f9fc;
    padding: 0.4rem 0.3rem;
    text-align: center;
    font-weight: 600;
    color: #5a5c69;
    border-bottom: 2px solid #e3e6f0;
}

.grants-matrix thead th:first-child {
    text-align: left;
    padding-left: 0.5rem;
}

.grants-matrix thead th.priv-col {
    width: 28px;
    font-size: 0.7rem;
}

.grants-matrix tbody tr {
    border-bottom: 1px solid #e3e6f0;
}

.grants-matrix tbody tr:hover {
    background: #f8f9fc;
}

.grants-matrix td {
    padding: 0.4rem 0.3rem;
    text-align: center;
    vertical-align: middle;
}

.grants-matrix td.table-name {
    text-align: left;
    padding-left: 0.5rem;
}

.grants-matrix td.table-name code {
    font-size: 0.7rem;
    background: #e9ecef;
    padding: 0.15rem 0.3rem;
    border-radius: 0.25rem;
}

.grants-matrix .priv-cell {
    width: 28px;
}

.grants-matrix .priv-cell.has-priv {
    color: #1cc88a;
}

.grants-matrix .priv-cell.has-priv i {
    font-size: 0.7rem;
}

.grants-matrix .priv-cell.no-priv {
    color: #e3e6f0;
}

.grants-matrix .other-privs .other-count {
    display: inline-block;
    background: #4e73df;
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    width: 16px;
    height: 16px;
    line-height: 16px;
    border-radius: 50%;
    text-align: center;
}

.grants-list::-webkit-scrollbar {
    width: 6px;
}

.grants-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.grants-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.grants-list::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

@media (max-width: 991px) {
    #mysqlUserDetailsModal .modal-dialog {
        max-width: 95%;
    }
}

@media (max-width: 767px) {
    #mysqlUserDetailsModal .col-md-6 {
        margin-bottom: 1rem;
    }
}

#mysqlUserDetailsContent .row {
    height: 520px;
    align-items: stretch;
}

#mysqlUserDetailsContent .row > [class*="col-"] {
    transition: flex 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                max-width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
}

#mysqlUserDetailsContent .user-detail-card {
    transition: padding 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s ease;
    overflow: hidden;
    height: 100%;
}

#mysqlUserDetailsContent .row.grants-expanded > [class*="col-"]:not(:last-child) {
    flex: 0 0 8%;
    max-width: 8%;
}

#mysqlUserDetailsContent .row.grants-expanded > [class*="col-"]:last-child {
    flex: 0 0 76%;
    max-width: 76%;
}

#mysqlUserDetailsContent .user-detail-card.collapsed {
    padding: 0.75rem 0.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

#mysqlUserDetailsContent .user-detail-card.collapsed .detail-card-header {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
    justify-content: center;
    flex-direction: column;
    align-items: center;
}

#mysqlUserDetailsContent .user-detail-card.collapsed .detail-card-title {
    opacity: 0;
    height: 0;
    overflow: hidden;
    margin: 0;
    transition: opacity 0.2s ease, height 0.2s ease;
}

#mysqlUserDetailsContent .user-detail-card.collapsed .detail-card-header-icon {
    margin-right: 0;
    margin-bottom: 0;
    transform: scale(1.1);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#mysqlUserDetailsContent .user-detail-card.collapsed .detail-info-grid {
    opacity: 0;
    height: 0;
    overflow: hidden;
    transition: opacity 0.2s ease;
}

#mysqlUserDetailsContent .grants-card {
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

#mysqlUserDetailsContent .grants-card .detail-card-header {
    flex-shrink: 0;
}

#mysqlUserDetailsContent .grants-card .grants-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

#mysqlUserDetailsContent .grants-card.expanded .grants-matrix {
    font-size: 0.85rem;
}

#mysqlUserDetailsContent .grants-card.expanded .grants-matrix thead th.priv-col {
    width: auto;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    transition: all 0.3s ease;
}

#mysqlUserDetailsContent .grants-card.expanded .grants-matrix td.table-name {
    max-width: none;
    overflow: visible;
}

#mysqlUserDetailsContent .grants-card.expanded .grants-matrix td.table-name code {
    max-width: none;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    font-size: 0.8rem;
    display: inline-block;
}

#mysqlUserDetailsContent .grants-card.expanded .grants-matrix td {
    padding: 0.5rem 0.75rem;
}

#mysqlUserDetailsContent .grants-card.expanded .grants-showgrants {
    font-size: 0.8rem;
}

#mysqlUserDetailsContent .grants-card.expanded .grant-statement code {
    font-size: 0.8rem;
}

#mysqlUserDetailsContent .grants-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

#mysqlUserDetailsContent .grants-card::after {
    content: '\f065';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    font-size: 0.7rem;
    color: #858796;
    opacity: 0.4;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#mysqlUserDetailsContent .grants-card.expanded::after {
    content: '\f066';
    opacity: 0.7;
}

#mysqlUserDetailsContent .grants-card:hover::after {
    opacity: 1;
    transform: scale(1.1);
}

.server-link {
    opacity: 0.4;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.server-link:hover {
    opacity: 1;
    color: #4e73df !important;
}

/* ===== Botón de la cabecera degradada (Exportar CSV) ===== */
.card-header .header-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.card-header .header-btn i { font-size: 0.7rem; }
.card-header .header-btn:hover:not(:disabled),
.card-header .header-btn:focus-visible {
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.2);
    outline: none;
}
.card-header .header-btn:disabled { opacity: 0.7; cursor: wait; transform: none; }

/* Los dropdowns deben quedar por encima de la tabla */
.mysql-filters .pki-select-panel { z-index: 1030; }

/* ============================================================
   PkiSelect · dropdown propio (js/pki-select.js), copiado del
   formulario de nuevo certificado para los filtros de esta página (igual que en VMs).
   ============================================================ */
.pki-select {
    --pki-primary: #667eea;
    --pki-text: #3a3b45;
    --pki-muted: #858796;
    --pki-border: #e3e6f0;
    --pki-bg-soft: #f8f9fc;
}

.pki-select { position: relative; width: 100%; }

.pki-select-native {
    position: absolute !important;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    /* !important: Bootstrap pone opacity:1 en .form-control:disabled */
    opacity: 0 !important;
    z-index: -1;
    pointer-events: none;
}

.pki-select-btn {
    width: 100%;
    height: 2.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.9rem;
    border: 1px solid #d9dde9;
    border-radius: 0.5rem;
    background: #fff;
    color: var(--pki-text);
    font: inherit;
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pki-select-btn:hover:not(:disabled) { border-color: #b9c1e0; }

.pki-select-btn:focus-visible,
.pki-select.is-open .pki-select-btn {
    outline: none;
    border-color: var(--pki-primary);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.18);
}

.pki-select-value {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pki-select-value.is-placeholder { color: #a9adbf; }

.pki-select-caret {
    flex: 0 0 auto;
    color: var(--pki-primary);
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.pki-select.is-open .pki-select-caret { transform: rotate(180deg); }

.pki-select.is-locked .pki-select-btn {
    background: #eef1f8;
    border-color: transparent;
    color: #5a5c69;
    cursor: not-allowed;
}

.pki-select.is-locked .pki-select-caret { color: #a9adbf; transform: none; }

.pki-select.is-invalid .pki-select-btn { border-color: #e74a3b; }
.pki-select.is-invalid .pki-select-caret { color: #e74a3b; }
.pki-select.is-invalid ~ .invalid-feedback { display: block; }

.pki-select-panel {
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    min-width: 100%;
    max-width: min(32rem, 90vw);
    z-index: 1050;
    padding: 0.35rem;
    border: 1px solid var(--pki-border);
    border-radius: 0.6rem;
    background: #fff;
    box-shadow: 0 0.75rem 2rem rgba(34, 74, 190, 0.18), 0 0.15rem 0.4rem rgba(0, 0, 0, 0.05);
    animation: pki-select-in 0.14s ease-out;
}

.pki-select.drop-up .pki-select-panel { top: auto; bottom: calc(100% + 0.35rem); }

@keyframes pki-select-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.pki-select-panel[hidden] { display: none; }

.pki-select-search {
    position: relative;
    margin-bottom: 0.35rem;
}

.pki-select-search[hidden] { display: none; }

.pki-select-search i {
    position: absolute;
    left: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    color: #a9adbf;
    font-size: 0.75rem;
}

.pki-select-search input {
    width: 100%;
    height: 2.2rem;
    padding: 0 0.7rem 0 2rem;
    border: 1px solid var(--pki-border);
    border-radius: 0.4rem;
    background: var(--pki-bg-soft);
    font-size: 0.82rem;
    color: var(--pki-text);
}

.pki-select-search input:focus { outline: none; border-color: var(--pki-primary); background: #fff; }

.pki-select-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 16rem;
    overflow-y: auto;
    outline: none;
}

.pki-select-option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.7rem;
    border-radius: 0.4rem;
    font-size: 0.86rem;
    color: var(--pki-text);
    cursor: pointer;
    user-select: none;
}

.pki-select-option + .pki-select-option { margin-top: 1px; }
.pki-select-option.is-active { background: #f1f3fd; }
.pki-select-option.is-selected { color: var(--pki-primary); font-weight: 700; }
.pki-select-option.is-disabled { opacity: 0.45; cursor: not-allowed; }

.pki-select-option-label { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }

.pki-select-tick {
    flex: 0 0 auto;
    font-size: 0.7rem;
    color: var(--pki-primary);
    visibility: hidden;
}

.pki-select-option.is-selected .pki-select-tick { visibility: visible; }

.pki-select-empty {
    padding: 0.75rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--pki-muted);
}

.pki-select-empty[hidden] { display: none; }

/* Variante pequeña: selects con .form-control-sm */
.pki-select-sm .pki-select-btn {
    height: calc(1.5em + 0.5rem + 2px);
    padding: 0 0.65rem;
    font-size: 0.82rem;
    border-radius: 0.4rem;
}

@media (prefers-reduced-motion: reduce) {
    .pki-select-btn, .pki-select-caret { transition: none; }
    .pki-select-panel { animation: none; }
}
