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

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", Arial, sans-serif;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  background: #f8fafc;
  color: #020617;
}

h1,
h2,
h3 {
  font-weight: 900;
  color: #020617;
}

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

button {
  cursor: pointer;
}

/* ======================================================
   LAYOUT PRINCIPAL
====================================================== */

#appSistema {
  width: 100%;
  min-height: 100vh;
}

.app {
  display: flex !important;
  width: 100% !important;
  min-height: 100vh !important;
}

.main,
main {
  flex: 1 !important;
  width: 100% !important;
  max-width: 100% !important;
  padding: 28px !important;
  overflow: auto !important;
  background: #f8fafc !important;
}

.container {
  width: 100%;
  max-width: 100%;
  padding: 20px;
  margin: 0 !important;
}

.tab-section {
  display: none !important;
  width: 100% !important;
  padding: 18px;
}

.tab-section.active {
  display: block !important;
}

/* ======================================================
   SIDEBAR PREMIUM
====================================================== */

.sidebar {
  width: 250px;
  min-height: 100vh;
  flex-shrink: 0;

  background:
    radial-gradient(circle at top left, rgba(220, 38, 38, 0.13), transparent 30%),
    linear-gradient(180deg, #09090b 0%, #111827 100%);

  border-right: 1px solid rgba(255, 255, 255, 0.06);
  padding: 22px 18px;
  box-shadow: 12px 0 40px rgba(0, 0, 0, 0.35);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;

  padding: 14px;
  margin-bottom: 24px;

  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.brand-img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  background: #ffffff;
  border-radius: 14px;
  padding: 5px;
}

.brand h2 {
  font-size: 15px;
  font-weight: 850;
  color: #ffffff;
  margin: 0;
}

.brand span {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-btn {
  width: 100%;
  height: 58px;

  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;

  background: rgba(255, 255, 255, 0.025);
  color: #ffffff;

  display: flex;
  align-items: center;
  gap: 14px;

  padding: 0 16px;

  transition: all 0.22s ease;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.10);
  transform: translateX(3px);
}

.nav-btn.active {
  background: linear-gradient(135deg, #ff3b3b 0%, #dc2626 100%);
  border: none;
  box-shadow: 0 10px 24px rgba(220, 38, 38, 0.28);
}

.nav-icon-box {
  width: 34px;
  height: 34px;

  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);

  display: flex;
  align-items: center;
  justify-content: center;

  flex-shrink: 0;
}

.nav-icon {
  font-size: 16px;
  line-height: 1;
}

.nav-label {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.2px;
}

.nav-btn.active .nav-icon-box {
  background: rgba(255, 255, 255, 0.18);
}

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

.page-head {
  margin-bottom: 20px;
}

.page-head h2 {
  font-size: 30px;
  font-weight: 950;
  letter-spacing: -0.4px;
}

.page-head p {
  color: #64748b;
  font-size: 15px;
  font-weight: 500;
}

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

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

.card {
  background: #ffffff;
  padding: 20px;
  border-radius: 18px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.045);

  display: flex;
  flex-direction: column;
  gap: 7px;

  transition: 0.2s ease;
}

.card:hover {
  transform: translateY(-3px);
}

.card span {
  font-size: 12px;
  font-weight: 800;
  color: #64748b;
}

.card strong {
  font-size: 27px;
  font-weight: 950;
  color: #020617;
}

/* ======================================================
   PANELS
====================================================== */

.panel {
  background: #ffffff;
  padding: 20px;
  border-radius: 18px;
  margin-bottom: 22px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.045);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head h3 {
  font-size: 17px;
  font-weight: 950;
}

.muted {
  font-size: 12px;
  color: #64748b;
  font-weight: 650;
}

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

button {
  background: #020617;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 800;
  transition: 0.2s ease;
}

button:hover {
  background: #1e293b;
}

.secondary-btn {
  background: #e2e8f0;
  color: #020617;
}

.secondary-btn:hover {
  background: #cbd5e1;
}

.actions-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

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

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 15px;
}

.form-grid label,
label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: #475569;
  margin-bottom: 6px;
}

.form-grid input,
.form-grid select,
input,
select {
  height: 42px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 600;
  background: #ffffff;
}

input:focus,
select:focus {
  outline: none;
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}
/* ======================================================
   TABELAS GERAIS
====================================================== */

.table-wrap {
  margin-top: 15px;
  border-radius: 14px;
  overflow: auto;
  border: 1px solid #e5e7eb;
  background: #ffffff;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  color: #64748b;
  padding: 11px;
  font-weight: 900;
  background: #f9fafb;
  white-space: nowrap;
}

