/* COFRE */
.credenciais-table table {
    display: table;
    border-collapse: collapse;
}

.credenciais-table table thead {
    display: table-header-group;
}

.credenciais-table table tr {
    display: table-row;
}

.credenciais-table tbody tr td {
    display: table-cell;
    vertical-align: middle;
}

.credenciais-table table.responsive td:nth-child(even),
.credenciais-table table.responsive td:nth-child(odd) {
    display: table-cell;
    position: static;
    padding-left: 0;
    white-space: nowrap;
    text-align: center;
    align-content: center;
}

.credenciais-table table.responsive td:nth-child(even)::before,
.credenciais-table table.responsive td:nth-child(odd)::before {
    display: none;
}

.credenciais-table .chip-clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.credenciais-table .chip-clickable:hover {
    transform: scale(1.05);
    filter: brightness(0.95);
}

.credenciais-table .chip-gray {
    opacity: 0.7;
}

.modal-otp-config .md-dialog-content {
    height: 100%;
    overflow-y: auto;
    overflow-x: auto;
}

#app-tabs,
#app-tabs md-tabs-content-wrapper,
#app-tabs md-tab-content {
    height: 100%;
}

@media (max-width: 640px) {
    .modal-otp-config {
        min-width: 0 !important;
        width: 100vw !important;
    }
}

@media (min-width: 2399px) {
    .tab-container.tab-lista .credenciais-table {
        max-height: 60vh !important;
        overflow-y: auto;
    }
}

/* Estilos para alinhar o botão com as abas */
.tela-credenciais-loy .tabs-wrapper {
    position: relative;
    border: 1px solid #d1d9e2;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 10px;
}

.tela-credenciais-loy .btn-side {
    position: absolute;
    right: 15px;
    top: 10px;
    z-index: 10;
    margin: 0 !important;
    text-transform: none !important;
    font-weight: 600 !important;
    border-radius: 10px !important;
    height: 45px !important;
    box-shadow: none !important;
    background-color: #3192eb !important;
    padding: 0 20px !important;
}

.tela-credenciais-loy #app-tabs md-tabs-wrapper {
    background-color: #f8fafc;
    border-bottom: 1px solid #d1d9e2;
    height: 65px;
}

.tela-credenciais-loy #app-tabs md-pagination-wrapper {
    height: 65px;
    display: flex;
    align-items: center;
    padding-right: 250px;
}

.tela-credenciais-loy #app-tabs md-tab-item {
    font-size: 15px !important;
    font-weight: 600 !important;
    text-transform: none !important;
    color: #64748b !important;
    padding: 12px 24px !important;
}

.tela-credenciais-loy #app-tabs md-tab-item.md-active {
    color: #3192eb !important;
}

.tela-credenciais-loy #app-tabs md-ink-bar {
    height: 3px;
    background-color: #3192eb !important;
}

.tela-credenciais-loy #app-tabs md-tabs-content-wrapper {
    background-color: white;
}

.tela-credenciais-loy #app-tabs md-tab-content {
    opacity: 0;
    /* transition: opacity 0.2s ease, transform 0.2s ease; */
}

.tela-credenciais-loy #app-tabs md-tab-content.md-active {
    opacity: 1;
}

/* Ajuste dos Chips */
.credenciais-table .chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto !important;
    min-width: 130px;
    height: 28px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid transparent;
    background: transparent;
    cursor: default;
    padding: 0 12px;
}

.credenciais-table .chip-content {
    display: flex;
    align-items: center;
    /* justify-content: center; */
    gap: 6px;
    width: 100%;
}

.credenciais-table .chip img {
    width: 14px;
    height: 14px;
    margin-left: 16px !important;
    flex-shrink: 0;
}

.credenciais-table .chip-text {
    flex: 0.85;
    margin-top: 1%;
    text-align: center;
    white-space: nowrap;
}

.credenciais-table .chip-green {
    background: #e6f4ea !important;
    color: #1e7e34 !important;
    border-color: #1e7e34 !important;
}

.credenciais-table .chip-orange {
    background: #fff3cd !important;
    color: #856404 !important;
    border-color: #856404 !important;
}

.credenciais-table .chip-gray {
    background: #e8f0fe !important;
    color: #1967d2 !important;
    border-color: #1967d2 !important;
}

.credenciais-table .chip-clickable {
    cursor: pointer;
}

.credenciais-table .chip:hover {
    transform: none !important;
    filter: brightness(0.95);
}

.credenciais-table td {
    position: relative;
}

.modal-otp-config form-field input,
.modal-otp-config form-field .md-input {
    height: 48px;
    border-radius: 10px;
    border: 1px solid #b0c4de;
    padding: 0 16px;
    font-size: 14px;
}

.modal-otp-config .md-input-container {
    margin: 0;
}

