/* ==========================================================================
   Sistema Financeiro — tema (sobre AdminLTE/Bootstrap 4)
   Fonte Inter, tokens de cor claros/escuros, cards, KPIs, tabelas e formulários.
   ========================================================================== */

/* ---------- Tokens ---------- */
body {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e4e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef2ff;
  --primary-ring: rgba(79, 70, 229, .16);

  --green: #047857;  --green-soft: #d1fae5;
  --red: #be123c;    --red-soft: #ffe4e6;
  --amber: #b45309;  --amber-soft: #fef3c7;
  --blue: #0369a1;   --blue-soft: #e0f2fe;
  --purple: #6d28d9; --purple-soft: #ede9fe;
  --orange: #c2410c; --orange-soft: #ffedd5;
  --maroon: #9f1239; --maroon-soft: #fce7f3;

  --sidebar: #0b1220;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 6px 20px rgba(15, 23, 42, .06);
}
body.dark-mode {
  --bg: #0a0f1c;
  --surface: #121a2b;
  --surface-2: #172138;
  --border: #243049;
  --text: #e8edf7;
  --muted: #94a3c0;
  --primary: #818cf8;
  --primary-hover: #a5b4fc;
  --primary-soft: rgba(129, 140, 248, .14);
  --primary-ring: rgba(129, 140, 248, .28);

  --green: #6ee7b7;  --green-soft: rgba(16, 185, 129, .16);
  --red: #fda4af;    --red-soft: rgba(244, 63, 94, .16);
  --amber: #fcd34d;  --amber-soft: rgba(245, 158, 11, .16);
  --blue: #7dd3fc;   --blue-soft: rgba(14, 165, 233, .16);
  --purple: #c4b5fd; --purple-soft: rgba(139, 92, 246, .18);
  --orange: #fdba74; --orange-soft: rgba(249, 115, 22, .16);
  --maroon: #f9a8d4; --maroon-soft: rgba(236, 72, 153, .16);

  --sidebar: #070b15;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .28);
}

/* ---------- Tipografia ---------- */
html { font-size: 14.5px; }
body, button, input, select, textarea, .main-sidebar, .nav-link, .btn, .form-control {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif !important;
}
body {
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv11', 'ss01';
}
h1, h2, h3, h4, h5, h6 { color: var(--text); letter-spacing: -.01em; }
a { color: var(--primary); }
a:hover { color: var(--primary-hover); }
strong, b { font-weight: 650; color: inherit; }
.text-muted { color: var(--muted) !important; }
.text-success { color: var(--green) !important; }
.text-danger { color: var(--red) !important; }
.text-warning { color: var(--amber) !important; }
.text-primary { color: var(--primary) !important; }
.currency-value, .table td.text-right, .kpi-value, .info-box-number {
  font-variant-numeric: tabular-nums;
}
/* Valores monetários nunca quebram */
.currency-value { white-space: nowrap !important; display: inline-block !important; }

/* ---------- Estrutura ---------- */
.wrapper, .content-wrapper { background: var(--bg) !important; }
.content-wrapper { color: var(--text); }
.container-fluid { max-width: none; width: 100%; }
.content-header { padding: .9rem 1rem .6rem; }
.content-header .container-fluid { padding: 0; }
.content-header h1 {
  font-size: 1.45rem; font-weight: 750; letter-spacing: -.02em; margin: 0; color: var(--text);
  display: flex; align-items: center; gap: .55rem;
}
.content-header h1 > i {
  width: 34px; height: 34px; border-radius: 10px; display: inline-grid; place-items: center;
  font-size: .95rem; color: var(--primary); background: var(--primary-soft); margin: 0 !important; flex: none;
}
.page-sub { color: var(--muted); font-size: .86rem; margin: .15rem 0 0 0; }
section.content { padding: 0 1rem 1rem; }
section.content > .container-fluid { padding: 0; }
.main-footer {
  background: transparent !important; border-top: 1px solid var(--border) !important;
  color: var(--muted) !important; padding: .7rem 1rem; font-size: .85rem;
}
.main-footer strong { color: var(--muted); font-weight: 600; }