td {
  padding: 11px;
  border-top: 1px solid #eef2f7;
  font-size: 14px;
  font-weight: 650;
  color: #020617;
}

tbody tr:hover {
  background: #f8fafc;
}

/* ======================================================
   GRID / CHARTS
====================================================== */

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.chart-box {
  position: relative;
  width: 100%;
  height: 340px;
  min-height: 340px;
}

.chart-box canvas {
  width: 100% !important;
  height: 100% !important;
}

.chart-box-lg {
  height: 420px;
  min-height: 420px;
}

/* ======================================================
   DASHBOARD HERO
====================================================== */

.dashboard-hero {
  width: 100%;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  padding: 28px 32px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;

  margin-bottom: 28px;

  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

.dashboard-hero-left {
  flex: 1;
}

.dashboard-hero span {
  display: block;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #dc2626;
  margin-bottom: 8px;
}

.dashboard-hero h2 {
  font-size: 42px;
  line-height: 1;
  font-weight: 950;
  color: #111827;
  margin: 0 0 10px 0;
}

.dashboard-hero p {
  margin: 0;
  font-size: 16px;
  color: #374151;
  font-weight: 500;
}

.dashboard-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}

.dashboard-filters select,
.dashboard-filters input {
  height: 48px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #111827;
  border-radius: 14px;
  padding: 0 16px;
  font-size: 15px;
  font-weight: 700;
}

.dashboard-filters select {
  min-width: 140px;
}

.dashboard-filters input {
  width: 120px;
}

.dashboard-filters button {
  height: 48px;
  border-radius: 14px;
  background: #dc2626;
  color: #ffffff;
  padding: 0 22px;
  font-size: 15px;
  font-weight: 900;
}

.dashboard-filters button:hover {
  background: #b91c1c;
  transform: translateY(-1px);
}

/* ======================================================
   DASHBOARD
====================================================== */

#tab-dashboard {
  background: #f8fafc;
}

#tab-dashboard .card strong {
  font-size: 26px;
}

#tab-dashboard .panel-head h3 {
  font-size: 16px;
  font-weight: 950;
}

.status-box {
  padding: 8px 0;
}

.status-box h2 {
  font-size: 24px;
  font-weight: 950;
}

.status-box p {
  margin-top: 4px;
  color: #64748b;
  font-weight: 600;
}

.badge-risk {
  display: inline-block;
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fee2e2;
  color: #dc2626;
  font-size: 11px;
  font-weight: 900;
}

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

.valor-entrada {
  color: #15803d;
  font-weight: 900;
}

.valor-saida {
  color: #b91c1c;
  font-weight: 900;
}

.valor-resultado {
  color: #1f2937;
  font-weight: 850;
}

.valor-saldo {
  font-weight: 950;
  font-size: 15px;
}

.valor-saldo.positivo {
  color: #166534;
}

.valor-saldo.negativo {
  color: #991b1b;
  background: #fee2e2;
  padding: 3px 6px;
  border-radius: 6px;
}

.risco {
  color: #dc2626;
  font-weight: 950;
}

.ok {
  color: #16a34a;
  font-weight: 950;
}

/* ======================================================
   TOGGLES
====================================================== */

.toggle-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toggle-bank {
  width: 100%;
  height: 42px;

  border-radius: 12px;
  border: 1px solid #dbe2ea;

  background: #f8fafc;
  color: #475569;

  font-size: 13px;
  font-weight: 850;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  transition: 0.2s ease;
}

.toggle-bank:hover {
  border-color: #dc2626;
}

.toggle-bank.active,
.toggle-bank.ativo {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
}

.toggle-icon {
  width: 18px;
  height: 18px;

  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 10px;
}

.toggle-bank.active .toggle-icon,
.toggle-bank.ativo .toggle-icon {
  background: rgba(255, 255, 255, 0.25);
}

/* ======================================================
   INPUT TABS / INSERIR DADOS
====================================================== */

.input-tabs {
  display: flex;
  gap: 10px;
  margin: 20px 0 18px;
  flex-wrap: wrap;
}

.input-tab {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #ffffff;

  font-weight: 850;
  font-size: 13px;
  color: #64748b;

  cursor: pointer;
  transition: all 0.2s ease;
}

.input-tab:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.input-tab.active {
  background: #111827;
  color: #ffffff;
  border-color: #111827;
}

.input-section {
  margin-top: 10px;
}

/* Inserir dados premium */
#tab-inserir-dados .panel {
  border-radius: 22px;
  padding: 24px;
}

#tab-inserir-dados .form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px;
  align-items: end;
}