.modal-otp-config .md-input {
    border-bottom: none !important;
}

.modal-otp-config .field-row {
    width: 100%;
}

.modal-otp-config .field-row form-field {
    width: 100%;
}

.modal-otp-config .botoes {
    height: 48px;
    padding: 0 20px;
    border-radius: 8px;
    text-transform: none;
    font-weight: 500;
}

/* Modal Credenciais */

.select-placeholder-crendenciais select {
    color: #777;
}

.select-placeholder-crendenciais select:focus {
    color: #000;
}

.select-placeholder-crendenciais select:valid {
    color: #000;
}

.select-placeholder-crendenciais select option[value=""] {
    display: none;
}

.password-field {
    position: relative;
}

.password-field .toggle-password {
    position: absolute;
    right: 18px;
    top: 38px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.password-field .toggle-password img {
    width: 18px;
    opacity: 0.7;
}

.password-field .toggle-password:hover img {
    opacity: 1;
}

/* Modal Certificado */

.upload-certificado {
    border: 1px solid #ABBED1;
    border-radius: 8px;
    border-width: 1px;
    border-style: dashed;
    box-shadow: 0px 4px 4px 0px #00000040;
    background: white;
    margin: 10px;
    min-width: 100px;
    max-width: 500px;
    height: 140px;
    cursor: pointer;

    background-image: url('../images/icons/integracoes/sendDocument.svg');
    background-repeat: no-repeat;
    background-position: center 35%;
    background-size: 50px;

    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;

    position: relative;
}

.upload-certificado .texto-upload-certificado {
    margin-top: 60px;
    font-size: 14px;
    color: #212121 !important;
}

.upload-certificado input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.dialog-credenciais label {
    font-family: "Inter", sans-serif;
    font-weight: 500;
    font-size: 12px !important;
    line-height: 16px;
    letter-spacing: 0;
    color: #212121 !important;
}

.arquivo-certificado {
    border: 1px dashed #cfcfcf;
    border-radius: 6px;
    padding: 8px 12px;
    margin: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.arquivo-esquerda {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icone-arquivo {
    width: 18px;
    height: 18px;
}

.lado-direito {
    display: flex;
    align-items: center;
    gap: 10px;
}

.remover-arquivo {
    cursor: pointer;
    color: #888;
    font-weight: bold;
}

.nome-arquivo-credencial {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Modal QR CODE/BASE32 - NOVO DESIGN (LIGHT STYLE) */

.modal-otp-modern {
    background-color: #ffffff !important;
    color: #334155 !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1) !important;
}

.modal-otp-modern md-toolbar {
    background-color: #3192eb !important;
    /* Cor padrão do sistema */
    min-height: 80px !important;
    padding: 10px 24px 0 !important;
    color: white !important;
}

/* .modal-otp-modern .md-toolbar-tools {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0 !important;
} */

/* .otp-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: white !important;
} */

/* .otp-header-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8) !important;
    margin-top: 4px;
} */

.otp-tabs-container {
    display: flex;
    background-color: #f1f5f9;
    border-radius: 10px;
    padding: 4px;
    margin: 20px 24px;
    gap: 4px;
}

.otp-tab-btn {
    flex: 1;
    height: 40px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #64748b;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.otp-tab-btn.active {
    background-color: #ffffff;
    color: #3192eb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.otp-content-card {
    background-color: #f8fafc;
    border-radius: 12px;
    margin: 0 24px 24px;
    padding: 24px;
    /* Reduzido de 32px para expandir conteúdo */
    height: 400px;
    /* Expandido para acomodar melhor a câmera e manter estabilidade */
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.otp-content-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #1e293b;
}

.otp-content-subtitle {
    font-size: 14px;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 20px;
    /* Reduzido para dar mais espaço à câmera */
}

.otp-actions-row {
    display: flex;
    gap: 16px;
    flex: 1;
    align-items: center;
    /* Centraliza verticalmente os botões de ação */
    margin-bottom: 20px;
}

.otp-action-card {
    flex: 1;
    height: 120px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #ffffff;
    padding: 0 !important;
}

.otp-action-card:hover {
    border-color: #3192eb;
    background-color: #f0f9ff;
}

.otp-action-card md-icon {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    color: #334155 !important;
    margin: 0 !important;
}

.otp-action-card span {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    margin: 0 !important;
}

.otp-manual-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
    justify-content: center;
    /* Centraliza verticalmente o conteúdo manual */
    margin-bottom: 20px;
}

.otp-manual-input-wrapper {
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 4px 16px;
}

.otp-manual-input-wrapper input {
    background: transparent !important;
    border: none !important;
    color: #1e293b !important;
    font-family: monospace;
    font-size: 18px !important;
    letter-spacing: 1px;
}

.modal-otp-modern .md-dialog-actions {
    padding: 0 24px 24px !important;
    background: transparent !important;
}

.btn-cancelar-otp {
    color: #64748b !important;
    background-color: #f1f5f9 !important;
    border-radius: 8px !important;
    text-transform: none !important;
    font-weight: 600 !important;
    padding: 0 24px !important;
}

.btn-salvar-otp {
    background-color: #3192eb !important;
    color: #ffffff !important;
    border-radius: 8px !important;
    text-transform: none !important;
    font-weight: 700 !important;
    padding: 0 24px !important;
}

/* Esconder input de arquivo padrão */
.input-file-hidden {
    display: none;
}

/* Ajuste do vídeo na nova estrutura */
.otp-video-container {
    position: relative;
    width: 100%;
    height: 100%;
    /* Expande para preencher o espaço disponível no flex */
    min-height: 235px;
    border-radius: 12px;
    overflow: hidden;
    background-color: #000;
    margin-bottom: 10px;
    flex: 1;
    /* Faz o container da câmera crescer no espaço flexível do card */
}

.otp-video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: contrast(1.2) brightness(1.1);
    /* Removido grayscale e suavizado contraste */
}

.otp-video-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200px;
    /* Um pouco maior para um visual expandido */
    height: 200px;
    transform: translate(-50%, -50%);
    border: 2px solid #3192eb;
    border-radius: 12px;
    box-shadow: 0 0 0 4000px rgba(0, 0, 0, 0.4);
}

/* --- Estilização Moderna dos Botões de Ação --- */

.tela-credenciais-loy .md-icon-button {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    opacity: 1 !important;
}

.tela-credenciais-loy .md-icon-button:hover {
    transform: scale(1.15);
}

/* Hover Editar (Cor de Lápis/Azul Ativo) */
.tela-credenciais-loy .icon-editAtt:hover:not(:disabled) {
    background-color: rgba(49, 146, 235, 0.1) !important;
    /* Filtro para converter o ícone para #3192eb (Azul Meridio) */
    filter: invert(48%) sepia(79%) saturate(2476%) hue-rotate(186deg) brightness(97%) contrast(92%) !important;
}

/* Hover Excluir (Lixeira Vermelha) */
.tela-credenciais-loy .icon-bin:hover:not(:disabled) {
    background-color: rgba(229, 57, 53, 0.1) !important;
    /* Filtro para converter o ícone para um Vermelho Vibrante (#e53935) */
    filter: invert(27%) sepia(91%) saturate(7152%) hue-rotate(352deg) brightness(95%) contrast(114%) !important;
}

.tela-credenciais-loy .certificado-section .md-icon-button.icon-bin {
    filter: brightness(0) invert(1);
}

/* Ajustes para quando o item está selecionado (Fundo Azul da Linha) */
.tela-credenciais-loy tr.selected .md-icon-button {
    filter: brightness(0) invert(1) !important;
}

.tela-credenciais-loy tr.selected .md-icon-button:hover {
    background-color: rgba(255, 255, 255, 0.25) !important;
    filter: brightness(0) invert(1) !important;
}

.tela-credenciais-loy .certificado-section .certificado-alert-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0 5px;
    padding: 8px 12px;
    border-radius: 8px;
    background-color: #fef3c7;
    color: #92400e;
    font-size: 13px;
    font-weight: 500;
}

