:root {
    --rodrimaq-chumbo: #242424;
    --rodrimaq-preto: #171717;
    --rodrimaq-laranja: #f28c00;
    --rodrimaq-laranja-escuro: #d87500;
    --rodrimaq-metal: #a7a7a7;
    --rodrimaq-cinza: #eeeeee;
    --rodrimaq-cinza-escuro: #5f5f5f;
    --rodrimaq-branco: #ffffff;

    --texto: #252525;
    --sucesso: #198754;
    --erro: #c62828;
    --aviso: #d87500;

    --sombra: 0 8px 24px rgba(0,0,0,.10);
    --sombra-forte: 0 12px 32px rgba(0,0,0,.16);
    --raio: 12px;
}

/* =========================
   BASE
========================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: #f3f3f3;
    color: var(--texto);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

/* =========================
   CABEÇALHO
========================= */

header {
    background:
        linear-gradient(
            135deg,
            var(--rodrimaq-preto),
            var(--rodrimaq-chumbo)
        );
    color: var(--rodrimaq-branco);
    border-bottom: 4px solid var(--rodrimaq-laranja);
    box-shadow: var(--sombra-forte);
}

header h1,
header h2,
header h3 {
    margin: 0;
    color: var(--rodrimaq-branco);
}

.logo {
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.logo span {
    color: var(--rodrimaq-laranja);
}

/* =========================
   MENU
========================= */

nav {
    background: var(--rodrimaq-chumbo);
    color: var(--rodrimaq-branco);
    border-bottom: 1px solid #444;
}

nav a {
    display: inline-block;
    padding: 13px 16px;
    font-weight: 700;
    transition: .2s ease;
    border-bottom: 3px solid transparent;
}

nav a:hover {
    color: var(--rodrimaq-laranja);
    background: var(--rodrimaq-preto);
    border-bottom-color: var(--rodrimaq-laranja);
}

/* =========================
   CONTEÚDO
========================= */

.container,
.conteudo,
main {
    width: min(1400px, calc(100% - 40px));
    margin: 0 auto;
}

/* =========================
   TÍTULOS
========================= */

h1 {
    color: var(--rodrimaq-chumbo);
    font-size: 28px;
    font-weight: 800;
}

h2 {
    color: var(--rodrimaq-chumbo);
    font-size: 20px;
    font-weight: 800;
}

h3 {
    color: var(--rodrimaq-chumbo);
}

.titulo-pagina {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 25px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--rodrimaq-metal);
}

.titulo-pagina h1 {
    margin: 0;
}

.subtitulo {
    color: var(--rodrimaq-cinza-escuro);
}

/* =========================
   CARDS
========================= */

.card,
.bloco,
.resumo-card,
.conta-card {
    background: var(--rodrimaq-branco);
    border: 1px solid #dddddd;
    border-radius: var(--raio);
    box-shadow: var(--sombra);
}

.card,
.bloco {
    padding: 22px;
    margin-bottom: 20px;
}

.card h2,
.bloco h2 {
    position: relative;
    padding-bottom: 10px;
    margin-bottom: 18px;
    border-bottom: 1px solid #e1e1e1;
}

.card h2::after,
.bloco h2::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 55px;
    height: 3px;
    background: var(--rodrimaq-laranja);
}

/* =========================
   CARDS DE RESUMO
========================= */

.resumo,
.resumo-grid,
.cards,
.contas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 18px;
    margin-bottom: 25px;
}

.resumo-card,
.conta-card {
    padding: 20px;
    border-top: 4px solid var(--rodrimaq-laranja);
    transition: .2s ease;
}

.resumo-card:hover,
.conta-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--sombra-forte);
}

.resumo-card small,
.conta-card small {
    display: block;
    color: var(--rodrimaq-cinza-escuro);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .7px;
    margin-bottom: 7px;
}

.resumo-card strong,
.conta-card strong {
    display: block;
    color: var(--rodrimaq-chumbo);
    font-size: 23px;
    font-weight: 800;
}

/* =========================
   TABELAS
========================= */

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--rodrimaq-branco);
    overflow: hidden;
    border-radius: 10px;
}

thead {
    background: var(--rodrimaq-chumbo);
    color: var(--rodrimaq-branco);
}

th {
    padding: 13px 14px;
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .5px;
    border-bottom: 3px solid var(--rodrimaq-laranja);
}

td {
    padding: 13px 14px;
    border-bottom: 1px solid #e4e4e4;
    vertical-align: middle;
}

