/* ── Intranet Dashboard Styling ── */
.intranet-body {
    background-color: #07090E;
    color: #F8FAFC;
    font-family: 'Montserrat', sans-serif;
    min-height: 100vh;
}

/* Header */
.intranet-header {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 14px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.intranet-header-left {
    display: flex;
    align-items: center;
    gap: 18px;
}

.intranet-title-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(2, 6, 23, 0.6);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(56, 189, 248, 0.3);
    font-size: 0.82rem;
    color: #E2E8F0;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10B981;
    box-shadow: 0 0 8px #10B981;
    display: inline-block;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.badge-env {
    background: #0284C7;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
}

.intranet-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Data de Processamento Atual Widget */
.data-proc-widget {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.95));
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-radius: 10px;
    padding: 6px 14px;
    text-align: right;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.15);
}

.proc-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: #34D399;
    letter-spacing: 0.05em;
}

.proc-value {
    font-size: 1rem;
    font-weight: 900;
    color: #FFFFFF;
    font-family: monospace;
}

.assessoria-badge {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #93C5FD;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
}

.btn-portal-link {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #2563EB;
    color: #FFFFFF;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-portal-link:hover {
    background: #1D4ED8;
    transform: translateY(-1px);
}

.btn-voltar-home {
    background: rgba(255, 255, 255, 0.1);
    color: #CBD5E1;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
}

/* Container */
.intranet-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 20px 60px;
}

/* Fluxo Status Card */
.fluxo-status-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.9));
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 14px;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 24px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.fluxo-icon {
    font-size: 2rem;
}

.fluxo-info {
    flex: 1;
}

.fluxo-info h3 {
    font-size: 1.05rem;
    font-weight: 800;
    color: #FFFFFF;
    margin-bottom: 4px;
}

.fluxo-info p {
    font-size: 0.85rem;
    color: #94A3B8;
}

.btn-refresh {
    background: #2563EB;
    color: #FFFFFF;
    border: none;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.btn-refresh:hover {
    background: #1D4ED8;
}

/* KPI Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.kpi-card {
    background: #FFFFFF;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid #E2E8F0;
    color: #0F172A;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.kpi-card.kpi-clickable {
    cursor: pointer;
}

.kpi-card.kpi-clickable:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.2);
    border-color: #3B82F6;
}

.kpi-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.kpi-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #64748B;
    text-transform: uppercase;
}

.kpi-badge {
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 12px;
    background: #F1F5F9;
    color: #475569;
}

.kpi-badge.active {
    background: #DCFCE7;
    color: #15803D;
}

.kpi-number {
    font-size: 2rem;
    font-weight: 900;
    color: #0F172A;
    line-height: 1.1;
    margin-bottom: 4px;
    font-family: monospace;
}

.kpi-sub {
    font-size: 0.78rem;
    color: #94A3B8;
}

/* Tabs - Segmented Control / UX Modern Pills (Zero Rolagem Feia) */
.intranet-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 6px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    overflow: visible;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: transparent;
    border: 1px solid transparent;
    color: #94A3B8;
    padding: 7px 14px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    user-select: none;
    line-height: 1.2;
}

.tab-btn .tab-icon {
    font-size: 1rem;
    line-height: 1;
}