.tela-credenciais-loy .certificado-section .certificado-alert-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #f97316;
    position: relative;
}

.tela-credenciais-loy .certificado-section .certificado-alert-icon::before {
    content: "!";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}

.tela-credenciais-loy .certificado-section .certificado-alert-text {
    flex: 1;
}

.tela-credenciais-loy .certificado-section .certificado-nome {
    display: inline-block;
    max-width: 280px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.tela-credenciais-loy .certificado-section .certificado-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background-color: #fee2e2;
    color: #b91c1c;
}

.tela-credenciais-loy .certificado-section .certificado-validade {
    font-weight: 500;
}

.tela-credenciais-loy .certificado-section .certificado-validade-expirada {
    color: #b91c1c;
}

.tela-credenciais-loy .certificado-section tr.certificado-expirado-row {
    background-color: #feecec;
}

.tela-credenciais-loy .certificado-section tr.certificado-expirado-row td {
    color: #1f2933;
    border-top: 1px solid #fed7d7;
    border-bottom: 1px solid #fed7d7;
}

.tela-credenciais-loy .certificado-section tr.certificado-expirado-row.selected,
.tela-credenciais-loy .certificado-section tr.certificado-expirado-row.selected td {
    background-color: #fee2e2;
    color: #1f2933 !important;
}

.tela-credenciais-loy .certificado-section tr.certificado-expirado-row .md-icon-button.icon-bin {
    filter: none !important;
}

.tela-credenciais-loy .certificado-section tr.certificado-expirado-row.selected .md-icon-button.icon-bin {
    filter: none !important;
}
