/* ═══════════════════════════════════════════════════════════════
   MobiTex PSCG — Tema Corporativo (estilo TOTVS/ERP)
   ═══════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Paleta principal — azul-marinho corporativo */
    --corp-900: #0d1b2a;
    --corp-800: #1a2e44;
    --corp-700: #1e3a5f;
    --corp-600: #1b4f8a;
    --corp-500: #1565c0;
    --corp-400: #1976d2;
    --corp-300: #42a5f5;
    --corp-100: #e3f0fb;
    --corp-50:  #f0f7ff;

    /* Superfícies */
    --bg-page:       #f0f2f5;
    --bg-surface:    #ffffff;
    --bg-surface-2:  #f8f9fb;
    --bg-input:      #ffffff;
    --border:        #d4d9e1;
    --border-light:  #eaecf0;

    /* Texto */
    --text-primary:  #1a2332;
    --text-secondary:#4a5568;
    --text-muted:    #8a94a6;
    --text-inverse:  #ffffff;

    /* Semânticas */
    --primary:  #1565c0;
    --primary-hover: #0d47a1;
    --success:  #1a7f4b;
    --success-bg: #e8f5ee;
    --danger:   #c0392b;
    --danger-bg:#fdecea;
    --warning:  #b45309;
    --warning-bg:#fef3cd;
    --info:     #0277bd;
    --info-bg:  #e1f0fa;
    --purple:   #6b3fa0;
    --purple-bg:#f0e8fc;

    /* Aliases legados (usados inline no app) */
    --dark:  #1a2332;
    --black: #1a2332;
    --light: var(--bg-page);
}

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background: var(--bg-page);
    margin: 0;
    padding-bottom: 100px;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ── Container principal ── */
.container {
    width: 92%;
    max-width: 1200px;
    margin: auto;
    background: var(--bg-surface);
    padding: 24px;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
    border: 1px solid var(--border-light);
    border-top: none;
}

/* ── Inputs, selects, buttons globais ── */
input, select {
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: inherit;
    outline: none;
    background: var(--bg-input);
    color: var(--text-primary);
    transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus {
    border-color: var(--corp-400);
    box-shadow: 0 0 0 3px rgba(21,101,192,0.12);
}
input::placeholder { color: var(--text-muted); }
select option { background: #fff; color: var(--text-primary); }

button {
    padding: 9px 18px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: inherit;
    outline: none;
    background: var(--bg-surface);
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
button:hover { background: var(--bg-surface-2); }

.label-f {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 12px 0 3px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* ── Botão fechar modal ── */
.btn-close-modal {
    position: absolute;
    top: 14px;
    right: 14px;
    background: var(--bg-surface-2);
    border: 1px solid var(--border-light);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
    color: var(--text-secondary);
    font-size: 0.8rem;
    z-index: 10;
    transition: background 0.15s;
}
.btn-close-modal:hover { background: var(--border-light); color: var(--danger); }

/* ── Modais ── */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(13,27,42,0.6);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}
.modal-content {
    position: relative;
    background: var(--bg-surface);
    width: 95%;
    max-width: 520px;
    padding: 24px;
    border-radius: 10px;
    max-height: 92vh;
    overflow-y: auto;
    color: var(--text-primary);
    border: 1px solid var(--border);
    box-shadow: 0 8px 32px rgba(13,27,42,0.2);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.full { grid-column: span 2; }

/* ── Dashboards — scroll strip ── */
.scroll-container {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding: 12px;
    background: var(--bg-surface);
    margin-bottom: 16px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    scrollbar-width: thin;
}
.dash-card {
    min-width: 155px;
    background: var(--bg-surface-2);
    padding: 14px 16px;
    border-radius: 8px;
    border-left: 3px solid var(--info);
    cursor: pointer;
    flex-shrink: 0;
    transition: box-shadow 0.15s, transform 0.15s;
    border-top: 1px solid var(--border-light);
    border-right: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}
.dash-card:hover { box-shadow: 0 2px 8px rgba(21,101,192,0.12); transform: translateY(-1px); }
.dash-card.cc { border-left-color: var(--purple); }
.dash-card small {
    font-size: 0.65rem;
    color: var(--text-muted);
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.dash-card strong {
    font-size: 0.95rem;
    display: block;
    margin-top: 4px;
    color: var(--text-primary);
    font-weight: 600;
}

/* ── Lista de lançamentos ── */
.list-item {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-surface);
    transition: background 0.12s;
}
.list-item:nth-child(even) { background: var(--bg-surface-2); }
.list-item:hover { background: var(--corp-50); }
.list-info b { font-size: 0.82rem; display: block; color: var(--text-primary); font-weight: 600; }
.list-info span { font-size: 0.73rem; color: var(--text-muted); }

/* ── Rateio ── */
.rateio-box {
    background: var(--bg-surface-2);
    padding: 14px;
    border-radius: 8px;
    border: 1px dashed var(--border);
    margin: 10px 0;
}
.rateio-linha {
    display: grid;
    grid-template-columns: 1fr 65px 85px 30px;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
    background: var(--bg-surface);
    padding: 6px;
    border-radius: 6px;
    border: 1px solid var(--border-light);
}
.rateio-linha select, .rateio-linha input {
    padding: 7px 9px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 0.83rem;
    width: 100%;
    background: var(--bg-input);
    color: var(--text-primary);
}
.rateio-linha button {
    color: var(--danger);
    font-weight: bold;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 1.1rem;
    padding: 4px;
}
#containerConfigRateio .rateio-linha {
    grid-template-columns: 1fr 60px 30px;
    background: var(--bg-surface-2);
    border: 1px solid var(--border-light);
}

/* ── Botões flutuantes ── */
.btn-add {
    position: fixed;
    bottom: 28px;
    right: 24px;
    width: 52px;
    height: 52px;
    border-radius: 8px;
    background: var(--primary);
    color: white;
    border: none;
    font-size: 1.8rem;
    z-index: 100;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(21,101,192,0.35);
    transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 300;
}
.btn-add:hover { background: var(--primary-hover); box-shadow: 0 6px 20px rgba(21,101,192,0.45); transform: translateY(-1px); }

.btn-export {
    position: fixed;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    color: white;
    border: none;
    font-size: 1.1rem;
    z-index: 100;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.15s, transform 0.1s;
}
.btn-export:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.25); transform: translateY(-1px); }

.btn-sap    { bottom: 172px; right: 30px; background: var(--corp-700); }
.btn-cc     { bottom: 110px; right: 30px; background: var(--corp-700); }
.btn-config { bottom: 234px; right: 30px; background: var(--corp-700); }
.btn-backup { bottom: 296px; right: 30px; background: var(--purple); }

/* ── Visualizar arquivo ── */
#modalVisualizarArquivo .modal-content { display: flex; flex-direction: column; }

/* ── Transação extrato ── */
.transacao-item {
    display: grid;
    grid-template-columns: 85px 1fr 150px 110px 45px;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-light);
}
.transacao-item:nth-child(even) { background: var(--bg-surface-2); }

.truncated-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.valor-col { text-align: right; font-weight: 600; white-space: nowrap; }

/* ── Scrollbar global ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-surface-2); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
