/* Bitrix24 Native Look & Feel */
body {
    font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 13px;
    color: #535c69;
    background-color: #fff;
    margin: 0;
    padding: 20px;
}

h1,
h2,
h3 {
    font-weight: 400;
    margin-bottom: 20px;
}

.ui-btn {
    display: inline-block;
    height: 39px;
    line-height: 39px;
    padding: 0 25px;
    background-color: #bbed21;
    color: #535c69;
    font-weight: bold;
    text-transform: uppercase;
    text-decoration: none;
    border: none;
    cursor: pointer;
    border-radius: 2px;
    transition: background-color 0.2s;
}

.ui-btn:hover {
    background-color: #d2f95f;
}

.ui-btn-primary {
    background-color: #3bc8f5;
    color: #fff;
}

.ui-btn-primary:hover {
    background-color: #3fd5ff;
}

.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-control {
    width: 100%;
    height: 39px;
    padding: 0 10px;
    border: 1px solid #c6cdd3;
    border-radius: 2px;
    box-sizing: border-box;
    font-family: inherit;
}

.card {
    border: 1px solid #eef2f4;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 2px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    text-align: left;
    padding: 10px;
    border-bottom: 1px solid #eef2f4;
}

.data-table th {
    color: #a0a0a0;
    font-weight: normal;
}

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert-success {
    color: #3c763d;
    background-color: #dff0d8;
    border-color: #d6e9c6;
}

.alert-danger {
    color: #a94442;
    background-color: #f2dede;
    border-color: #ebccd1;
}

/* ============================================
   UTILITIES - Convertidos de inline styles
   ============================================ */

/* Display */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }

/* Margins */
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }

.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }

.ms-2 { margin-left: 0.5rem !important; }
.me-1 { margin-right: 0.25rem !important; }
.me-2 { margin-right: 0.5rem !important; }

/* Flex utilities */
.flex-1 { flex: 1 !important; }
.gap-3 { gap: 0.75rem !important; }
.gap-10 { gap: 10px !important; }

/* Width */
.w-20 { width: 20px !important; }

/* Typography */
.fw-bold { font-weight: bold !important; }
.text-muted { color: #666 !important; }
.text-xs { font-size: 0.75rem !important; }
.text-sm { font-size: 0.875rem !important; }
.text-center { text-align: center !important; }

/* Cursor */
.cursor-pointer { cursor: pointer !important; }

/* Backgrounds */
.bg-light { background-color: #f5f5f5 !important; }

/* Borders */
.rounded { border-radius: 4px !important; }

/* Padding */
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 1rem !important; }

/* ============================================
   COMPONENTES ESPECÍFICOS
   ============================================ */

/* Mapping rows (usado em configurações) */
.mapping-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.mapping-row-header {
    display: flex;
    gap: 10px;
    margin-bottom: 5px;
    font-weight: bold;
    color: #666;
}

/* Checkbox label */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

/* Install log */
.install-log {
    font-family: monospace;
    background: #f5f5f5;
    padding: 10px;
    border-radius: 4px;
    max-height: 300px;
    overflow-y: auto;
}

/* Access denied page */
.access-denied {
    text-align: center;
    padding: 50px 20px;
    max-width: 500px;
    margin: 0 auto;
}

.access-denied h1 {
    color: #dc3545;
    margin-bottom: 20px;
}

.access-denied p {
    color: #666;
    font-size: 16px;
    line-height: 1.6;
}

.access-denied .icon {
    font-size: 64px;
    margin-bottom: 20px;
}

/* Alert variations */
.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

/* Summary table */
.summary-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.summary-table th,
.summary-table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

/* ============================================
   ESTILOS PARA PAGAMENTO STRIPE
   Adicionado em: 2026-02-19
   ============================================ */

/* Notificação flutuante de pagamento */
#payment-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    padding: 15px 25px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideDown 0.3s ease;
    max-width: 90%;
    word-wrap: break-word;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Botões desabilitados durante processamento */
button:disabled,
.ui-btn:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    pointer-events: none;
}