tbody tr:hover {
    background: #fff8ed;
}

tbody tr:last-child td {
    border-bottom: 0;
}

.valor {
    font-weight: 800;
    white-space: nowrap;
}

/* =========================
   FORMULÁRIOS
========================= */

label {
    display: block;
    color: var(--rodrimaq-chumbo);
    font-weight: 700;
    margin-bottom: 6px;
}

input,
select,
textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid #cfcfcf;
    border-radius: 8px;
    background: var(--rodrimaq-branco);
    color: var(--texto);
    outline: none;
    transition: .2s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--rodrimaq-laranja);
    box-shadow: 0 0 0 3px rgba(242,140,0,.15);
}

textarea {
    min-height: 110px;
    resize: vertical;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

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

/* =========================
   BOTÕES
========================= */

button,
.btn,
input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    border: 0;
    border-radius: 8px;
    padding: 11px 18px;

    background: var(--rodrimaq-chumbo);
    color: var(--rodrimaq-branco);

    font-weight: 800;
    cursor: pointer;

    transition: .2s ease;
}

button:hover,
.btn:hover,
input[type="submit"]:hover {
    background: var(--rodrimaq-laranja);
    color: var(--rodrimaq-preto);
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--rodrimaq-chumbo);
}

.btn-gold,
.btn-laranja {
    background: var(--rodrimaq-laranja);
    color: var(--rodrimaq-preto);
}

.btn-success {
    background: var(--sucesso);
}

.btn-danger {
    background: var(--erro);
}

.btn-secondary {
    background: var(--rodrimaq-cinza-escuro);
}

/* =========================
   FILTROS
========================= */

.filtros {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    align-items: end;
    margin-bottom: 20px;
}

.filtros button {
    height: 43px;
}

/* =========================
   STATUS
========================= */