#tab-inserir-dados label {
  font-size: 11px;
  font-weight: 850;
  color: #475569;
  margin-bottom: 6px;
}

#tab-inserir-dados input,
#tab-inserir-dados select {
  width: 100%;
  height: 42px;

  border-radius: 12px;
  border: 1px solid #dbe2ea;

  background: #ffffff;
  padding: 0 12px;

  font-size: 13px;
  font-weight: 650;
}

#tab-inserir-dados input:focus,
#tab-inserir-dados select:focus {
  outline: none;
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08);
}

#tab-inserir-dados .actions-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

#tab-inserir-dados .actions-row button {
  height: 40px;
  padding: 0 16px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 850;
}

#tab-inserir-dados .table-wrap {
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  overflow: auto;
}

#tab-inserir-dados table {
  width: 100%;
}

#tab-inserir-dados th {
  background: #f8fafc;
  font-size: 10px;
  font-weight: 950;
  color: #64748b;
  padding: 12px 10px;
}

#tab-inserir-dados td {
  padding: 10px;
  font-size: 12.5px;
  font-weight: 650;
  border-top: 1px solid #eef2f7;
}

#tab-inserir-dados tbody tr:hover {
  background: #f8fafc;
}

/* ======================================================
   TOGGLE BANK
====================================================== */

.toggle-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toggle-bank {
  width: 100%;
  height: 42px;

  border-radius: 12px;
  border: 1px solid #e5e7eb;

  background: #f8fafc;
  color: #64748b;

  font-weight: 850;
  font-size: 12px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  transition: all 0.2s ease;
}

.toggle-bank .toggle-icon {
  width: 18px;
  height: 18px;

  border-radius: 999px;
  background: #e5e7eb;
  color: transparent;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  font-size: 11px;
}

.toggle-bank:hover {
  background: #ffffff;
  border-color: #cbd5e1;
}

.toggle-bank.active,
.toggle-bank.ativo {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
}

.toggle-bank.active .toggle-icon,
.toggle-bank.ativo .toggle-icon {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

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

.valor-entrada {
  color: #15803d;
  font-weight: 900;
}

.valor-saida {
  color: #b91c1c;
  font-weight: 900;
}

.valor-resultado {
  color: #1f2937;
  font-weight: 850;
}

.valor-saldo {
  font-weight: 950;
  font-size: 15px;
}

.valor-saldo.positivo {
  color: #166534;
}

.valor-saldo.negativo {
  color: #991b1b;
  background: #fee2e2;
  padding: 3px 6px;
  border-radius: 6px;
}

.risco {
  color: #dc2626;
  font-weight: 950;
}

.ok {
  color: #16a34a;
  font-weight: 950;
}

.badge-risk {
  display: inline-block;
  margin-left: 8px;
  padding: 3px 8px;

  border-radius: 999px;

  background: #fee2e2;
  color: #dc2626;

  font-size: 11px;
  font-weight: 900;
}

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

.login-screen {
  position: fixed;
  inset: 0;
  width: 100%;
  min-height: 100vh;

  background: #f4f7fb;

  display: flex;
  align-items: center;
  justify-content: center;

  z-index: 999999;
}

.login-screen[style*="display: none"] {
  display: none !important;
}

.login-card {
  width: 380px;

  background: #ffffff;
  border-radius: 24px;
  padding: 36px;

  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);

  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  margin-bottom: 10px;
}

.login-card h1,
.login-card h2 {
  font-size: 34px;
  font-weight: 950;
  margin-bottom: 8px;
}

.login-card p {
  color: #64748b;
}

.login-card input {
  width: 100%;
  height: 52px;

  border: 1px solid #dbe2ea;
  border-radius: 14px;

  padding: 0 16px;

  font-size: 15px;
}

.login-card button {
  width: 100%;
  height: 52px;

  border-radius: 14px;

  background: #dc2626;
  color: #ffffff;

  font-weight: 950;
}

#loginErro {
  color: #dc2626;
  font-size: 13px;
  font-weight: 800;
}

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

@media (max-width: 1400px) {
  #tab-contas-pagar .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  #tab-contas-pagar .panel:first-of-type .form-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  #tab-contas-pagar .panel:nth-of-type(2) .form-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  #tab-inserir-dados .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  #tab-contas-pagar .panel:nth-of-type(2) .panel-head {
    flex-direction: column;
    align-items: flex-start;
  }

  #tab-contas-pagar .panel:nth-of-type(2) .panel-head .actions-row {
    margin-left: 0;
    flex-wrap: wrap;
  }
}