/* Spinner de carregamento */
.fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Button group de seleção de visualização */
.company-view-btn-group {
    display: inline-flex;
    border: 2px solid #3bc8f5;
    border-radius: 4px;
    overflow: hidden;
}

.company-view-btn-group .view-btn {
    padding: 5px 16px;
    font-size: 13px;
    font-weight: 600;
    background: #fff;
    color: #3bc8f5;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
    line-height: 1.4;
}

.company-view-btn-group .view-btn + .view-btn {
    border-left: 2px solid #3bc8f5;
}

.company-view-btn-group .view-btn:hover:not(.active) {
    background: #e8f9fe;
}

.company-view-btn-group .view-btn.active {
    background: #3bc8f5;
    color: #fff;
    opacity: 1 !important;
    pointer-events: none;
    cursor: default;
}

/* Status de pagamento nos cards */
.payment-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.payment-status.pending {
    background-color: #fff3cd;
    color: #856404;
}

.payment-status.completed {
    background-color: #d4edda;
    color: #155724;
}

.payment-status.canceled {
    background-color: #f8d7da;
    color: #721c24;
}

/* Toast notification */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 12px 20px;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    animation: slideInRight 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.toast.success {
    background-color: #28a745;
}

.toast.error {
    background-color: #dc3545;
}

.toast.warning {
    background-color: #ffc107;
    color: #212529;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Modal de status de pagamento */
.payment-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.payment-modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.payment-modal-content .icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.payment-modal-content.success .icon {
    color: #28a745;
}

.payment-modal-content.error .icon {
    color: #dc3545;
}

/* Animação de pulsar para indicar processamento */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

/* ============================================
   ESTILOS PARA OPÇÕES DE PAGAMENTO
   ============================================ */

.payment-option-card {
    transition: all 0.2s ease;
}

.payment-option-card:hover {
    border-color: #00aeef !important;
    box-shadow: 0 2px 8px rgba(0, 174, 239, 0.15);
}

.payment-option-card .form-check-input {
    width: 1.2rem;
    height: 1.2rem;
    flex-shrink: 0;
}

.payment-option-card .form-check-input:checked {
    background-color: #00aeef;
    border-color: #00aeef;
}

/* Ajuste de altura igual para ambos os cards */
.payment-option-card .d-flex {
    min-height: 60px;
}

/* Responsividade */
@media (max-width: 768px) {
    .payment-option-card {
        margin-bottom: 1rem;
    }
}


/* ============================================
   PADRÕES REUTILIZÁVEIS DE LAYOUT (tabs, listas)
   ============================================ */

/* Header de aba: título + controles de visualização */
.tab-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e9ecef;
}

.tab-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.tab-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tab-header-actions .view-label {
    font-size: 13px;
    color: #888;
}

/* Painel de importação (contador + botão) */
.import-panel {
    display: flex;
    align-items: center;
    gap: 8px;
}

.import-panel .selected-count {
    font-weight: bold;
    color: #333;
    font-size: 13px;
}

/* Grupo de botões de filtro */
.filter-group {
    display: flex;
    gap: 10px;
    margin: 15px 0;
}

/* Barra de pesquisa + info de paginação */
.search-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    flex-wrap: wrap;
    gap: 15px;
}

.search-bar-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-bar-inputs .form-control {
    width: 300px;
}

.pagination-info {
    color: #666;
    font-size: 0.9em;
}

/* Controles de paginação */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.pagination-pages {
    display: flex;
    gap: 5px;
}

/* ============================================
   LIST TABLE - Tabelas de produtos e empresas
   ============================================ */

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #dde3ea;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.07);
}

.list-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 0;
}