.status {
    display: inline-block;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.status.realizado {
    background: #dff4e8;
    color: #137333;
}

.status.pendente {
    background: #fff0d2;
    color: #9a5b00;
}

.status.cancelado,
.status.erro {
    background: #fde4e4;
    color: #a71919;
}

.status.outro {
    background: #e9e9e9;
    color: #4b4b4b;
}

/* =========================
   FINANCEIRO
========================= */

.valor-entrada,
.saldo-positivo {
    color: var(--sucesso);
    font-weight: 800;
}

.valor-saida,
.saldo-negativo {
    color: var(--erro);
    font-weight: 800;
}

/* =========================
   ALERTAS
========================= */

.alerta,
.mensagem {
    padding: 13px 16px;
    border-radius: 8px;
    margin-bottom: 18px;
    border-left: 5px solid;
}

.alerta-sucesso {
    background: #e5f6eb;
    color: #146c35;
    border-left-color: var(--sucesso);
}

.alerta-erro {
    background: #fde7e7;
    color: #9f1d1d;
    border-left-color: var(--erro);
}

.alerta-aviso {
    background: #fff3d7;
    color: #805300;
    border-left-color: var(--rodrimaq-laranja);
}

/* =========================
   LOGIN
========================= */

.login {
    border-top: 5px solid var(--rodrimaq-laranja);
}

.login h1 {
    color: var(--rodrimaq-chumbo);
}

.login button {
    background: var(--rodrimaq-laranja);
    color: var(--rodrimaq-preto);
}

.login button:hover {
    background: var(--rodrimaq-laranja-escuro);
    color: var(--rodrimaq-branco);
}

/* =========================
   RODAPÉ
========================= */

footer {
    margin-top: 40px;
    padding: 25px;
    background: var(--rodrimaq-preto);
    color: #d7d7d7;
    text-align: center;
    border-top: 4px solid var(--rodrimaq-laranja);
}

/* =========================
   IMPRESSÃO A4
========================= */

@page {
    size: A4 portrait;
    margin: 12mm;
}

@media print {

    body {
        background: #fff;
        color: #000;
        font-size: 10.5px;
    }

    nav,
    button,
    .btn,
    .filtros,
    .nao-imprimir {
        display: none !important;
    }

    header {
        box-shadow: none;
        border-bottom: 2px solid #000;
    }

    .card,
    .bloco,
    .resumo-card,
    .conta-card {
        box-shadow: none;
        border: 1px solid #aaa;
        break-inside: avoid;
    }

    thead {
        background: #eee !important;
        color: #000 !important;
    }

    th {
        border-bottom: 1px solid #000;
    }

    th,
    td {
        padding: 6px;
    }

    .container,
    .conteudo,
    main {
        width: 100%;
        margin: 0;
    }
}

/* =========================
   RESPONSIVO
========================= */

@media (max-width: 800px) {

    .container,
    .conteudo,
    main {
        width: calc(100% - 24px);
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .titulo-pagina {
        align-items: flex-start;
        flex-direction: column;
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

@media (max-width: 500px) {

    body {
        font-size: 13px;
    }

    .card,
    .bloco,
    .resumo-card,
    .conta-card {
        padding: 15px;
    }

    h1 {
        font-size: 23px;
    }

    h2 {
        font-size: 18px;
    }
}

/* LOGO RODRIMAQ - MENU LATERAL */
.sidebar .logo {
    padding: 18px 12px !important;
    height: auto !important;
    text-align: center !important;
    overflow: hidden !important;
}

.sidebar .logo img {
    display: block !important;
    width: 100% !important;
    max-width: 165px !important;
    height: auto !important;
    max-height: 105px !important;
    object-fit: contain !important;
    margin: 0 auto !important;
}

/* AJUSTE FINAL DA LOGO NO MENU */
.sidebar .logo img {
    max-width: 185px !important;
    max-height: 125px !important;
}

/* MENU LATERAL PREMIUM RODRIMAQ */
.sidebar {
    background: linear-gradient(180deg, #171717 0%, #242424 100%) !important;
    border-right: 1px solid #3a3a3a !important;
}

.sidebar .menu a {
    display: block !important;
    margin: 4px 10px !important;
    padding: 11px 14px !important;
    border-radius: 8px !important;
    color: #f2f2f2 !important;
    transition: all .2s ease !important;
}

.sidebar .menu a:hover {
    background: #2f2f2f !important;
    color: #f28c00 !important;
    transform: translateX(3px) !important;
}

.sidebar .menu a.active {
    background: linear-gradient(135deg, #f28c00, #d87500) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 12px rgba(242,140,0,.25) !important;
}

.sidebar .menu-title,
.sidebar .subtitle,
.sidebar .sistema {
    color: #a7a7a7 !important;
    text-transform: uppercase !important;
    font-size: 11px !important;
    letter-spacing: .08em !important;
}

/* DASHBOARD PREMIUM RODRIMAQ */
.cards .card,
.card {
    position: relative;
    overflow: hidden;
    border: 1px solid #dedede !important;
    border-top: 3px solid #f28c00 !important;
    border-radius: 12px !important;
    box-shadow: 0 5px 16px rgba(0,0,0,.07) !important;
    transition: transform .2s ease, box-shadow .2s ease !important;
}

.cards .card:hover,
.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0,0,0,.12) !important;
}

.cards .card strong,
.card strong {
    color: #171717 !important;
}

h1, h2, h3 {
    color: #202020 !important;
}

h1::after,
h2::after {
    content: "";
    display: block;
    width: 42px;
    height: 3px;
    margin-top: 7px;
    border-radius: 3px;
    background: #f28c00;
}

/* GRAFICO DE FATURAMENTO */
.grafico-faturamento {
    position: relative;
    width: 100%;
    height: 360px;
    margin-top: 20px;
    padding: 18px;
    background: #ffffff;
    border: 1px solid #dedede;
    border-radius: 12px;
    box-shadow: 0 5px 16px rgba(0,0,0,.06);
}

/* INDICADORES EXECUTIVOS - FATURAMENTO */
.indicadores-faturamento {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 18px 0 20px;
}

.indicador-faturamento {
    padding: 18px 20px;
    border-radius: 12px;
    box-shadow: 0 5px 16px rgba(0,0,0,.08);
}

.indicador-faturamento span {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.indicador-faturamento strong {
    display: block;
    font-size: 26px;
    line-height: 1.2;
}

.destaque-laranja {
    background: linear-gradient(135deg, #F28C00, #D87500);
    color: #ffffff;
}

.destaque-laranja span,
.destaque-laranja strong {
    color: #ffffff !important;
}

.destaque-chumbo {
    background: linear-gradient(135deg, #242424, #171717);
    color: #ffffff;
}

.destaque-chumbo span,
.destaque-chumbo strong {
    color: #ffffff !important;
}

.destaque-crescimento {
    background: #f4f4f4;
    border: 1px solid #d8d8d8;
    border-left: 5px solid #F28C00;
    color: #242424;
}

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