/* =====================================================================
   Renovi — tema sobre o Materialize 1.0
   ===================================================================== */
:root {
    --ink: #0F2A2E;
    --ink-2: #1A4A50;
    --verde: #1FA37A;
    --verde-escuro: #15805F;
    --ambar: #E8A33D;
    --vermelho: #C8423B;
    --azul: #2F6FDB;
    --fundo: #F4F6F2;
    --borda: #DDE3DF;
    --texto: #0F2A2E;
    --texto-2: #4A5D5F;
    --branco: #FFFFFF;
    --raio: 14px;
    --menu: 256px;
}

html { font-size: 15px; }
body {
    font-family: 'Sora', 'Segoe UI', Arial, sans-serif;
    background: var(--fundo);
    color: var(--texto);
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}
a { color: var(--ink-2); }
a:hover { color: var(--verde-escuro); }
code, .mono { font-family: 'IBM Plex Mono', Consolas, monospace; font-size: .9em; }
h1, h2, h3, h4, h5, h6 { font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.texto-2 { color: var(--texto-2); }
.texto-ok { color: var(--verde-escuro) !important; }
.texto-erro { color: var(--vermelho) !important; }
.texto-alerta { color: #9A6512 !important; }
.peq { font-size: .85rem; }

/* ---------- Menu lateral ---------- */
.sidenav.menu-renovi {
    width: var(--menu);
    background: var(--ink);
    box-shadow: none;
    padding-bottom: 24px;
}
.menu-renovi .marca {
    display: flex; align-items: center; gap: 10px;
    padding: 22px 22px 18px;
    height: auto; line-height: 1;
}
.menu-renovi .marca span { color: #fff; font-size: 1.6rem; font-weight: 700; letter-spacing: -.045em; }
.menu-renovi li > a {
    color: #C9D6D4; font-size: .93rem; font-weight: 400;
    height: 44px; line-height: 44px; padding: 0 22px; margin: 2px 10px; border-radius: 10px;
}
.menu-renovi li > a > i.material-icons { color: #8FA6A3; margin-right: 14px; height: 44px; line-height: 44px; }
.menu-renovi li > a:hover { background: rgba(255,255,255,.07); color: #fff; }
.menu-renovi li.active > a { background: rgba(31,163,122,.18); color: #fff; font-weight: 600; }
.menu-renovi li.active > a > i.material-icons { color: var(--verde); }
.menu-renovi .subheader {
    color: #7F9794 !important; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em;
    height: 36px; line-height: 36px; padding: 0 32px !important; margin-top: 8px; cursor: default;
}
.menu-renovi .subheader:hover { background: none !important; }
.menu-renovi li { line-height: normal; }

/* ---------- Barra superior ---------- */
header .barra {
    background: var(--fundo); box-shadow: none; color: var(--texto); height: 72px; line-height: 72px;
}
header .barra .nav-wrapper { padding: 0 28px; display: flex; align-items: center; gap: 12px; }
header .barra .titulo-pagina { font-size: 1.35rem; font-weight: 700; letter-spacing: -.02em; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
header .barra a, header .barra i { color: var(--texto); }
.botao-menu { display: none; }
.avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--ink); color: #fff; font-size: .8rem; font-weight: 600; line-height: 1;
}
.usuario-topo { display: flex; align-items: center; gap: 10px; cursor: pointer; line-height: 1.2; }
.usuario-topo .nome { font-size: .9rem; font-weight: 600; }
.usuario-topo .papel { font-size: .75rem; color: var(--texto-2); }
.dropdown-content li > a, .dropdown-content li > span { color: var(--texto); font-size: .92rem; }
.dropdown-content li > a > i { color: var(--texto-2); }

main.conteudo { flex: 1 0 auto; padding: 4px 28px 40px; }
@media only screen and (min-width: 993px) {
    header, main.conteudo, footer.rodape { padding-left: calc(var(--menu) + 28px); }
    header .barra .nav-wrapper { padding-left: 0; }
}
@media only screen and (max-width: 992px) {
    .botao-menu { display: inline-flex; }
    header .barra .nav-wrapper { padding: 0 16px; }
    main.conteudo { padding: 4px 16px 32px; }
    .usuario-topo .nome, .usuario-topo .papel { display: none; }
}
footer.rodape { padding-top: 16px; padding-bottom: 16px; padding-right: 28px; color: var(--texto-2); font-size: .8rem; }
@media only screen and (max-width: 992px) { footer.rodape { padding-left: 16px; } }

/* ---------- Cartões e blocos ---------- */
.card { border-radius: var(--raio); box-shadow: none; border: 1px solid var(--borda); }
.card .card-content { padding: 22px 24px; }
.card .card-title { font-size: 1.1rem !important; font-weight: 700; letter-spacing: -.01em; margin-bottom: 14px !important; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card .card-action { border-top: 1px solid var(--borda); border-radius: 0 0 var(--raio) var(--raio); }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .kpis { grid-template-columns: 1fr; } }
.kpi { background: #fff; border: 1px solid var(--borda); border-radius: var(--raio); padding: 18px 20px; }
.kpi .rotulo { font-size: .8rem; color: var(--texto-2); display: flex; align-items: center; gap: 6px; }
.kpi .rotulo i { font-size: 18px; }
.kpi .valor { font-size: 1.75rem; font-weight: 700; letter-spacing: -.03em; margin-top: 6px; }
.kpi .detalhe { font-size: .8rem; color: var(--texto-2); margin-top: 2px; }
.kpi.destaque { background: var(--ink); border-color: var(--ink); color: #fff; }
.kpi.destaque .rotulo, .kpi.destaque .detalhe { color: #B8C7C5; }

.grade-2 { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; }
.grade-2-igual { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 1100px) { .grade-2, .grade-2-igual { grid-template-columns: minmax(0, 1fr); } }

.dados { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px 24px; }
.dados .item .rotulo { font-size: .75rem; color: var(--texto-2); text-transform: uppercase; letter-spacing: .05em; }
.dados .item .valor { font-size: .95rem; margin-top: 3px; word-break: break-word; }

/* ---------- Barra de ações e filtros ---------- */
.acoes-topo { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.acoes-topo .grupo { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filtros { background: #fff; border: 1px solid var(--borda); border-radius: var(--raio); padding: 16px 16px 0; margin-bottom: 16px; }
.filtros .row { margin-bottom: 0; }
.filtros .input-field { margin-bottom: 16px; }
.filtros .col.botoes { display: flex; gap: 8px; align-items: center; padding-top: 22px; margin-bottom: 16px; }

/* ---------- Botões ---------- */
.btn, .btn-large, .btn-small { border-radius: 10px; box-shadow: none; text-transform: none; font-weight: 600; letter-spacing: 0; }
.btn:hover, .btn-small:hover { box-shadow: none; }
.btn-primario, .btn-primario:focus { background: var(--ink); color: #fff; }
.btn-primario:hover { background: var(--ink-2); }
.btn-verde, .btn-verde:focus { background: var(--verde-escuro); color: #fff; }
.btn-verde:hover { background: #106B4F; }
.btn-claro, .btn-claro:focus { background: #fff; color: var(--ink); border: 1px solid var(--borda); }
.btn-claro:hover { background: #EEF2EF; }
.btn-perigo, .btn-perigo:focus { background: #fff; color: var(--vermelho); border: 1px solid #EBC7C4; }
.btn-perigo:hover { background: #FBEEED; }
.btn-flat { text-transform: none; }
form.inline { display: inline; }

/* ---------- Tabelas ---------- */
.tabela-box { overflow-x: auto; }
table.tabela { font-size: .9rem; }
table.tabela thead th { font-size: .75rem; color: var(--texto-2); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; padding: 10px 12px; }
table.tabela td { padding: 11px 12px; vertical-align: middle; }
table.tabela tbody tr { border-bottom: 1px solid #EDF0EE; }
table.tabela tbody tr:hover { background: #F8FAF8; }
table.tabela .acoes { white-space: nowrap; text-align: right; }
table.tabela .direita, .direita { text-align: right; }
table.tabela .sub { display: block; font-size: .78rem; color: var(--texto-2); }
.vazio { text-align: center; color: var(--texto-2); padding: 36px 12px; }
.vazio i { font-size: 40px; color: #B8C7C5; display: block; margin-bottom: 8px; }

/* ---------- Status ---------- */
.chip-status {
    display: inline-block; padding: 3px 10px; border-radius: 999px;
    font-size: .75rem; font-weight: 600; line-height: 1.5; white-space: nowrap;
}
.chip-ok { background: #DDF3EA; color: #0D6B4D; }
.chip-info { background: #E2ECFB; color: #1F4FA3; }
.chip-alerta { background: #FCEFD6; color: #8A560B; }
.chip-erro { background: #F9E1DF; color: #A2302A; }
.chip-neutro { background: #E9EDEB; color: #4A5D5F; }

/* ---------- Mensagens ---------- */
.msg { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 12px; margin: 0 0 16px; font-size: .92rem; }
.msg i { font-size: 20px; }
.msg-sucesso { background: #DDF3EA; color: #0D6B4D; }
.msg-erro { background: #F9E1DF; color: #A2302A; }
.msg-alerta { background: #FCEFD6; color: #7A4B08; }
.msg-info { background: #E2ECFB; color: #1F4FA3; }

/* ---------- Formulários ----------
   Rótulo fixo acima do campo e caixa com borda: nada de rótulo flutuante
   sobrepondo o texto digitado. */
.input-field {
    display: flex; flex-direction: column;
    margin-top: 0; margin-bottom: 18px; position: relative;
}
.input-field > label,
.input-field > label.active {
    order: -1; position: static !important; transform: none !important;
    font-size: .8rem !important; font-weight: 600; color: var(--texto-2) !important;
    margin: 0 0 6px; line-height: 1.3; pointer-events: auto; cursor: default;
}
.input-field > input:not([type=checkbox]):not([type=radio]),
.input-field > textarea,
.input-field > select,
select.browser-default {
    box-sizing: border-box !important;
    width: 100% !important;
    height: 44px !important;
    margin: 0 !important;
    padding: 0 12px !important;
    border: 1px solid #C9D2CE !important;
    border-radius: 10px !important;
    background: #fff !important;
    box-shadow: none !important;
    font-family: inherit; font-size: .95rem !important; color: var(--texto) !important;
    line-height: 1.4 !important;
    transition: border-color .15s, box-shadow .15s;
}
.input-field > textarea, .input-field > textarea.materialize-textarea {
    height: auto !important; min-height: 88px; padding: 10px 12px !important; resize: vertical; overflow-y: auto !important;
}
select.browser-default {
    display: block; appearance: none; -webkit-appearance: none; padding-right: 36px !important; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%234A5D5F' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important; background-position: right 12px center !important;
}
.input-field > input:not([type=checkbox]):not([type=radio]):focus,
.input-field > textarea:focus,
select.browser-default:focus {
    outline: none; border-color: var(--verde) !important; box-shadow: 0 0 0 3px rgba(31,163,122,.18) !important;
}
.input-field > input[disabled], .input-field > input[readonly] { background: #F2F4F3 !important; color: var(--texto-2) !important; }
.input-field > input.invalid, .input-field > input:invalid:not(:placeholder-shown):not(:focus) { border-color: #C9D2CE !important; box-shadow: none !important; }
.input-field .helper-text { position: static; min-height: 0 !important; font-size: .78rem; margin-top: 5px; line-height: 1.35; }
.input-field .helper-text.red-text, .helper-text.red-text { color: #A2302A !important; font-weight: 600; }
.input-field > input::placeholder, .input-field > textarea::placeholder { color: #9AA9A7; }
.row .col.input-field { margin-bottom: 18px; }
.row { margin-bottom: 0; }
[type="checkbox"].filled-in:checked + span:not(.lever):after { border-color: var(--verde); background-color: var(--verde); }
[type="checkbox"] + span:not(.lever) { font-size: .92rem; color: var(--texto); line-height: 25px; height: auto; }
[type="radio"]:checked + span:after, [type="radio"].with-gap:checked + span:after { background-color: var(--verde); border-color: var(--verde); }
[type="radio"] + span { color: var(--texto); }
.switch label { font-size: .88rem; color: var(--texto-2); }
.switch label input[type=checkbox]:checked + .lever { background-color: #9ED9C4; }
.switch label input[type=checkbox]:checked + .lever:after { background-color: var(--verde); }
.secao { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--texto-2); margin: 8px 0 14px; font-weight: 700; }
textarea.codigo { width: 100%; font-family: 'IBM Plex Mono', monospace; font-size: .8rem; border: 1px solid var(--borda); border-radius: 10px; padding: 10px; height: auto; background: #FAFBFA; box-sizing: border-box; }
.campo-copiar { display: flex; gap: 8px; align-items: center; background: #FAFBFA; border: 1px solid var(--borda); border-radius: 10px; padding: 6px 6px 6px 12px; }
.campo-copiar code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; }
.form-rodape { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 8px; }

/* ---------- Linha do tempo ---------- */
.linha-tempo { list-style: none; margin: 0; padding: 0; }
.linha-tempo li { position: relative; padding: 0 0 16px 24px; border-left: 2px solid var(--borda); margin-left: 6px; }
.linha-tempo li:last-child { border-left-color: transparent; }
.linha-tempo li::before { content: ''; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--verde); }
.linha-tempo .quando { font-size: .75rem; color: var(--texto-2); }
.linha-tempo .oque { font-size: .9rem; font-weight: 600; }
.linha-tempo .detalhe { font-size: .8rem; color: var(--texto-2); }

/* ---------- Paginação ---------- */
.pagination li.active { background-color: var(--ink); border-radius: 8px; }
.pagination li a { font-size: .9rem; }

/* ---------- Gráfico ---------- */
.grafico-box { position: relative; height: 260px; }

/* ---------- Login / instalação ---------- */
body.pagina-simples { background: var(--fundo); justify-content: center; }
.caixa-central { width: 100%; max-width: 420px; margin: 48px auto; padding: 0 16px; }
.caixa-central.larga { max-width: 720px; }
.marca-central { text-align: center; margin-bottom: 20px; }
.requisitos { margin: 0 0 16px; }
.requisitos li { display: flex; align-items: center; gap: 8px; font-size: .9rem; padding: 3px 0; }

/* ---------- Modais ---------- */
.modal { border-radius: var(--raio); max-width: 560px; }
.modal .modal-footer { border-radius: 0 0 var(--raio) var(--raio); padding: 8px 20px 16px; height: auto; }
.modal .modal-content h5 { font-size: 1.2rem; margin-top: 0; }

/* ---------- Impressão ---------- */
@media print {
    .sem-impressao { display: none !important; }
    body { background: #fff; }
}

/* Grade: linhas em flex para as colunas não "escadearem" quando um rótulo
   ocupa duas linhas (o float do Materialize desalinha nesses casos). */
.row { display: flex; flex-wrap: wrap; align-items: flex-start; margin-left: -.75rem; margin-right: -.75rem; }
.row::after { content: none; }
.row .col { float: none; margin-left: 0 !important; margin-right: 0 !important; }
.card .card-content > p.texto-2 + .row, .card .card-content > p.peq + .row { margin-top: 12px; }
.row > .secao { width: 100%; padding: 0 .75rem; }
.input-field > textarea.mono { font-family: 'IBM Plex Mono', monospace !important; font-size: .85rem !important; }
form .secao { margin-top: 22px; }
.col > .campo-copiar { margin-bottom: 18px; }

/* ---------- Rodapé (copyright + desenvolvido por) ---------- */
.rodape-global {
    display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap;
    padding: 18px 0; border-top: 1px solid var(--borda); color: var(--texto-2); font-size: .8rem;
}
.rodape-dev { display: inline-flex; align-items: center; gap: 10px; color: var(--texto-2); }
.rodape-dev:hover { color: var(--ink); }
.rodape-dev img { display: block; height: 36px; width: auto; }
.rodape-painel { padding: 0 28px 8px; }
@media only screen and (min-width: 993px) { .rodape-painel { padding-left: calc(var(--menu) + 28px); } }
@media only screen and (max-width: 992px) { .rodape-painel { padding: 0 16px 8px; } }
body.pagina-simples .rodape-global { width: 100%; max-width: 420px; margin: 0 auto 24px; padding: 16px; border-top: 0; justify-content: center; flex-direction: column; }
body.publico .rodape-global { padding: 18px 24px; background: #fff; }
@media (max-width: 600px) { .rodape-global { flex-direction: column; text-align: center; } }
/* "Meu perfil" e "Sair" no menu lateral: só no celular/tablet (no computador ficam no menu do usuário) */
.menu-renovi li.menu-sair { border-top: 0; }
.menu-renovi li.menu-sair:first-of-type { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.08); }
@media only screen and (min-width: 993px) { .menu-renovi li.menu-sair { display: none; } }

/* ---------- Pix na fatura ---------- */
.pix-box { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.pix-qr { width: 180px; height: 180px; flex: 0 0 180px; background: #fff; border: 1px solid var(--borda); border-radius: 10px; overflow: hidden; }
.pix-qr svg { display: block; width: 100%; height: 100%; }
.pix-info { flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 4px; }
.pix-valor { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; }
textarea.codigo { word-break: break-all; }
@media (max-width: 600px) { .pix-box { justify-content: center; text-align: center; } .pix-qr { width: 220px; height: 220px; flex-basis: 220px; } }