@media (max-width: 1100px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .dashboard-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .dashboard-filters {
    width: 100%;
    flex-wrap: wrap;
  }

  .sidebar {
    width: 240px;
  }
}

@media (max-width: 900px) {
  #tab-contas-pagar .panel:first-of-type .form-grid,
  #tab-contas-pagar .panel:nth-of-type(2) .form-grid,
  #tab-inserir-dados .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }

  .main {
    padding: 16px !important;
  }

  .sidebar {
    width: 220px;
    padding: 18px 14px;
  }

  .nav-label {
    font-size: 13px;
  }

  .dashboard-hero h2 {
    font-size: 30px;
  }

  .login-card {
    width: calc(100% - 32px);
    padding: 28px;
  }
/* IMPORTAR / EXPORTAR */
.cp-import-actions {
  display: flex;
  gap: 12px;
  flex-wrap: nowrap;
  align-items: center;
}

.cp-import-actions button,
.cp-import-actions .import-file-label {
  width: 180px;
  min-width: 180px;
  height: 44px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border-radius: 14px;
  font-size: 13px;
  font-weight: 850;
  text-align: center;

  padding: 0 16px;
  white-space: nowrap;
}

/* botão importar visual igual */
.cp-import-actions .import-file-label {
  background: #111827;
  color: #ffffff;
  cursor: pointer;
  border: none;
  transition: 0.2s ease;
}

.cp-import-actions .import-file-label:hover {
  background: #1f2937;
  transform: translateY(-1px);
}

/* esconder input real */
.cp-import-actions input[type="file"] {
  display: none;
}
/* ======================================================
   CONTAS A PAGAR — ERP PREMIUM
====================================================== */

#tab-contas-pagar {
  width: 100%;
  padding: 0;
}

/* HERO */

.cp-hero {
  margin-bottom: 24px;
}

.cp-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 22px;
}

.cp-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #64748b;
  margin-bottom: 8px;
}

.cp-hero h2 {
  font-size: 42px;
  font-weight: 950;
  line-height: 1;
  color: #111827;
  margin-bottom: 10px;
}

.cp-hero p {
  font-size: 15px;
  color: #64748b;
  font-weight: 500;
}

/* BOTÕES HERO */

.cp-hero-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.cp-btn {
  height: 42px;
  min-width: 150px;
  padding: 0 18px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 850;
  border: none;
  cursor: pointer;
  transition: 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.cp-btn-primary {
  background: linear-gradient(135deg, #111827, #0f172a);
  color: white;
}

.cp-btn-primary:hover {
  transform: translateY(-1px);
}

.cp-btn-secondary {
  background: #e2e8f0;
  color: #111827;
}

.cp-btn-outline {
  background: white;
  color: #111827;
  border: 1px solid #dbe2ea;
}

.cp-btn-outline:hover {
  background: #f8fafc;
}

/* KPIs */

.cp-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.cp-kpi {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 22px;
  padding: 24px;
  min-height: 128px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);

  display: flex;
  flex-direction: column;
  justify-content: center;
}

.cp-kpi span {
  font-size: 12px;
  color: #64748b;
  font-weight: 800;
}

.cp-kpi strong {
  font-size: 38px;
  font-weight: 950;
  color: #111827;
  margin: 8px 0;
}

.cp-kpi small {
  font-size: 13px;
  color: #94a3b8;
  font-weight: 600;
}

/* CARDS */

.cp-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 26px;
  padding: 28px;
  margin-bottom: 22px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.045);
}

.cp-card-head {
  margin-bottom: 22px;
}

.cp-card-head-space {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.cp-card-head h3 {
  font-size: 24px;
  font-weight: 950;
  color: #111827;
  margin-bottom: 4px;
}

.cp-card-head p {
  font-size: 14px;
  color: #64748b;
}

/* FORM */

.cp-form-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  align-items: end;
}

.cp-field {
  display: flex;
  flex-direction: column;
}

.cp-field-wide {
  grid-column: span 3;
}

.cp-field label {
  font-size: 12px;
  font-weight: 850;
  color: #475569;
  margin-bottom: 8px;
}

.cp-field input {
  height: 48px;
  width: 100%;
  border: 1px solid #dbe2ea;
  border-radius: 14px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 650;
  background: white;
}

.cp-field input:focus {
  outline: none;
  border-color: #dc2626;
  box-shadow: 0 0 0 4px rgba(220,38,38,.08);
}

/* TOGGLES */

.cp-toggle {
  height: 48px;
  border-radius: 14px;
  border: 1px solid #dbe2ea;
  background: #f8fafc;
  padding: 0 16px;

  display: flex;
  align-items: center;
  gap: 10px;

  font-size: 13px;
  font-weight: 850;
  color: #64748b;
}