.tab-btn:hover {
    color: #F8FAFC;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.tab-btn.active {
    color: #FFFFFF;
    background: linear-gradient(135deg, #2563EB, #1D4ED8);
    border-color: #3B82F6;
    box-shadow: 0 3px 12px rgba(37, 99, 235, 0.38);
}

/* Badge indicativo de novidade ou destaque na aba */
.tab-btn-badge {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
}

/* Esconde barras de rolagem caso algum container tente forçar */
.intranet-tabs::-webkit-scrollbar {
    display: none;
}
.intranet-tabs {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Panel Card */
.panel-card {
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    border: 1px solid #E2E8F0;
    color: #0F172A;
    overflow: hidden;
}

.panel-header {
    padding: 22px 28px;
    border-bottom: 1px solid #E2E8F0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #F8FAFC;
    flex-wrap: wrap;
    gap: 16px;
}

.panel-header h2 {
    font-size: 1.25rem;
    font-weight: 900;
    color: #0F172A;
    margin-bottom: 4px;
}

.panel-header p {
    font-size: 0.85rem;
    color: #64748B;
    margin: 0;
}

.custom-select {
    padding: 9px 14px;
    border-radius: 8px;
    border: 1.5px solid #CBD5E1;
    background: #FFFFFF;
    color: #0F172A;
    font-weight: 700;
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
}

.badge-pill {
    background: #EFF6FF;
    color: #2563EB;
    font-weight: 800;
    font-size: 0.8rem;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid #BFDBFE;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.intranet-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    text-align: left;
}

.intranet-table th {
    background: #F1F5F9;
    color: #475569;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.75rem;
    padding: 14px 20px;
    border-bottom: 1px solid #E2E8F0;
    letter-spacing: 0.04em;
}

.intranet-table td {
    padding: 16px 20px;
    border-bottom: 1px solid #F1F5F9;
    color: #1E293B;
}

.intranet-table tbody tr:hover {
    background: #F8FAFC;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.status-badge.ativo, .status-badge.badge-sit-ativo {
    background: #DCFCE7;
    color: #15803D;
    border: 1px solid #BBF7D0;
}

.status-badge.inativo, .status-badge.badge-sit-inativo {
    background: #F1F5F9;
    color: #64748B;
    border: 1px solid #CBD5E1;
}

.status-badge.badge-sit-cobranca, .status-badge.badge-sit-nao_cumprido, .status-badge.badge-sit-bloqueado {
    background: #FEE2E2;
    color: #DC2626;
    border: 1px solid #FECACA;
}

.status-badge.badge-sit-pendente, .status-badge.badge-sit-proposta {
    background: #FEF3C7;
    color: #D97706;
    border: 1px solid #FDE68A;
}

.status-badge.badge-sit-aberto, .status-badge.badge-sit-parcial {
    background: #E0E7FF;
    color: #4338CA;
    border: 1px solid #C7D2FE;
}

.status-badge.badge-sit-liquidado, .status-badge.badge-sit-concluido {
    background: #D1FAE5;
    color: #047857;
    border: 1px solid #A7F3D0;
}

.status-badge.badge-sit-suspenso, .status-badge.badge-sit-renegociado {
    background: #F3E8FF;
    color: #7E22CE;
    border: 1px solid #E9D5FF;
}

.badge-dias-atraso {
    background: #FFF1F2;
    color: #BE123C;
    border: 1px solid #FFE4E6;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 800;
    font-size: 0.75rem;
    display: inline-block;
}

.btn-action-table {
    background: #2563EB;
    color: #FFFFFF;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.btn-action-table:hover {
    background: #1D4ED8;
}

.btn-action-secondary {
    background: #0284C7;
    color: #FFFFFF;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.btn-action-secondary:hover {
    background: #0369A1;
}

/* Modal */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-dialog {
    background: #FFFFFF;
    border-radius: 16px;
    max-width: 950px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #E2E8F0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #F8FAFC;
    border-radius: 16px 16px 0 0;
}

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0F172A;
    margin: 0;
}

.modal-close-btn {
    background: transparent;
    border: none;
    font-size: 1.8rem;
    color: #64748B;
    cursor: pointer;
    line-height: 1;
}

.modal-close-btn:hover {
    color: #0F172A;
}

.modal-body {
    padding: 24px;
}

.contract-card {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 20px;
}

.contract-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    border-bottom: 1px solid #E2E8F0;
    padding-bottom: 8px;
}

.parcel-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.parcel-table th {
    background: #EEF2F6;
    padding: 8px 12px;
    color: #475569;
    font-weight: 700;
    text-align: left;
}

.parcel-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #E2E8F0;
}

@media (max-width: 768px) {
    .intranet-header {
        flex-direction: column;
        gap: 14px;
        align-items: flex-start;
    }
    .intranet-header-right {
        flex-wrap: wrap;
    }
}

