/* SOEFinanceiro - identidade visual SOE Tecnologia (preto + verde) */
:root {
  --soe-green: #27a85a;
  --soe-green-dark: #14703a;
  --soe-green-soft: #e8f6ee;
  --soe-black: #0b0d0c;
  --soe-black-2: #151918;
  --soe-text-muted: #6b7570;
  --sidebar-w: 248px;
  --bs-primary: #27a85a;
  --bs-primary-rgb: 39, 168, 90;
  --bs-link-color: #14703a;
  --bs-link-hover-color: #0d5229;
}

body { background: #f3f5f4; font-size: .93rem; }
.btn-primary { --bs-btn-bg: var(--soe-green); --bs-btn-border-color: var(--soe-green);
  --bs-btn-hover-bg: var(--soe-green-dark); --bs-btn-hover-border-color: var(--soe-green-dark);
  --bs-btn-active-bg: var(--soe-green-dark); --bs-btn-active-border-color: var(--soe-green-dark);
  --bs-btn-disabled-bg: var(--soe-green); --bs-btn-disabled-border-color: var(--soe-green); }
.btn-outline-primary { --bs-btn-color: var(--soe-green-dark); --bs-btn-border-color: var(--soe-green);
  --bs-btn-hover-bg: var(--soe-green); --bs-btn-hover-border-color: var(--soe-green); --bs-btn-active-bg: var(--soe-green); }
.form-control:focus, .form-select:focus { border-color: var(--soe-green); box-shadow: 0 0 0 .2rem rgba(39,168,90,.2); }
.form-check-input:checked { background-color: var(--soe-green); border-color: var(--soe-green); }
.text-bg-primary { background-color: var(--soe-green) !important; }

/* ---------- layout ---------- */
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--soe-black);
  color: #cfd8d3; overflow-y: auto; z-index: 1040; display: flex; flex-direction: column; transition: transform .2s; }