/* ---------- Barra superior ---------- */
.main-header {
  background: var(--surface) !important; border-bottom: 1px solid var(--border) !important;
  min-height: 52px; box-shadow: none;
}
.main-header .nav-link {
  color: var(--muted) !important; font-size: .95rem; font-weight: 500;
  padding: .4rem .7rem; margin: 0 .1rem; border-radius: 9px; display: flex; align-items: center; gap: .45rem;
}
.main-header .nav-link:hover { background: var(--surface-2); color: var(--text) !important; }
#currencyToggle { border: 1px solid var(--border); font-weight: 650; color: var(--text) !important; }
#currencyToggle, #darkModeToggle { cursor: pointer; }
.main-header form .nav-link.btn-link { text-decoration: none; border: 0; background: transparent; }
.user-chip { display: flex; align-items: center; gap: .5rem; padding: .2rem .6rem .2rem .25rem !important; }
.user-chip .avatar {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, #6366f1, #10b981); color: #fff; font-weight: 700; font-size: .85rem;
}
.user-chip .uname { color: var(--text); font-weight: 600; }

/* ---------- Sidebar ---------- */
.main-sidebar, .main-sidebar::before { background: var(--sidebar) !important; box-shadow: none !important; }
.brand-link {
  display: flex !important; align-items: center; gap: .8rem; height: 58px; padding: 0 1rem !important;
  border-bottom: 1px solid rgba(255, 255, 255, .06) !important; background: transparent !important;
}
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, #6366f1 0%, #10b981 100%); color: #fff; font-size: .95rem;
  box-shadow: 0 6px 16px rgba(99, 102, 241, .35);
}
.brand-text { color: #fff !important; font-weight: 750 !important; font-size: 1.02rem; letter-spacing: -.02em; line-height: 1.1; }
.brand-text small { display: block; font-weight: 500; font-size: .7rem; color: #7c8aa5; letter-spacing: 0; margin-top: 2px; }
.main-sidebar .sidebar { padding: .6rem .65rem; }
.nav-sidebar .nav-header {
  color: #5b6b86; font-size: .72rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  padding: .8rem .75rem .35rem;
}
.nav-sidebar .nav-link {
  display: flex; align-items: center; gap: .15rem; border-radius: 9px !important; padding: .5rem .75rem !important;
  margin-bottom: 2px; color: #a9b6cc !important; font-size: .95rem; font-weight: 500; transition: background .15s, color .15s;
}
.nav-sidebar .nav-link .nav-icon { width: 1.5rem; font-size: .95rem; margin: 0; color: #6f7f9b; text-align: left; }
.nav-sidebar .nav-link p { margin: 0; }
.nav-sidebar .nav-link:hover { background: rgba(255, 255, 255, .06) !important; color: #fff !important; }
.nav-sidebar .nav-link.active {
  background: rgba(129, 140, 248, .18) !important; color: #fff !important; box-shadow: inset 3px 0 0 #818cf8 !important;
}
.nav-sidebar .nav-link.active .nav-icon { color: #a5b4fc; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 1rem; color: var(--text);
}
.card-header {
  background: transparent !important; border-bottom: 1px solid var(--border) !important;
  padding: .7rem 1rem; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
}
.card-header::after { display: none; }
.card-title { font-size: 1rem; font-weight: 700; color: var(--text) !important; margin: 0; float: none; letter-spacing: -.01em; }
.card-title i { color: var(--primary); margin-right: .45rem !important; }
.card-title small { font-weight: 500; }
.card-body { padding: 1rem; }
.card-body.p-0 { padding: 0 !important; }
.card-footer { background: transparent !important; border-top: 1px solid var(--border) !important; padding: .6rem 1rem; }
.card-header .btn-tool { color: var(--muted); font-weight: 600; font-size: .9rem; padding: .3rem .65rem; border-radius: 8px; }
.card-header .btn-tool:hover { background: var(--surface-2); color: var(--text); }

/* ---------- KPIs (dashboard) ---------- */
.kpi-row > [class*="col"] { display: flex; }
.kpi {
  --c: var(--primary); --c-soft: var(--primary-soft);
  flex: 1; display: flex; flex-direction: column; margin-bottom: 1rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: .85rem 1rem .8rem; transition: transform .15s, box-shadow .15s;
}
.kpi:hover { transform: translateY(-2px); }
.kpi-top { display: flex; align-items: center; gap: .65rem; }
.kpi-icon {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none;
  font-size: .95rem; background: var(--c-soft); color: var(--c);
}
.kpi-label { font-size: .84rem; font-weight: 600; color: var(--muted); line-height: 1.3; }
.kpi-value { font-size: 1.55rem; font-weight: 750; letter-spacing: -.025em; line-height: 1.15; margin-top: .55rem; color: var(--text); }
.kpi-value.neg { color: var(--red); }
.kpi-link { margin-top: .45rem; font-size: .82rem; font-weight: 600; color: var(--c); text-decoration: none; display: inline-flex; align-items: center; gap: .4rem; }
.kpi-link:hover { color: var(--c); text-decoration: underline; }
.kpi-spacer { margin-top: auto; }
.kpi-green  { --c: var(--green);  --c-soft: var(--green-soft); }
.kpi-red    { --c: var(--red);    --c-soft: var(--red-soft); }
.kpi-blue   { --c: var(--blue);   --c-soft: var(--blue-soft); }
.kpi-primary{ --c: var(--primary);--c-soft: var(--primary-soft); }
.kpi-amber  { --c: var(--amber);  --c-soft: var(--amber-soft); }
.kpi-purple { --c: var(--purple); --c-soft: var(--purple-soft); }
.kpi-orange { --c: var(--orange); --c-soft: var(--orange-soft); }
.kpi-maroon { --c: var(--maroon); --c-soft: var(--maroon-soft); }

/* Info-box (totais em Movimentações e detalhes de sócio/cliente) */
.info-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); min-height: 70px; padding: .65rem .9rem; align-items: center; color: var(--text); margin-bottom: 1rem;
}
.info-box .info-box-icon {
  width: 40px; height: 40px; border-radius: 11px; font-size: 1rem; flex: none; margin-right: .75rem;
  display: grid; place-items: center; box-shadow: none;
}
.info-box .info-box-icon.bg-success { background: var(--green-soft) !important; color: var(--green) !important; }
.info-box .info-box-icon.bg-danger  { background: var(--red-soft) !important;   color: var(--red) !important; }
.info-box .info-box-icon.bg-info    { background: var(--blue-soft) !important;  color: var(--blue) !important; }
.info-box .info-box-icon.bg-warning { background: var(--amber-soft) !important; color: var(--amber) !important; }
.info-box .info-box-content { padding: 0; line-height: 1.3; }
.info-box .info-box-text { font-size: .82rem; font-weight: 600; color: var(--muted); white-space: normal; text-transform: none; }
.info-box .info-box-number { font-size: 1.3rem; font-weight: 750; letter-spacing: -.02em; margin-top: .1rem; color: var(--text); }

/* ---------- Tabelas ---------- */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table, .table.table-sm { font-size: .93rem; color: var(--text); margin-bottom: 0; width: 100%; }
.table thead th, .table.table-sm thead th {
  background: var(--surface-2); color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; border: 0 !important; border-bottom: 1px solid var(--border) !important;
  padding: .55rem .8rem; white-space: nowrap; vertical-align: middle;
}
.table td, .table.table-sm td {
  padding: .5rem .8rem; vertical-align: middle; border-top: 1px solid var(--border) !important; color: var(--text);
}
.table tbody tr:first-child td { border-top: 0 !important; }
.table-hover tbody tr:hover { background: var(--surface-2) !important; color: var(--text); }
.table td.text-right { font-weight: 600; }
.table td strong { font-weight: 650; }
.table td small { font-size: .82rem; }
td .btn-xs, td form { margin: 0 1px; }
td.nowrap, th.nowrap { white-space: nowrap; }
td.text-center[style*="nowrap"] { white-space: nowrap; }

/* ---------- Badges ---------- */
.badge { font-weight: 650; font-size: .74rem; padding: .35em .7em; border-radius: 999px; letter-spacing: .01em; }
.badge-success { background: var(--green-soft) !important; color: var(--green) !important; }
.badge-danger  { background: var(--red-soft) !important;   color: var(--red) !important; }
.badge-warning { background: var(--amber-soft) !important; color: var(--amber) !important; }
.badge-info    { background: var(--blue-soft) !important;  color: var(--blue) !important; }
.badge-primary { background: var(--primary-soft) !important; color: var(--primary) !important; }
.badge-secondary { background: var(--surface-2) !important; color: var(--muted) !important; border: 1px solid var(--border); }

/* ---------- Botões ---------- */
.btn { border-radius: 9px; font-weight: 600; font-size: .92rem; padding: .45rem .9rem; border-width: 1px; transition: background .15s, box-shadow .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn:focus, .btn.focus { box-shadow: 0 0 0 4px var(--primary-ring) !important; }
.btn-sm, .btn-group-sm > .btn { font-size: .88rem; padding: .38rem .8rem; border-radius: 9px; line-height: 1.4; }
.btn-xs { font-size: .8rem; padding: .3rem .5rem; border-radius: 8px; line-height: 1.2; min-width: 30px; }
.btn-block { display: block; width: 100%; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover, .btn-primary:focus { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn-success { background: #059669; border-color: #059669; color: #fff; }
.btn-success:hover { background: #047857; border-color: #047857; color: #fff; }
.btn-danger { background: #e11d48; border-color: #e11d48; color: #fff; }
.btn-danger:hover { background: #be123c; border-color: #be123c; }
.btn-secondary, .btn-outline-secondary, .btn-light {
  background: var(--surface); border-color: var(--border); color: var(--text);
}
.btn-secondary:hover, .btn-outline-secondary:hover, .btn-light:hover { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.btn-outline-primary { border-color: var(--primary); color: var(--primary); background: transparent; }
.btn-outline-primary:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
/* botões de ação nas linhas: ícones suaves */
.btn-xs.btn-info      { background: var(--blue-soft);   color: var(--blue);   border-color: transparent; }
.btn-xs.btn-warning   { background: var(--amber-soft);  color: var(--amber);  border-color: transparent; }
.btn-xs.btn-danger    { background: var(--red-soft);    color: var(--red);    border-color: transparent; }
.btn-xs.btn-primary   { background: var(--primary-soft);color: var(--primary);border-color: transparent; }
.btn-xs.btn-secondary { background: var(--surface-2);   color: var(--muted);  border-color: var(--border); }
.btn-xs.btn-success   { background: var(--green-soft);  color: var(--green);  border-color: transparent; }
.btn-xs:hover { filter: brightness(.95); }
.btn-xs.btn-info:hover, .btn-xs.btn-warning:hover, .btn-xs.btn-danger:hover, .btn-xs.btn-primary:hover, .btn-xs.btn-success:hover { color: inherit; border-color: transparent; }
/* status clicável (pago/pendente) */
.btn-status { min-width: 80px; font-weight: 700; font-size: .78rem; padding: .28rem .65rem; border-radius: 999px; border: 0 !important; }
.btn-status.btn-success { background: var(--green-soft); color: var(--green); }
.btn-status.btn-warning { background: var(--amber-soft); color: var(--amber); }
.btn-status.btn-danger  { background: var(--red-soft);   color: var(--red); }
.btn-status:hover { filter: brightness(.94); }

/* ---------- Formulários ---------- */
label { font-weight: 600; font-size: .8rem; color: var(--muted); margin-bottom: .25rem; }
label i { color: var(--primary); opacity: .85; }
.form-control {
  height: 38px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-size: .93rem; padding: .35rem .75rem; box-shadow: none;
}
/* seletores com :not(textarea) para vencer a regra do Bootstrap (.input-group-sm>.form-control:not(textarea)) */
.form-control-sm, .input-group-sm > .form-control:not(textarea), .input-group-sm > .custom-select {
  height: 34px; font-size: .9rem; padding: .25rem .65rem; border-radius: 9px;
}
.input-group-sm > .input-group-append > .btn { height: 34px; padding: 0 .7rem; border-radius: 0 9px 9px 0; }
.input-group-sm > .form-control:not(:last-child):not(textarea) { border-radius: 9px 0 0 9px; }
select.form-control, select.form-control-sm { padding-right: 1.6rem; }
.form-control::placeholder { color: #94a3b8; }
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); background: var(--surface); color: var(--text); }
.form-control:disabled, .form-control[readonly] { background: var(--surface-2); }
select.form-control option { background: var(--surface); color: var(--text); }
textarea.form-control { height: auto; }
.form-check-input { accent-color: var(--primary); }
.form-check-label { font-size: .9rem; color: var(--text) !important; font-weight: 500; }
.form-control-file { font-size: .85rem; color: var(--muted); width: 100%; }
.form-control-file::file-selector-button, input[type=file]::file-selector-button {
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 8px;
  padding: .3rem .7rem; margin-right: .6rem; font-weight: 600; font-size: .85rem; cursor: pointer;
}
input[type=file]::file-selector-button:hover { background: var(--primary-soft); color: var(--primary); }
.input-group-text { background: var(--surface-2); border-color: var(--border); color: var(--muted); border-radius: 10px; }

/* ---------- Modais ---------- */
.modal-backdrop.show { opacity: .55; }
.modal-content { border: 0; border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: 0 30px 70px rgba(2, 6, 23, .35); }
.modal-header { border-bottom: 1px solid var(--border); padding: .85rem 1.15rem; align-items: center; }
.modal-title { font-size: 1.05rem; font-weight: 700; color: var(--text); }
.modal-title i { color: var(--primary); }
.modal-body { padding: 1.1rem 1.15rem; }
.modal-body .form-group { margin-bottom: .8rem; }
.modal-footer { border-top: 1px solid var(--border); padding: .7rem 1.15rem; }
.close { color: var(--muted); text-shadow: none; opacity: .8; font-weight: 400; font-size: 1.5rem; }
.close:hover { color: var(--text); opacity: 1; }

/* ---------- Alertas / callouts / paginação ---------- */
.alert { border: 0; border-radius: 10px; padding: .65rem 1rem; font-weight: 500; font-size: .92rem; }
.alert-success { background: var(--green-soft); color: var(--green); }
.alert-danger  { background: var(--red-soft);   color: var(--red); }
.alert-warning { background: var(--amber-soft); color: var(--amber); }
.alert-info    { background: var(--blue-soft);  color: var(--blue); }
.alert .close { color: inherit; top: .35rem; }
.alert .btn-light { background: rgba(255, 255, 255, .85); border: 0; color: #0f172a; }
.callout { border-radius: 12px; border: 1px solid var(--border); border-left: 4px solid var(--primary); background: var(--surface); color: var(--text); padding: .7rem 1rem; }
.callout.callout-info { border-left-color: var(--primary); }
.page-link { border-radius: 9px !important; margin: 0 2px; border: 1px solid var(--border); color: var(--text); background: var(--surface); padding: .3rem .65rem; font-size: .88rem; font-weight: 500; }
.page-link:hover { background: var(--surface-2); color: var(--text); }
.page-item.active .page-link { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-item.disabled .page-link { background: var(--surface-2); color: var(--muted); }
.card-footer small { font-size: .84rem; }
#cashFlowChart { cursor: pointer; }
hr { border-top-color: var(--border); }
code { color: var(--primary); background: var(--primary-soft); padding: .1rem .4rem; border-radius: 6px; }

/* ---------- Login ---------- */
body.auth-page { background: var(--bg); min-height: 100vh; margin: 0; }
.auth-shell { display: flex; min-height: 100vh; }
.auth-brand {
  flex: 1.05; position: relative; overflow: hidden; color: #fff; display: flex; flex-direction: column; justify-content: center;
  padding: 4rem 4.5rem; background: linear-gradient(145deg, #0b1220 0%, #1e1b4b 55%, #064e3b 120%);
}
.auth-brand::before, .auth-brand::after { content: ''; position: absolute; border-radius: 50%; filter: blur(2px); }
.auth-brand::before { width: 420px; height: 420px; right: -140px; top: -120px; background: radial-gradient(circle, rgba(99, 102, 241, .45), transparent 70%); }
.auth-brand::after { width: 460px; height: 460px; left: -160px; bottom: -180px; background: radial-gradient(circle, rgba(16, 185, 129, .35), transparent 70%); }
.auth-brand > * { position: relative; z-index: 1; }
.auth-logo { display: flex; align-items: center; gap: .9rem; margin-bottom: 3rem; }
.auth-logo .brand-mark { width: 48px; height: 48px; font-size: 1.3rem; }
.auth-logo span { font-size: 1.35rem; font-weight: 750; letter-spacing: -.02em; }
.auth-brand h2 { font-size: 2.3rem; font-weight: 750; letter-spacing: -.035em; line-height: 1.12; color: #fff; max-width: 520px; margin: 0 0 1rem; }
.auth-brand p.lead { color: #a9b6cc; font-size: 1.1rem; max-width: 480px; margin-bottom: 2.25rem; }
.auth-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.auth-points li { display: flex; align-items: center; gap: .9rem; color: #dbe4f3; font-size: 1.02rem; font-weight: 500; }
.auth-points i { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: rgba(255, 255, 255, .09); color: #a5b4fc; flex: none; }
.auth-form-wrap { flex: .95; display: flex; align-items: center; justify-content: center; padding: 2rem; background: var(--surface); }
.auth-card { width: 100%; max-width: 410px; }
.auth-card h1 { font-size: 1.9rem; font-weight: 750; letter-spacing: -.03em; margin: 0 0 .4rem; }
.auth-card .sub { color: var(--muted); margin-bottom: 2rem; }
.auth-card .form-group { margin-bottom: 1.15rem; }
.auth-card .input-icon { position: relative; }
.auth-card .input-icon > i { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: #94a3b8; }
.auth-card .input-icon .form-control { padding-left: 2.8rem; height: 52px; font-size: 1.02rem; }
.auth-card .btn-primary { height: 52px; font-size: 1.05rem; margin-top: .5rem; border-radius: 12px; }
.auth-mobile-logo { display: none; align-items: center; gap: .75rem; margin-bottom: 2rem; font-weight: 750; font-size: 1.2rem; }
@media (max-width: 900px) {
  .auth-brand { display: none; }
  .auth-mobile-logo { display: flex; }
}

/* ---------- Escuro: ajustes do AdminLTE ---------- */
body.dark-mode .content-wrapper, body.dark-mode .main-footer { background: var(--bg) !important; }
body.dark-mode .card, body.dark-mode .info-box, body.dark-mode .modal-content { background: var(--surface); color: var(--text); }
body.dark-mode .table { color: var(--text); }
body.dark-mode .table-hover tbody tr:hover { color: var(--text); }
body.dark-mode .table-striped tbody tr:nth-of-type(odd) { background: transparent; }
body.dark-mode .form-control { background: var(--surface-2); color: var(--text); }
body.dark-mode .form-control:focus { background: var(--surface-2); }
body.dark-mode .main-header .nav-link { color: var(--muted) !important; }
body.dark-mode .btn-secondary, body.dark-mode .btn-outline-secondary { background: var(--surface-2); color: var(--text); }
body.dark-mode .page-link { background: var(--surface); }
body.dark-mode .alert .btn-light { background: rgba(255, 255, 255, .12); color: var(--text); }
body.dark-mode .callout { background: var(--surface); color: var(--text); }
body.dark-mode .auth-form-wrap { background: var(--surface); }

/* ---------- Responsivo ---------- */
@media (max-width: 991.98px) {
  .content-header { padding: .75rem .75rem .5rem; }
  section.content { padding: 0 .75rem .75rem; }
}
/* telas largas: os 8 indicadores numa única linha */
@media (min-width: 1700px) {
  .kpi-row > [class*="col"] { flex: 0 0 12.5%; max-width: 12.5%; }
}
@media (max-width: 575.98px) {
  .content-header h1 { font-size: 1.25rem; }
  .kpi { padding: .7rem .8rem; }
  .kpi-value { font-size: 1.25rem; margin-top: .4rem; }
  .kpi-icon { width: 30px; height: 30px; font-size: .8rem; }
  .kpi-label { font-size: .78rem; }
  .info-box { padding: .6rem .7rem; }
  .info-box .info-box-number { font-size: 1.1rem; }
  .table td, .table.table-sm td, .table thead th, .table.table-sm thead th { padding: .5rem .55rem; }
  .card-header, .card-body { padding: .7rem .8rem; }
}

/* ---------- Gráfico de fluxo de caixa ---------- */
.kpi-hint { font-size: .72rem; font-weight: 500; color: var(--muted); opacity: .85; margin-top: 1px; }
.chart-card .card-header { align-items: flex-start; }
.chart-sub { color: var(--muted); font-size: .8rem; margin-top: .1rem; }
.chart-filters { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.year-pills { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.year-pills .btn {
  border: 0 !important; background: transparent; color: var(--muted); border-radius: 9px !important;
  padding: .28rem .8rem; font-weight: 650; font-size: .88rem;
}
.year-pills .btn:hover { color: var(--text); background: transparent; }
.year-pills .btn.active { background: var(--surface); color: var(--primary); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.chart-cat { width: auto; min-width: 180px; }
.chart-box { position: relative; height: 300px; }
.chart-box canvas { cursor: pointer; }
.chart-empty {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem;
  color: var(--muted); font-weight: 600; background: color-mix(in srgb, var(--surface) 70%, transparent); border-radius: 12px; pointer-events: none;
}
.chart-empty i { font-size: 2rem; opacity: .5; }
.chart-summary {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 1px solid var(--border);
}
.cs-item { display: flex; align-items: center; gap: .65rem; padding: .7rem 1rem; border-right: 1px solid var(--border); }
.cs-item:last-child { border-right: 0; }
.cs-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.cs-dot.cs-line { background: transparent; border: 2.5px solid var(--text); }
.cs-label { font-size: .78rem; font-weight: 600; color: var(--muted); }
.cs-value { font-size: 1.1rem; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.cs-value.neg { color: var(--red); }
@media (max-width: 991.98px) {
  .chart-summary { grid-template-columns: repeat(2, 1fr); }
  .cs-item:nth-child(2) { border-right: 0; }
  .cs-item:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .chart-box { height: 270px; }
}
@media (max-width: 575.98px) {
  .chart-cat { min-width: 0; width: 100%; }
  .chart-filters { width: 100%; }
  .cs-item { padding: .6rem .75rem; }
  .cs-value { font-size: 1rem; }
  .chart-box { height: 240px; }
}

/* ---------- Seletor de período das médias e alerta de pendências ---------- */
.kpi-period { display: flex; align-items: center; gap: .6rem; margin-bottom: .1rem; }
.kp-label { font-size: .82rem; font-weight: 600; color: var(--muted); }
.pend-alert { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem 1.25rem; margin-bottom: 1rem; }
.pend-alert i { font-size: 1rem; }
.pend-alert a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 575.98px) { .kpi-period { width: 100%; margin-top: .5rem; } .kp-label { display: none; } }