.cp-toggle.active,
.cp-toggle.ativo {
  background: #dc2626;
  border-color: #dc2626;
  color: white;
}

.toggle-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #cbd5e1;
}

.cp-toggle.active .toggle-dot,
.cp-toggle.ativo .toggle-dot {
  background: white;
}

/* ACTIONS */

.cp-form-actions {
  display: flex;
  gap: 12px;
  margin-top: 22px;
}

/* FILTROS */

.cp-filter-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 22px;
}

.cp-filter-action {
  display: flex;
}

/* TABLE ACTIONS */

.cp-table-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* TABELA */

.cp-table-wrap {
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  overflow: auto;
  max-height: 650px;
}

.cp-table {
  width: 100%;
  min-width: 1400px;
  border-collapse: collapse;
}

.cp-table thead th {
  position: sticky;
  top: 0;
  z-index: 10;

  background: #f8fafc;
  padding: 14px 12px;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  color: #64748b;
  border-bottom: 1px solid #e5e7eb;
}

.cp-table tbody td {
  padding: 14px 12px;
  border-top: 1px solid #eef2f7;
  font-size: 13px;
  font-weight: 650;
  color: #111827;
}

.cp-table tbody tr:hover {
  background: #f8fafc;
}

.cp-table td:last-child {
  white-space: nowrap;
}

/* STATUS */

.doc-status {
  padding: 6px 10px;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 900;
  margin-right: 4px;
}

.doc-status.ok {
  background: #dcfce7;
  color: #166534;
}

.doc-status.pendente {
  background: #fee2e2;
  color: #991b1b;
}

/* BOTÕES TABELA */

.btn-editar,
.btn-duplicar,
.btn-pagar,
.btn-excluir {
  padding: 6px 10px;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 900;
  margin-right: 4px;
}

.btn-editar {
  background: #dbeafe;
  color: #1d4ed8;
}

.btn-duplicar {
  background: #ede9fe;
  color: #5b21b6;
}

.btn-pagar {
  background: #dcfce7;
  color: #166534;
}

.btn-excluir {
  background: #fee2e2;
  color: #991b1b;
}

/* RESPONSIVO */

@media (max-width: 1400px) {
  .cp-kpis {
    grid-template-columns: repeat(2, 1fr);
  }

  .cp-form-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cp-field-wide {
    grid-column: span 2;
  }

  .cp-filter-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cp-card-head-space {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 768px) {
  .cp-kpis,
  .cp-form-grid,
  .cp-filter-grid {
    grid-template-columns: 1fr;
  }

  .cp-field-wide {
    grid-column: span 1;
  }

  .cp-hero-top {
    flex-direction: column;
  }

  .cp-table-actions {
    width: 100%;
    flex-direction: column;
  }

  .cp-btn {
    width: 100%;
  }
}
/* ======================================================
   MOBILE APP MENU
====================================================== */

.mobile-topbar {
  display: none;
}

.mobile-menu-overlay {
  display: none;
}

@media (max-width: 900px) {
  .app {
    display: block !important;
  }

  .main,
  main {
    padding: 14px !important;
    padding-top: 82px !important;
  }

  .mobile-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;

    height: 66px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;

    display: flex;
    align-items: center;
    gap: 12px;

    padding: 0 14px;
    z-index: 9998;

    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  }

  .mobile-menu-btn {
    width: 44px;
    height: 44px;

    border-radius: 14px;
    background: #111827;
    color: #ffffff;

    font-size: 22px;
    font-weight: 900;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;
  }

  .mobile-topbar strong {
    display: block;
    color: #111827;
    font-size: 14px;
    font-weight: 900;
    line-height: 1.1;
  }

  .mobile-topbar span {
    display: block;
    color: #dc2626;
    font-size: 12px;
    font-weight: 800;
    margin-top: 3px;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: -285px;

    width: 270px !important;
    height: 100vh;
    min-height: 100vh;

    z-index: 10000;

    transition: left 0.28s ease;
  }

  .sidebar.mobile-open {
    left: 0;
  }

  .mobile-menu-overlay {
    position: fixed;
    inset: 0;

    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(2px);

    display: none;
    z-index: 9999;
  }

  .mobile-menu-overlay.active {
    display: block;
  }

  .brand {
    margin-top: 6px;
  }

  .sidebar-nav,
  .menu {
    margin-top: 18px;
  }

  .nav-btn {
    height: 54px;
    border-radius: 16px;
  }

  .nav-label {
    font-size: 14px;
  }

  .tab-section {
    padding: 0 !important;
  }
}