.list-table thead tr {
    background: linear-gradient(135deg, #2d3a4b 0%, #3a5068 100%);
}

.list-table thead th {
    padding: 11px 14px;
    color: #e8edf3;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border: none;
    white-space: nowrap;
}

.list-table thead th.col-checkbox {
    width: 38px;
    text-align: center;
    padding-left: 10px;
    padding-right: 10px;
}

.list-table thead th input[type="checkbox"] {
    cursor: pointer;
    width: 14px;
    height: 14px;
    accent-color: #3bc8f5;
    vertical-align: middle;
}

.list-table tbody tr {
    border-bottom: 1px solid #eef2f4;
    transition: background-color 0.12s;
}

.list-table tbody tr:last-child {
    border-bottom: none;
}

.list-table tbody tr:hover {
    background-color: #ebf6fd !important;
}

.list-table tbody tr.is-linked {
    background-color: #f4fbf4;
}

.list-table tbody td {
    padding: 9px 14px;
    vertical-align: middle;
    color: #535c69;
}

.list-table tbody td.col-checkbox {
    text-align: center;
    padding-left: 10px;
    padding-right: 10px;
}

.list-table tbody td input[type="checkbox"] {
    cursor: pointer;
    width: 14px;
    height: 14px;
    accent-color: #3bc8f5;
    vertical-align: middle;
}

.list-table .cell-name {
    font-weight: 600;
    color: #2d3a4b;
}

.list-table .cell-name a {
    color: #00aeef;
    text-decoration: none;
}

.list-table .cell-name a:hover {
    text-decoration: underline;
}

.list-table .cell-muted {
    color: #888;
    font-size: 12px;
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

.status-badge.linked {
    background: #d4edda;
    color: #155724;
}

.status-badge.unlinked {
    background: #ebebeb;
    color: #888;
}

/* Action buttons inside table */
.btn-tbl {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 3px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.15s, filter 0.15s;
    line-height: 1.5;
    white-space: nowrap;
}

.btn-tbl:hover {
    filter: brightness(0.92);
}

.btn-tbl.btn-tbl-primary {
    background: #3bc8f5;
    color: #fff;
    border-color: #3bc8f5;
}

.btn-tbl.btn-tbl-success {
    background: #28a745;
    color: #fff;
    border-color: #28a745;
}

.btn-tbl.btn-tbl-secondary {
    background: #f0f0f0;
    color: #535c69;
    border-color: #ccc;
}

.btn-tbl.btn-tbl-link {
    background: transparent;
    color: #00aeef;
    border-color: transparent;
    padding: 0;
    font-size: 12px;
    font-weight: normal;
}

.btn-tbl.btn-tbl-link.bitrix {
    color: #535c69;
}

/* ============================================
   ESTILOS PARA EXIBIÇÃO DE DADOS DO CONTATO
   Layout em duas colunas - company.html
   ============================================ */

/* Container de duas colunas */
.contact-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 15px;
}

@media (max-width: 900px) {
    .contact-info-grid {
        grid-template-columns: 1fr;
    }
}

/* Seções de dados */
.contact-section {
    margin-bottom: 20px;
}

.contact-section h4 {
    margin: 0 0 10px 0;
    color: #333;
    border-bottom: 2px solid #00aeef;
    padding-bottom: 5px;
    font-size: 14px;
    font-weight: 600;
}

.contact-section.endereco h4 {
    border-bottom-color: #28a745;
}

.contact-section.financeiro h4 {
    border-bottom-color: #ffc107;
}

.contact-section.outros h4 {
    border-bottom-color: #6c757d;
}

/* Tabela de dados compacta */
.data-table.compact {
    width: 100%;
    font-size: 13px;
}

.data-table.compact th,
.data-table.compact td {
    padding: 8px 10px;
    vertical-align: top;
}

.data-table.compact th {
    width: 45%;
    color: #666;
    font-weight: 600;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.data-table.compact td {
    color: #333;
    border-bottom: 1px solid #e9ecef;
}

.data-table.compact tr:last-child th,
.data-table.compact tr:last-child td {
    border-bottom: none;
}

/* Alerta de sucesso para vínculo */
.alert-vinculado {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

/* Botões de ação */
.action-buttons {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Contêineres de dados financeiros/comerciais */
.data-container {
    display: none;
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.data-container h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}