/* ── Overlay e Card de Login da Intranet ── */
.intranet-login-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(4, 7, 14, 0.88);
    backdrop-filter: blur(16px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.intranet-login-card {
    background: #0F172A;
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    padding: 36px 32px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(2, 132, 199, 0.15);
    display: flex;
    flex-direction: column;
    text-align: center;
}

.intranet-login-logo {
    margin-bottom: 20px;
}

.intranet-login-logo img {
    height: 38px;
    object-fit: contain;
}

.intranet-login-header h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: #F8FAFC;
    margin: 0 0 6px 0;
    letter-spacing: -0.5px;
}

.intranet-login-header p {
    font-size: 0.82rem;
    color: #94A3B8;
    margin: 0 0 24px 0;
}

.login-form-group {
    text-align: left;
    margin-bottom: 18px;
}

.login-form-group label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: #CBD5E1;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-form-group input {
    width: 100%;
    background: #1E293B;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 12px 14px;
    color: #FFFFFF;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.login-form-group input:focus {
    border-color: #38BDF8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.btn-login-submit {
    width: 100%;
    background: linear-gradient(135deg, #0284C7 0%, #0369A1 100%);
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    padding: 14px;
    font-size: 0.88rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    margin-top: 10px;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
}

.btn-login-submit:hover {
    background: linear-gradient(135deg, #0369A1 0%, #0284C7 100%);
    box-shadow: 0 6px 20px rgba(2, 132, 199, 0.6);
    transform: translateY(-1px);
}

.btn-login-submit:active {
    transform: translateY(1px);
}

.login-alert-danger {
    background: rgba(220, 38, 38, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #FCA5A5;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    margin-bottom: 18px;
    text-align: left;
}

.intranet-login-footer {
    margin-top: 24px;
    font-size: 0.8rem;
}

.intranet-login-footer a {
    color: #64748B;
    text-decoration: none;
    transition: color 0.2s;
}

.intranet-login-footer a:hover {
    color: #38BDF8;
}

/* ==========================================================================
   TABELA DE CONTROLE DE DESCONTOS (RESPONSIVA E COMPACTA PARA NÃO CORTAR)
   ========================================================================== */
.tabela-descontos-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    background: #FFFFFF;
}

.tabela-descontos-compacta {
    width: 100%;
    min-width: 960px;
    font-size: 0.8rem;
    border-collapse: collapse;
}

.tabela-descontos-compacta th {
    padding: 10px 6px;
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    vertical-align: middle;
    background: #F8FAFC;
    border-bottom: 2px solid #E2E8F0;
    white-space: nowrap;
}

.tabela-descontos-compacta td {
    padding: 8px 6px;
    vertical-align: middle;
    border-bottom: 1px solid #F1F5F9;
}

.tabela-descontos-compacta .input-pct-box {
    display: inline-flex;
    align-items: center;
    background: #F8FAFC;
    border: 1px solid #CBD5E1;
    border-radius: 5px;
    padding: 2px 4px;
    transition: all 0.2s;
}

.tabela-descontos-compacta .input-pct-box:focus-within {
    border-color: #3B82F6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
    background: #FFFFFF;
}

.tabela-descontos-compacta .input-pct-box.box-geral {
    background: #EFF6FF;
    border: 1.5px solid #3B82F6;
}

.tabela-descontos-compacta input[type="number"] {
    width: 46px;
    border: none;
    background: transparent;
    font-weight: 700;
    text-align: right;
    font-size: 0.82rem;
    color: #0F172A;
    padding: 0;
    margin: 0;
    outline: none;
    -moz-appearance: textfield;
    appearance: textfield;
}

.tabela-descontos-compacta input[type="number"]::-webkit-outer-spin-button,
.tabela-descontos-compacta input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

.tabela-descontos-compacta .pct-symbol {
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748B;
    margin-left: 2px;
}

.tabela-descontos-compacta .sub-limite {
    font-size: 0.62rem;
    line-height: 1.1;
    margin-top: 2px;
    white-space: nowrap;
}

/* Enquadramento para Gestão de Carteiras (Sem Barra de Rolagem Horizontal) */
#tab-tester .table-responsive {
    overflow-x: hidden !important;
}

#tab-tester .intranet-table {
    width: 100% !important;
    table-layout: auto !important;
}

#tab-tester .intranet-table th,
#tab-tester .intranet-table td {
    padding: 12px 14px !important;
}