.sidebar .brand { display: block; padding: .75rem .75rem .25rem; border-bottom: 1px solid #1f2623; }
.sidebar .brand img { width: 100%; height: auto; display: block; }
.sidebar .nav-section { font-size: .68rem; letter-spacing: .08em; text-transform: uppercase;
  color: #6d7a73; padding: 1rem 1.1rem .3rem; }
.sidebar .nav-link { color: #cfd8d3; padding: .5rem 1.1rem; display: flex; align-items: center; gap: .65rem;
  border-left: 3px solid transparent; }
.sidebar .nav-link:hover { background: var(--soe-black-2); color: #fff; }
.sidebar .nav-link.active { background: #112a1c; color: #fff; border-left-color: var(--soe-green); }
.sidebar .nav-link i { color: var(--soe-green); font-size: 1.05rem; }
.sidebar .sidebar-foot { margin-top: auto; padding: .8rem 1.1rem; font-size: .72rem; color: #5b6761; }

.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { background: #fff; border-bottom: 1px solid #e2e7e4; padding: .55rem 1.25rem; display: flex;
  align-items: center; gap: .75rem; position: sticky; top: 0; z-index: 1030; }
.topbar .spacer { flex: 1; }
.content { padding: 1.4rem 1.5rem 3rem; flex: 1; }
.page-title { font-size: 1.35rem; font-weight: 700; margin: 0; }
.page-sub { color: var(--soe-text-muted); }

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .main { margin-left: 0; }
  .content { padding: 1rem .8rem 3rem; }
}

/* ---------- componentes ---------- */
.card { border: 1px solid #e2e7e4; border-radius: .7rem; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.card-header { background: #fff; font-weight: 600; border-bottom: 1px solid #edf0ee; }
.kpi { position: relative; overflow: hidden; }
.kpi .kpi-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--soe-text-muted); }
.kpi .kpi-value { font-size: 1.45rem; font-weight: 700; line-height: 1.2; }
.kpi .kpi-note { font-size: .78rem; color: var(--soe-text-muted); }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--soe-green); }
.kpi.kpi-danger::before { background: #dc3545; }
.kpi.kpi-warning::before { background: #f0ad00; }
.kpi.kpi-info::before { background: #0d8bd9; }
.kpi.kpi-dark::before { background: var(--soe-black); }
.kpi-icon { position: absolute; right: .9rem; top: .8rem; font-size: 1.6rem; opacity: .13; }

.btn-hoje { background: var(--soe-black); color: #fff; border: 1px solid var(--soe-green); }
.btn-hoje:hover { background: var(--soe-green-dark); color: #fff; }
.btn-hoje .badge { background: var(--soe-green) !important; }
.btn-hoje.tem-contas { animation: pulso 2.2s ease-in-out infinite; }
@keyframes pulso { 0%,100% { box-shadow: 0 0 0 0 rgba(39,168,90,.55); } 50% { box-shadow: 0 0 0 8px rgba(39,168,90,0); } }

.banner-hoje { background: linear-gradient(100deg, var(--soe-black) 0%, #12331f 100%); color: #fff; border-radius: .8rem;
  padding: 1rem 1.3rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.banner-hoje .big { font-size: 1.5rem; font-weight: 700; }

table.table-soe thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: #5a645f;
  background: #f7f9f8; border-bottom: 1px solid #dfe5e1; white-space: nowrap; }
table.table-soe td { vertical-align: middle; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.codigo-mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .8rem; }
.chart-box { position: relative; height: 270px; }

/* barra de seleção da baixa */
.barra-baixa { position: sticky; bottom: 0; background: #fff; border-top: 2px solid var(--soe-green);
  box-shadow: 0 -4px 14px rgba(0,0,0,.08); padding: .75rem 1rem; z-index: 20; border-radius: .7rem .7rem 0 0; }

/* ---------- telas de entrada (login / setup) ---------- */
body.auth { background: radial-gradient(ellipse at top, #123a22 0%, #070908 60%); min-height: 100vh;
  display: flex; align-items: center; justify-content: center; padding: 1rem; }
.auth-box { width: 100%; max-width: 440px; }
.auth-box .logo { width: 100%; max-width: 340px; display: block; margin: 0 auto 1rem; border-radius: .6rem; }
.auth-box .card { background: rgba(14,18,16,.92); border: 1px solid #1f3a2a; color: #e8efeb; }
.auth-box .form-control { background: #0b0f0d; border-color: #2a3a31; color: #fff; }
.auth-box .form-label { color: #b8c5bd; }
.auth-box .form-text, .auth-box small { color: #8c9a92 !important; }

/* ---------- impressão (relatórios) ---------- */
.print-head { display: none; }
@page { size: A4 landscape; margin: 12mm 10mm 14mm 10mm;
  @bottom-right { content: "Página " counter(page) " de " counter(pages); font-size: 8pt; color: #555; } }

@media print {
  body { background: #fff !important; font-size: 9.5pt; color: #000; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sidebar, .topbar, .no-print, .alert, .pagination, .barra-baixa { display: none !important; }
  .main { margin: 0 !important; }
  .content { padding: 0 !important; }
  .card { border: none !important; box-shadow: none !important; }
  .print-head { display: block !important; border-bottom: 2px solid #14703a; margin-bottom: 8px; padding-bottom: 6px; }
  .print-head img { height: 46px; }
  table.rel { width: 100%; font-size: 9pt; }
  table.rel thead { display: table-header-group; }   /* repete o cabeçalho em cada página */
  table.rel tfoot { display: table-row-group; }
  table.rel tr { break-inside: avoid; page-break-inside: avoid; }
  table.rel thead th { background: #e9efeb !important; color: #000; border-bottom: 1px solid #000; }
  table.rel td, table.rel th { padding: 2px 5px !important; }
  tr.grupo-titulo td { background: #dfe9e3 !important; font-weight: 700; break-after: avoid; page-break-after: avoid; }
  tr.subtotal td { border-top: 1px solid #000; font-weight: 700; }
  tr.total-geral td { border-top: 2px solid #000; font-weight: 800; font-size: 10pt; }
  .badge { background: transparent !important; color: #000 !important; border: 1px solid #444; font-weight: 500; }
  .resumo-print { display: flex !important; gap: 18px; font-size: 9.5pt; margin-bottom: 6px; }
  a { color: inherit !important; text-decoration: none !important; }
}
