/* ==========================================================================
   RUNPAY — ESTILOS GLOBAIS DE ALTO CONTRASTE E TIPOGRAFIA NÍTIDA (v4.5)
   ========================================================================== */

/* Resets e Tipografia Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #f8fafc;
    color: #0f172a !important; /* Texto principal em tom escuro forte */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 500 !important;
    padding-bottom: 75px; /* Espaço para o menu inferior mobile */
}

/* --------------------------------------------------------------------------
   CORREÇÃO DE LEITURA E CONTRASTE DE TEXTOS (SEM FONTES APAGADAS OU CINZAS LEVES)
   -------------------------------------------------------------------------- */

/* Títulos principais e números em grande destaque */
h1, h2, h3, h4, .sys-title, .sys-card-title, .sys-client-name, .val, strong, b {
    color: #0f172a !important;
    font-weight: 800 !important;
}

/* Legendas, rótulos e subtextos (Agora em cinza escuro nítido #334155 em vez de cinza claro) */
p, span, label, small,
.sys-card-sub, 
.mobile-card-sub, 
.summary-row span, 
.sys-data-row span, 
.hero-banner-stats label,
.app-row-left div div:last-child,
.sub-text {
    color: #334155 !important;
    font-weight: 600 !important;
}

/* Links */
a {
    color: #059669;
    text-decoration: none;
}

/* --------------------------------------------------------------------------
   SIDEBAR (DESKTOP) & LAYOUT PRINCIPAL
   -------------------------------------------------------------------------- */
.sidebar {
    display: none;
}

@media (min-width: 1024px) {
    body {
        padding-bottom: 0;
        display: flex;
    }
    
    .sidebar {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 260px;
        height: 100vh;
        background: #ffffff;
        border-right: 1px solid #cbd5e0;
        position: fixed;
        left: 0;
        top: 0;
        padding: 24px 20px;
        z-index: 100;
    }

    .sidebar .brand {
        margin-bottom: 30px;
    }

    .sidebar .brand-logo {
        font-size: 22px;
        font-weight: 900;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .sidebar .text-run { color: #0f172a; }
    .sidebar .text-pay { color: #059669; }

    .sidebar nav {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .sidebar nav a {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 16px;
        border-radius: 12px;
        color: #334155 !important;
        font-weight: 700 !important;
        font-size: 14px;
        transition: all 0.2s;
    }

    .sidebar nav a:hover {
        background: #f1f5f9;
        color: #0f172a !important;
    }

    .sidebar nav a.active {
        background: #d1fae5;
        color: #059669 !important;
    }

    .main-content {
        margin-left: 260px;
        flex: 1;
        padding: 30px;
        max-width: 1100px;
    }

    .mobile-bottom-nav {
        display: none !important;
    }
}

/* Conteúdo Mobile */
.main-content {
    padding: 16px;
}

/* --------------------------------------------------------------------------
   BARRA DE NAVEGAÇÃO INFERIOR (MOBILE BOTTOM NAV)
   -------------------------------------------------------------------------- */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 64px;
    background: #ffffff;
    border-top: 1px solid #cbd5e0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 9999;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.04);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: #475569 !important;
    font-size: 11px;
    font-weight: 700 !important;
    text-decoration: none;
    flex: 1;
    height: 100%;
}

.mobile-nav-item i {
    font-size: 18px;
}

.mobile-nav-item.active {
    color: #059669 !important;
}

.mobile-nav-item.active i {
    color: #059669 !important;
}

/* --------------------------------------------------------------------------
   BOTÕES E COMPONENTES PADRÃO (ESTILO SYSJUROS)
   -------------------------------------------------------------------------- */
.btn-sys-green {
    background: #059669;
    color: #ffffff !important;
    border: none;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 800 !important;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(5, 150, 105, 0.15);
}

.btn-sys-green:active {
    opacity: 0.9;
    transform: scale(0.98);
}

.sys-btn-square {
    width: 38px;
    height: 38px;
    border: 1px solid #cbd5e0;
    border-radius: 10px;
    background: #ffffff;
    color: #0f172a !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
}

.sys-btn-square:active {
    background: #f1f5f9;
}

/* --------------------------------------------------------------------------
   CAMPOS DE BUSCA E INPUTS
   -------------------------------------------------------------------------- */
.search-container {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.search-box {
    flex: 1;
    position: relative;
}

.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 15px;
}

.search-input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border: 1px solid #cbd5e0;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    outline: none;
    background: #ffffff;
    color: #0f172a !important;
}

.search-input:focus {
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

/* --------------------------------------------------------------------------
   BADGES E STATUS DE PARCELAS
   -------------------------------------------------------------------------- */
.badge-pago {
    background: #d1fae5;
    color: #059669 !important;
    font-size: 12px;
    font-weight: 800 !important;
    padding: 4px 12px;
    border-radius: 8px;
}

.badge-hoje {
    background: #fef3c7;
    color: #d97706 !important;
    font-size: 12px;
    font-weight: 800 !important;
    padding: 4px 12px;
    border-radius: 8px;
}

.badge-avencer {
    background: #eff6ff;
    color: #2563eb !important;
    font-size: 12px;
    font-weight: 800 !important;
    padding: 4px 12px;
    border-radius: 8px;
}

.badge-atrasado {
    background: #fee2e2;
    color: #dc2626 !important;
    font-size: 12px;
    font-weight: 800 !important;
    padding: 4px 12px;
    border-radius: 8px;
}

/* Status Aberto / Fechado dos Contratos */
.status-pill-green {
    background: #d1fae5;
    color: #059669 !important;
    font-size: 12px;
    font-weight: 800 !important;
    padding: 4px 12px;
    border-radius: 8px;
}

.status-pill-gray {
    background: #e2e8f0;
    color: #334155 !important;
    font-size: 12px;
    font-weight: 800 !important;
    padding: 4px 12px;
    border-radius: 8px;
}

/* --------------------------------------------------------------------------
   CARDS DE LISTAGEM (CLIENTES, CONTRATOS, VENCIMENTOS)
   -------------------------------------------------------------------------- */
.sys-card, .parcela-card, .mobile-card {
    background: #ffffff;
    border: 1px solid #cbd5e0;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.sys-data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    padding: 6px 0;
    border-bottom: 1px dashed #f1f5f9;
}

.sys-data-row:last-child {
    border-bottom: none;
}

/* --------------------------------------------------------------------------
   MODAIS SOBREPOSTOS
   -------------------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(2px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    padding: 15px;
}

.modal-overlay.open {
    display: flex;
}

.modal-box {
    background: #ffffff;
    width: 100%;
    max-width: 440px;
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    max-height: 90vh;
    overflow-y: auto;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 800 !important;
    color: #334155 !important;
    margin-bottom: 6px;
}

.form-group input, 
.form-group select {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #cbd5e0;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    outline: none;
    background: #ffffff;
    color: #0f172a !important;
}

.form-group input:focus, 
.form-group select:focus {
    border-color: #059669;
}