* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --surface: #ffffff;

  --menu-bg: #ffffff;
  --menu-border: #e2e8f0;
  --menu-hover: rgba(46, 91, 255, 0.08);

  --abc-a: #5c87f5;
  --abc-b: #1f5baf;
  --abc-c: #0d213f;

  --primary: #034C8C;
  --primary-hover: #1e40af;
  --primary-contrast: #ffffff;
  --primary-soft: rgba(46, 91, 255, 0.12);

  --success: #16a34a;
  --danger: #dc2626;

  --input-bg: #ffffff;
  --input-border: #cbd5e1;
  --input-placeholder: #94a3b8;

  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.dark-mode {
  --bg: #0b1220;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-2: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.14);
  --text: #f8fafc;
  --text-2: rgba(248, 250, 252, 0.88);
  --muted: rgba(248, 250, 252, 0.72);

  --menu-bg: #0f172a;
  --menu-border: rgba(255, 255, 255, 0.16);
  --menu-hover: rgba(147, 197, 253, 0.14);

  --primary: #93c5fd;
  --primary-hover: #60a5fa;
  --primary-contrast: #0b1220;
  --primary-soft: rgba(147, 197, 253, 0.12);

  --success: #22c55e;
  --danger: #f87171;

  --input-bg: rgba(255, 255, 255, 0.08);
  --input-border: rgba(255, 255, 255, 0.18);
  --input-placeholder: rgba(248, 250, 252, 0.60);

  --shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

html.dark-mode {
  color-scheme: dark;
}

body.dark-mode {
  color-scheme: dark;
}

html[data-bs-theme="dark"] {
  color-scheme: dark;
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-secondary-color: var(--muted);
  --bs-tertiary-color: var(--text-2);
  --bs-border-color: var(--border);
  --bs-tertiary-bg: var(--surface);
  --bs-secondary-bg: var(--surface);

  --bs-card-bg: var(--surface);
  --bs-card-cap-bg: var(--surface-2);

  --bs-modal-bg: var(--menu-bg);
  --bs-modal-color: var(--text);
  --bs-modal-border-color: var(--menu-border);

  --bs-form-control-bg: var(--input-bg);
  --bs-form-control-color: var(--text);
  --bs-form-control-border-color: var(--input-border);
  --bs-form-control-placeholder-color: var(--input-placeholder);
  --bs-form-select-bg: var(--input-bg);
  --bs-form-select-color: var(--text);
  --bs-form-select-border-color: var(--input-border);

  --bs-dropdown-bg: var(--menu-bg);
  --bs-dropdown-color: var(--text);
  --bs-dropdown-border-color: var(--menu-border);
  --bs-dropdown-link-color: var(--text);
  --bs-dropdown-link-hover-color: var(--text);
  --bs-dropdown-link-hover-bg: var(--menu-hover);
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  margin: 0;
  padding: 0;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  color: var(--primary-hover);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text);
}

.help-wpp-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.help-contact-card {
  display: flex;
  gap: 12px;
  padding: 14px;
  height: 100%;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.help-contact-card:hover {
  transform: translateY(-1px);
  border-color: rgba(46, 91, 255, 0.35);
  background: var(--surface-2);
  color: var(--text);
}

.dark-mode .help-contact-card:hover {
  border-color: rgba(147, 197, 253, 0.35);
}

.help-contact-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  color: var(--primary);
  flex: 0 0 auto;
}

.help-contact-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.help-contact-text {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.25;
}

.help-map {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}

.abc-table th {
  font-size: 13px;
  font-weight: 600;
}

.abc-table td {
  font-size: 13px;
}

.abc-summary-header {
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

.abc-summary-header.abc-a {
  background: var(--abc-a);
  color: #ffffff;
}

.abc-summary-header.abc-b {
  background: var(--abc-b);
  color: #ffffff;
}

.abc-summary-header.abc-c {
  background: var(--abc-c);
  color: #ffffff;
}

.abc-kpi {
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.abc-kpi.abc-a {
  color: var(--abc-a);
}

.abc-kpi.abc-b {
  color: var(--abc-b);
}

.abc-kpi.abc-c {
  color: var(--abc-c);
}

.abc-row {
  border-left: 3px solid transparent;
}

.abc-row.abc-a {
  border-left-color: var(--abc-a);
}

.abc-row.abc-b {
  border-left-color: var(--abc-b);
}

.abc-row.abc-c {
  border-left-color: var(--abc-c);
}

.abc-table tbody tr.abc-row.abc-a {
  background-color: rgba(55, 79, 138, 0.10) !important;
}

.abc-table tbody tr.abc-row.abc-b {
  background-color: rgba(58, 75, 99, 0.08) !important;
}

.abc-table tbody tr.abc-row.abc-c {
  background-color: rgba(65, 75, 90, 0.08) !important;
}

.dark-mode .abc-row.abc-b {
  border-left-color: var(--abc-b);
}

.dark-mode .abc-row.abc-c {
  border-left-color: var(--abc-c);
}

.dark-mode .abc-table tbody tr.abc-row.abc-a {
  background-color: rgba(55, 79, 138, 0.22) !important;
}

.dark-mode .abc-table tbody tr.abc-row.abc-b {
  background-color: rgba(58, 75, 99, 0.20) !important;
}

.dark-mode .abc-table tbody tr.abc-row.abc-c {
  background-color: rgba(65, 75, 90, 0.18) !important;
}

.abc-badge {
  border: 1px solid var(--border);
  font-weight: 600;
}

.abc-badge.abc-a {
  background: var(--abc-a);
  border-color: var(--abc-a);
  color: #ffffff;
}

.abc-badge.abc-b {
  background: var(--abc-b);
  border-color: var(--abc-b);
  color: #ffffff;
}

.abc-badge.abc-c {
  background: var(--abc-c);
  border-color: var(--abc-c);
  color: #ffffff;
}

.abc-filters .form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

.abc-filters .form-control,
.abc-filters .form-select {
  font-size: 14px;
}

body.dark-mode {
  background-color: var(--bg);
  color: var(--text);
}


/* ========== SUBMENU STYLES ========== */
.nav-item.has-submenu {
  position: relative;
}

.nav-item.has-submenu>.nav-link {
  justify-content: flex-start;
}

.submenu-arrow {
  margin-left: auto;
  transition: transform 0.2s ease;
}

.nav-item.has-submenu.open>.nav-link .submenu-arrow {
  transform: rotate(90deg);
}

.submenu {
  display: none;
  list-style: none;
  padding: 0;
  margin: 0;
  padding-left: 32px;
  overflow: hidden;
}

.nav-item.has-submenu.open>.submenu {
  display: block;
}

.submenu .nav-item {
  margin-bottom: 2px;
}

.submenu .nav-link {
  padding: 8px 16px;
  font-size: 13px;
  border-left: 2px solid transparent;
}

.submenu .nav-link:hover {
  background: var(--surface-2);
  color: var(--primary);
}

.submenu .nav-item.active .nav-link {
  background: var(--primary-soft);
  color: var(--primary);
  border-left-color: var(--primary);
}

#sidebar .sub-menu {
  display: grid;
  grid-template-rows: 0fr;
  transition: 300ms ease-in-out;
}

#sidebar .sub-menu>div {
  overflow: hidden;
}

#sidebar .sub-menu.show {
  grid-template-rows: 1fr;
}

#sidebar .sub-menu a {
  padding-left: 2em;
}

/* Arrow rotation */
.dropdown-btn svg.arrow {
  transition: transform 200ms ease;
}

.dropdown-btn.rotate svg.arrow {
  transform: rotate(180deg);
}

/* Toggle button */
#toggle-btn {
  margin-left: auto;
  padding: 0.5em;
  border: none;
  border-radius: 0.5em;
  background: none;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

#toggle-btn:hover {
  background-color: var(--surface-2);
}

#toggle-btn svg {
  transition: transform 150ms ease;
}

#toggle-btn.rotate svg {
  transform: rotate(180deg);
}

/* Hide text when closed */
#sidebar.close .logo,
#sidebar.close a span,
#sidebar.close .dropdown-btn span,
#sidebar.close .dropdown-btn svg.arrow {
  display: none;
}

#sidebar.close #toggle-btn {
  margin: 0 auto;
}



.dark-mode .sidebar {
  background: var(--surface);
  border-right-color: var(--border);
}

.nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.dark-mode .nav {
  background: var(--surface);
  border-bottom-color: var(--border);
}

.dark-mode .page-title,
.dark-mode .logo-title,
.dark-mode .user-name {
  color: var(--text);
}

.dark-mode .logo-subtitle {
  color: var(--muted);
}

.dark-mode .nav-link {
  color: var(--muted);
}

.dark-mode .nav-link:hover {
  background: var(--surface-2);
  color: var(--primary);
}

.dark-mode .nav-item.active .nav-link {
  background: var(--primary-soft);
  color: var(--primary);
  border-left-color: var(--primary);
}

.dark-mode .pesquisar {
  background: var(--surface-2);
  border-color: var(--border);
}

.dark-mode .search-input {
  color: var(--text);
}

.dark-mode .card,
.dark-mode .formularioget,
.dark-mode .grafico_container {
  background: var(--surface);
  border-color: var(--border);
}

.dark-mode .dropdown-content {
  background: var(--menu-bg);
  border-color: var(--menu-border);
}

.dark-mode .card-header {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.dark-mode .lead {
  color: var(--muted);
}

.dark-mode .dropdown-content a {
  color: var(--text);
}

.dark-mode .dropdown-content a:hover {
  background-color: var(--surface-2);
  color: var(--primary);
}

.dark-mode .form-control:disabled,
.dark-mode .form-select:disabled,
html[data-bs-theme="dark"] .form-control:disabled,
html[data-bs-theme="dark"] .form-select:disabled {
  background-color: rgba(255, 255, 255, 0.04) !important;
  border-color: var(--input-border) !important;
  color: var(--text-2) !important;
  opacity: 1;
}

.dark-mode .form-control,
.dark-mode .form-select {
  background-color: var(--input-bg);
  border-color: var(--input-border);
  color: var(--text);
}

.dark-mode .form-control::placeholder {
  color: var(--input-placeholder);
}

.dark-mode select,
.dark-mode option {
  background-color: var(--menu-bg) !important;
  color: var(--text) !important;
}

html[data-bs-theme="dark"] .form-control,
html[data-bs-theme="dark"] .form-select {
  background-color: var(--input-bg) !important;
  border-color: var(--input-border) !important;
  color: var(--text) !important;
}

html[data-bs-theme="dark"] .form-control::placeholder {
  color: var(--input-placeholder) !important;
}

html[data-bs-theme="dark"] select,
html[data-bs-theme="dark"] option {
  background-color: var(--menu-bg) !important;
  color: var(--text) !important;
}

html[data-bs-theme="dark"] .form-select {
  background-color: var(--input-bg) !important;
  border-color: var(--input-border) !important;
  color: var(--text) !important;
}

html[data-bs-theme="dark"] .form-select option {
  background-color: var(--menu-bg) !important;
  color: var(--text) !important;
}

.dark-mode .dropdown-menu {
  background-color: var(--menu-bg);
  border-color: var(--menu-border);
  color: var(--text);
  box-shadow: var(--shadow);
}

.dark-mode .dropdown-item {
  color: var(--text);
}

.dark-mode .dropdown-item:hover,
.dark-mode .dropdown-item:focus {
  background-color: var(--menu-hover);
  color: var(--text);
}

.dark-mode .modal-content {
  background-color: var(--menu-bg);
  border-color: var(--menu-border);
  color: var(--text);
}

.dark-mode .modal-header,
.dark-mode .modal-footer {
  border-color: var(--menu-border);
}

.card,
.formularioget,
.grafico_container {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.card-header {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.lead {
  color: var(--muted);
}

.form-label {
  color: var(--text-2);
}

.form-control,
.form-select {
  background-color: var(--input-bg);
  border-color: var(--input-border);
  color: var(--text);
}

.form-control::placeholder {
  color: var(--input-placeholder);
}

.list-group-item {
  background-color: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.text-muted {
  color: var(--muted) !important;
}

.text-success {
  color: var(--success) !important;
}

.text-danger {
  color: var(--danger) !important;
}

.progress {
  background-color: rgba(100, 116, 139, 0.18);
}

.dark-mode .progress {
  background-color: rgba(255, 255, 255, 0.14);
}

.progress-bar {
  background-color: var(--primary);
}

.table {
  color: var(--text);
}

.table th,
.table td {
  font-size: 0.96rem;
}

.table thead th {
  font-size: 0.96rem;
  font-weight: 600;
}

.table thead th {
  color: var(--text-2);
}

.table td,
.table th {
  border-color: var(--border);
}

.dark-mode .thead-dark th {
  background-color: var(--surface-2);
  color: var(--text-2);
  border-color: var(--border);
}

.dark-mode .table {
  --bs-table-color: var(--text);
  --bs-table-bg: transparent;
  --bs-table-border-color: var(--border);
  --bs-table-striped-bg: rgba(255, 255, 255, 0.04);
  --bs-table-striped-color: var(--text);
  --bs-table-active-bg: rgba(255, 255, 255, 0.06);
  --bs-table-active-color: var(--text);
  --bs-table-hover-bg: rgba(147, 197, 253, 0.10);
  --bs-table-hover-color: var(--text);
}

.dark-mode .table-primary {
  --bs-table-bg: rgba(147, 197, 253, 0.14);
  --bs-table-color: var(--text);
}

.dark-mode .table-warning {
  --bs-table-bg: rgba(250, 204, 21, 0.14);
  --bs-table-color: var(--text);
}

.dark-mode .table-secondary {
  --bs-table-bg: rgba(148, 163, 184, 0.14);
  --bs-table-color: var(--text);
}

.dark-mode .bg-light {
  background-color: var(--surface) !important;
}

.dark-mode .btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
  color: var(--primary-contrast);
}

.dark-mode .btn-primary:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  color: var(--primary-contrast);
}

.dark-mode .btn-outline-secondary,
.dark-mode .btn-outline-success {
  border-color: var(--border);
  color: var(--text);
}

.dark-mode .btn-outline-secondary:hover,
.dark-mode .btn-outline-success:hover {
  background-color: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}


.container_dash {
  display: block;
  min-height: 100vh;
  position: relative;
}


.sidebar {
  width: 240px;
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  z-index: 100;
  background-color: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;

}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 24px 0;
}

.sidebar-nav a {
  text-decoration: none;
  color: var(--muted);
}

.sidebar-nav a:hover {
  color: var(--primary);
}

.nav-section {
  margin-bottom: 32px;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0 20px;
  display: block;
  margin-bottom: 12px;
}

.sidebar-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-item {
  margin-bottom: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.nav-link:hover {
  background: var(--surface-2);
  color: var(--primary);
}

/* mexer nas variaveis de cor */
.nav-item.active .nav-link {
  background: var(--primary-soft);
  color: var(--primary);
  border-left-color: var(--primary);
}

.nav-link svg {
  width: 20px;
  height: 20px;
}

/* ========== MAIN CONTENT ========== */
.main-content {
  flex: 1;
  margin-left: 240px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ========== NAV (HEADER) ========== */
.nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
  height: auto;
  min-height: 70px;
}

.nav-spacer {
  flex: 1;
}

.pesquisar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 16px;
  width: 400px;
  height: 42px;
  margin-left: 0;
  margin-top: 0;
}

.search-input {
  border: none;
  background: transparent;
  outline: none;
  flex: 1;
  font-size: 14px;
  color: var(--text);
  font-family: "Inter", sans-serif;
}

.search-input::placeholder {
  color: var(--input-placeholder);
}

.nav-block {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: 0;
}

.notification-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--muted);
  border-radius: 8px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-btn:hover {
  background: var(--surface-2);
  color: var(--primary);
}

.nav-page {
  display: flex;
  align-items: center;
  /* Centraliza verticalmente */
  justify-content: flex-end;
  /* Joga tudo para a direita (opcional) */
  gap: 10px;
  /* Espaço entre o avatar e o nome */
  padding: 10px 20px;
}

.nav-page:hover {
  background: var(--surface-2);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  /* 🔥 ESSENCIAL */
  color: var(--primary-contrast);
  font-weight: 600;
  font-size: 14px;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* 🔥 ESSENCIAL */
  border-radius: 50%;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.nav a {
  text-decoration: none;
}

.nav a:hover {
  text-decoration: none;
  color: var(--primary);
}

/* ========== PAGE CONTENT ========== */
.page-content {
  flex: 1;
  padding: 32px;
}

.page-title {
  font-size: 28px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 24px 0;
}

/* ========== FORMULÁRIO ========== */
.relatorios-page {
  width: 100%;
}

.formularioget {
  background: var(--surface);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  margin-left: 0;
  margin-top: 0;
}

.formularioget form {
  width: 100%;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
}

.form-group {
  display: flex;
  flex-direction: column;
  min-width: 200px;
  flex: 1;
}

.formularioget label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 8px;
}

.formularioget select,
.formularioget input[type="date"] {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  background: var(--input-bg);
  font-family: "Inter", sans-serif;
  transition: all 0.2s;
}

.formularioget select:focus,
.formularioget input[type="date"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(46, 91, 255, 0.12);
}

.formularioget select:hover,
.formularioget input[type="date"]:hover {
  border-color: var(--input-border);
}

#botao_enviar {
  padding: 10px 24px;
  background: var(--primary);
  color: var(--primary-contrast);
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "Inter", sans-serif;
  height: 42px;
}

#botao_enviar:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(46, 91, 255, 0.3);
}

#botao_enviar:active {
  transform: translateY(0);
}

/* ========== CONTAINERS DE GRÁFICOS ========== */
.grafico_container {
  background: var(--surface);
  border-radius: 12px;
  padding: 32px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: none;
  flex-direction: column;
  align-items: center;
  margin-bottom: 32px;
  margin-left: 0;
  margin-top: 0;
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  max-height: 90vh;
  overflow-y: auto;
}

.btn-outline-primary {
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline-primary:hover {
  background-color: var(--primary);
  border-color: var(--primary);
  color: var(--primary-contrast);
}

#containerVendas,
#containerVendedores,
#containerRenda,
#containerProdutos,
#containerFormasPagamento,
#containerClientes,
#containerFornecedores,
#containerContasPagar,
#containerContasReceber {
  margin-left: 0;
  margin-top: 0;
}

.grafico-header {
  width: 100%;
  margin-bottom: 24px;
}

.grafico-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 16px;
}

.grafico-header-top>div:first-child {
  text-align: center;
  flex: 1;
}

.grafico-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px 0;
}

.grafico-subtitle {
  font-size: 14px;
  color: var(--muted);
}

/* Botão de atualizar */
.btn-atualizar {
  padding: 10px 24px;
  background: var(--primary);
  color: var(--primary-contrast);
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "Inter", sans-serif;
  height: 42px;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn-atualizar:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(46, 91, 255, 0.3);
}

.btn-atualizar:active {
  transform: translateY(0);
}

.btn-atualizar:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-atualizar::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-atualizar:active::before {
  width: 300px;
  height: 300px;
}

.btn-atualizar svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}


.clientes {
  color: var(--primary);
}


@media (max-width: 1200px) {
  .pesquisar {
    width: 300px;
  }
}

@media (max-width: 1024px) {
  .form-row {
    flex-direction: column;
    align-items: stretch;
  }

  .form-group {
    min-width: 100%;
  }

  #botao_enviar {
    width: 100%;
    justify-content: center;
  }

  .grafico_container {
    padding: 20px;
  }

  .btn-atualizar {
    width: 100%;
    justify-content: center;
  }

  .canvas-wrapper {
    height: 480px;
    max-height: 480px;
  }

  .canvas-wrapper canvas {
    max-height: 480px !important;
  }

  #GraficoVendas,
  #GraficoVendedores,
  #GraficoRenda,
  #GraficoProdutos,
  #GraficoFormasPagamento,
  #GraficoClientes,
  #GraficoFornecedores,
  #GraficoContasPagar,
  #GraficoContasReceber {
    max-width: 100%;
    max-height: 100%;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s;
  }

  .main-content {
    margin-left: 0;
  }

  .nav {
    padding: 12px 16px;
  }

  .pesquisar {
    width: 180px;
  }

  .user-name {
    display: none;
  }

  .page-content {
    padding: 16px;
  }

  .page-title {
    font-size: 24px;
  }

  .formularioget {
    padding: 16px;
  }

  .grafico-header-top {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .grafico-header-top>div:first-child {
    text-align: center;
  }

  .btn-atualizar {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .pesquisar {
    width: 120px;
  }

  .search-input {
    font-size: 12px;
  }

  .notification-btn {
    padding: 6px;
  }

  .user-avatar {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }
}

.relatorios-page {
  width: 100%;
}

.canvas-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 0;
  width: 100%;
  height: 600px;
  max-height: 600px;
  position: relative;
  overflow: hidden;
}

.canvas-wrapper canvas {
  max-width: 100% !important;
  max-height: 600px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain;
}

.grafico_container:not([style*="display: flex"]):not([style*="display: block"]) {
  display: none !important;
}

.grafico_container[style*="display: flex"],
.grafico_container[style*="display: block"] {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


.formularioget select:hover,
.formularioget input[type="date"]:hover {
  border-color: var(--muted);
}


.formularioget select:focus,
.formularioget input[type="date"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

/* Estilo para o botão  */
#botao_enviar {
  position: relative;
  overflow: hidden;
}

#botao_enviar::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

#botao_enviar:active::before {
  width: 300px;
  height: 300px;
}

/* Responsividade  */
@media (max-width: 768px) {
  .canvas-wrapper {
    height: 500px;
    max-height: 500px;
    overflow-x: auto;
    width: 100%;
  }

  .canvas-wrapper canvas {
    max-height: 500px !important;
  }

  #GraficoVendas,
  #GraficoVendedores,
  #GraficoRenda,
  #GraficoProdutos,
  #GraficoFormasPagamento,
  #GraficoClientes,
  #GraficoFornecedores,
  #GraficoContasPagar,
  #GraficoContasReceber {
    max-width: 100%;
    max-height: 100%;
  }

  .table th,
  .table td {
    font-size: 0.94rem;
  }
}

@media (max-width: 480px) {
  .grafico-header {
    padding: 0 10px;
  }

  .grafico-title {
    font-size: 18px;
  }

  .grafico-subtitle {
    font-size: 12px;
  }

  .table th,
  .table td {
    font-size: 0.92rem;
  }
}

#formuser select,
#formuser input[type="date"] {
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  background: var(--input-bg);
  font-family: "Inter", sans-serif;
  transition: all 0.2s;
}


.dropdown {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

.user-name {
  font-family: 'Segoe UI', sans-serif;
  font-size: 14px;
  color: var(--text);
  user-select: none;
  /* Impede selecionar o texto ao clicar */
}

.arrow-down {
  font-size: 10px;
  margin-left: 5px;
  color: var(--muted);
  display: inline-block;
  /* IMPORTANTE */
  transition: transform 0.2s;
}



.user-trigger.active .arrow-down {
  transform: rotate(180deg);
}


.dropdown-content {
  display: block;
  position: absolute;
  top: 100%;
  right: 0;
  padding-top: 10px;

  background-color: var(--menu-bg);
  min-width: 180px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  border: 1px solid var(--menu-border);

  z-index: 1000;
  overflow: hidden;
  animation: fadeIn 0.2s ease-in-out;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  transition-delay: 0.1s;
}

.dropdown:hover .dropdown-content {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0s;
  /* Aparece instantaneamente quando entra */
}




@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


.dropdown-content a {
  color: var(--text);
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  font-size: 14px;
  font-family: sans-serif;
  transition: background 2s;
}

.dropdown-content a:hover {
  background-color: #f5f7fa;
  color: #0056b3;
}


.dropdown-content #sair-btn {

  width: 40px;
  margin-left: 20px;
  color: white;
  border: none;
  border-radius: 10px;
  background-color: #d32f2f;

}

.dropdown-content .sair-btn:hover {
  background-color: #c94256;
}


.divider {
  height: 1px;
  background-color: #e0e0e0;
  margin: 4px 0;
}

.dropdown-header {
  padding: 8px 16px;
  font-size: 11px;
  color: #999;
  text-transform: uppercase;
  font-weight: bold;
  letter-spacing: 0.5px;
}

.dropdown:hover .dropdown-content {
  display: block;
}

.main-login-container {
  width: 100%;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background-image: url('/media/logo/bg_login.png');
  background-size: cover;
  background-position: center;
  padding: 20px 0 20px 20px;
  box-sizing: border-box;

  overflow: hidden;
}

.bloco_apresentacao {
  align-items: center;
  justify-content: center;
  padding: 30px;
  color: #fff;
}

.titulo_apresentacao h2 {

  color: #eeeeee;
  padding-left: 100px;
}

.subtitulo_apresentacao h4 {

  color: #eeeeee;
  margin-top: 20px;
  padding-left: 100px;
}

hr {
  padding-left: 300px;
}

.logo_white {

  margin-top: 20px;
  padding-left: 200px;
}

.bloco_login_externo {
  background-color: #ffffff;
  width: 80%;
  max-width: 600px;
  height: 92vh;
  border-radius: 10px 0 0 10px;
  padding-left: 100px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin-left: auto;

  position: relative;

}

.bloco_login {
  background-color: #ffffff;

  padding: 2.5rem;
  border: 1px solid #d3d3d3;
  border-radius: 12px;

  max-height: 400px;
  width: 100%;
  max-width: 400px;
  text-align: left;


}


.bloco_selecionar_empresa {
  background-color: #ffffff;

  padding: 2.5rem;
  border: 1px solid #d3d3d3;
  border-radius: 12px;


  width: 100%;
  max-width: 400px;
  text-align: left;


}


#label_login {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}


.user_login,
.senha_login {
  margin-bottom: 1.2rem;
  text-align: left;
  transform: translateX(10px);
}



.bloco_dashboard .label_dashboard {
  padding-left: 8px;
  font-weight: 700;

}

.bloco_dashboard .label_subdashboard {
  font-weight: 400;
  padding-left: 8px;
  font-size: 15px;

}


#label_email {
  color: #4e4e50;
  display: flex;
  text-transform: uppercase;
  font-size: 10px;

}

#label_senha {
  color: #4f4f50;
  display: flex;
  text-transform: uppercase;
  font-size: 10px;

}

input[type="text"],
input[type="password"] {
  width: 80%;
  padding: 10px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
  /* transition: all 0.3s ease;  */

}


input[type="text"]:focus,
input[type="password"]:focus {
  border-color: #4b70e9;
  box-shadow: 0 0 0 3px rgba(118, 75, 162, 0.1);
}


#button_login {
  width: 88%;
  padding: 5px;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
  margin-left: 20px;
  margin-top: 10px;
  height: 40px;
}


#button_login:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
}

#button_login:active {
  transform: translateY(0);
}

/* 7. Mensagem de Erro */
p[style*="color: red"] {
  color: #e74c3c !important;
  /* Vermelho mais bonito */
  background-color: #fce4e4;
  padding: 10px;
  border-radius: 5px;
  font-size: 0.9rem;
  margin-bottom: 15px;
  border: 1px solid #fcc2c3;
}



#formuser select,
#formuser input[type="date"] {
  padding: 2px 6px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  color: #1e293b;
  background: white;
  font-family: "Inter", sans-serif;
  transition: all 0.2s;
}

.empresa-seletor {
  margin-top: 20px;
}

.empresa-card {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 12px;
}

.empresa-card:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateX(5px);
}

.empresa-card input[type="radio"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.empresa-info {
  flex: 1;
}

.empresa-info h5 {
  margin: 0 0 5px 0;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
}

.empresa-info p {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
}

.titulo-seletor {
  color: #fff;
  text-align: center;
  margin-bottom: 10px;
  font-size: 18px;
  font-weight: 600;
}

.subtitulo-seletor {
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
  margin-bottom: 20px;
  font-size: 14px;
}


.empresas-lista {
  max-height: 400px;
  overflow-y: auto;
}

.empresa-opcao {
  margin: 12px 0;
  position: relative;
}

.empresa-opcao input[type="radio"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.empresa-label {
  display: block;
  padding: 15px 20px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: white;
}

.empresa-opcao input[type="radio"]:checked+.empresa-label {
  border-color: #2E5BFF;
  background: #f0f4ff;
}

.empresa-label:hover {
  border-color: #2E5BFF;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(46, 91, 255, 0.15);
}

.empresa-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.empresa-info strong {
  color: #333;
  font-size: 16px;
}

.empresa-role {
  color: #666;
  font-size: 13px;
  text-transform: capitalize;
}

/* Scrollbar customizada */
.empresas-lista::-webkit-scrollbar {
  width: 8px;
}

.empresas-lista::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.empresas-lista::-webkit-scrollbar-thumb {
  background: #2E5BFF;
  border-radius: 10px;
}

.empresas-lista::-webkit-scrollbar-thumb:hover {
  background: #1e3fcc;
}

.msg {
  text-align: center;
}

.msg.error {
  color: red;
}

.msg.success {
  color: green;
}




/* Logo na Sidebar */
.sidebar-logo {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
}

/* Navegação da Sidebar */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 24px 0;
}

.nav-section {
  margin-bottom: 32px;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0 20px;
  display: block;
  margin-bottom: 12px;
}

.sidebar-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}



/* Conteúdo Principal */
.main-content {
  flex: 1;
  margin-left: 240px;
  /* Espaço da sidebar */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: calc(100% - 240px);
  /* Garante largura correta */
}

/* Navbar Superior (Header) */
.nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
  height: auto;
  min-height: 70px;
}

.nav-spacer {
  flex: 1;
}

.nav-block {
  display: flex;
  align-items: center;
  gap: 16px;
}

.notification-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--muted);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-btn:hover {
  background: var(--surface-2);
  color: var(--primary);
}


/* ==========================================================================
   NOVO MENU DE USUÁRIO (DROPDOWN HARMONIOSO)
   ========================================================================== */

/* 1. Container e Gatilho (Botão com Foto e Nome) */
.user-dropdown-container {
  position: relative;
  display: flex;
  align-items: center;
}

.user-trigger {
  background: transparent;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
}

.user-trigger:hover {
  opacity: 0.8;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--primary-contrast);
  font-weight: 600;
  font-size: 14px;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.user-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.arrow-down {
  font-size: 10px;
  color: var(--muted);
}

/* 2. Menu Flutuante (Escondido por padrão) */
.user-menu {
  display: none;
  /* JS vai mudar isso para block */
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 10px;
  width: 220px;
  background-color: var(--menu-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  padding: 8px 0;
  animation: fadeInMenu 0.2s ease-out;
}

.user-menu.show {
  display: block;
}

@keyframes fadeInMenu {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.menu-link {
  display: block;
  padding: 10px 20px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  transition: background 0.2s;
}

.menu-link:hover {
  background-color: var(--surface-2);
  color: var(--primary);
}

.dropdown-header {
  padding: 8px 20px;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}


/* ==========================================================================
   MOBILE & TABLET (Telas menores que 992px)
   Aqui acontece a mágica do menu lateral e ajustes
   ========================================================================== */

/* Botão Hambúrguer (Escondido no Desktop) */
.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text);
  padding: 0;
  margin-right: 15px;
}

/* Overlay Escuro */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

@media (max-width: 991px) {

  /* 1. Botão Hambúrguer Visível */
  .mobile-menu-btn {
    display: block;
  }

  /* 2. Sidebar Escondida (Off-screen) */
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 260px;
    transform: translateX(-100%);
    /* Joga pra fora da tela */
    z-index: 1050;
    /* Acima de tudo */
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.2);
  }

  /* Classe JS para abrir */
  .sidebar.mobile-open {
    transform: translateX(0);
    /* Traz pra dentro */
  }

  /* 3. Ajuste do Conteúdo Principal */
  .main-content {
    margin-left: 0;
    width: 100%;
  }

  /* 4. Ajustes na Navbar */
  .nav {
    padding: 10px 16px;
  }

  .user-name {
    display: none;
    /* Esconde o nome no mobile para economizar espaço */
  }

  .user-trigger {
    gap: 0;
  }

  /* 5. Ajuste do Menu de Usuário no Mobile */
  /* Empurra o conteúdo em vez de flutuar */
  .user-dropdown-container {
    position: static;
  }

  .user-menu {
    position: absolute;
    width: 100%;
    left: 0;
    right: 0;
    top: 60px;
    /* Altura da navbar */
    border-radius: 0;
    border-left: none;
    border-right: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  }
}


/* ==========================================================================
   CSS ADICIONAL PARA CADASTRO DE EMPRESAS E SCHEMAS
   Adicione este arquivo ou copie para o seu style.css existente
   ========================================================================== */

/* Container do botão de cadastrar schema */

/* 1. Containers de Ação (Botões Superiores) */
.box_schema,
.box_voltar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  /* Alinha com o resto do dashboard */
  margin-bottom: 24px;
  gap: 16px;
}

/* Botão de Cadastrar (Estilo Success) */
.btn-cadastrar-schema {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: var(--success);
  color: #ffffff;
  padding: 10px 24px;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
  font-family: "Inter", sans-serif;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn-cadastrar-schema:hover {
  background-color: #15803d;
  /* Um tom levemente mais escuro do success */
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25);
}

/* Botão de Voltar (Estilo Primary/Ghost) */
.btn-voltar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: var(--surface);
  /* Fundo branco/escuro */
  border: 1px solid var(--border);
  color: var(--text-2);
  padding: 10px 20px;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
  font-family: "Inter", sans-serif;
  transition: all 0.2s ease;
}

.btn-voltar:hover {
  background-color: var(--surface-2);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

/* 2. Cards de Formulário (Padronizado com .card e .formularioget) */
.box_empresa_cadastrar,
.box_schema_cadastrar,
.box_lista_empresas,
.box_lista_schemas {
  background: var(--surface);
  padding: 32px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 32px;
  width: 100%;
}

.box_schema_cadastrar h2,
.box_empresa_cadastrar h2,
.box_lista_empresas h2,
.box_lista_schemas h2 {
  color: var(--text);
  margin-bottom: 8px;
  font-size: 20px;
  font-weight: 600;
}

.info-text {
  color: var(--muted);
  margin-bottom: 24px;
  font-size: 14px;
  display: block;
}

/* 3. Grupos de Formulário */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  color: var(--text-2);
  font-weight: 500;
  margin-bottom: 8px;
  font-size: 14px;
}

.form-group small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}

/* 4. Inputs (Padronizado com .form-control) */
.box_nome_empresa input,
.box_schema_empresa input,
.box_schema_input input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--input-bg);
  color: var(--text);
  transition: all 0.2s ease;
  font-family: "Inter", sans-serif;
}

.box_nome_empresa input:focus,
.box_schema_empresa input:focus,
.box_schema_input input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.box_nome_empresa input::placeholder,
.box_schema_empresa input::placeholder,
.box_schema_input input::placeholder {
  color: var(--input-placeholder);
}

/* 5. Ações do Formulário (Salvar/Limpar) */
.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.btn-submit,
.btn-reset {
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: "Inter", sans-serif;
  flex: 1;
  /* Ocupa espaço igual, ou remova para tamanho natural */
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-submit {
  background-color: var(--primary);
  color: var(--primary-contrast);
}

.btn-submit:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(46, 91, 255, 0.3);
}

.btn-reset {
  background-color: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border);
}

.btn-reset:hover {
  background-color: var(--border);
  color: var(--text);
}

/* 6. Info Box (Alertas) */
.info-box {
  margin-top: 24px;
  padding: 16px 20px;
  background-color: rgba(250, 204, 21, 0.1);
  /* Amarelo transparente */
  border: 1px solid rgba(250, 204, 21, 0.3);
  border-radius: 8px;
}

.info-box h3 {
  color: #b45309;
  /* Hardcoded warning color ou use var se tiver */
  margin-bottom: 12px;
  font-size: 15px;
  font-weight: 600;
}

.dark-mode .info-box h3 {
  color: #fcd34d;
}

.info-box ul {
  list-style-position: inside;
  color: var(--text-2);
  margin: 0;
  padding-left: 0;
}

.info-box ul li {
  margin-bottom: 6px;
  font-size: 13px;
}

/* 7. Tabela de Empresas (Padronizada) */
.table-responsive {
  overflow-x: auto;
  margin-top: 20px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.tabela-empresas {
  width: 100%;
  border-collapse: collapse;
}

.tabela-empresas thead {
  background-color: var(--surface-2);
}

.tabela-empresas th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

.tabela-empresas td {
  padding: 14px 16px;
  font-size: 14px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.tabela-empresas tbody tr:last-child td {
  border-bottom: none;
}

.tabela-empresas tbody tr:hover {
  background-color: var(--surface-2);
}

/* 8. Badges e Grid */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.badge-schema {
  background-color: var(--primary-soft);
  color: var(--primary);
  border: 1px solid rgba(46, 91, 255, 0.1);
}

.badge-success {
  background-color: rgba(34, 197, 94, 0.1);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.schemas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.schema-card {
  background: var(--surface);
  color: var(--text);
  padding: 20px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.schema-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--primary);
}

.schema-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.schema-icon {
  font-size: 24px;
  color: var(--primary);
  background: var(--primary-soft);
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.schema-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
}

/* Responsividade específica desta área */
@media (max-width: 768px) {

  .box_schema,
  .box_voltar {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-cadastrar-schema,
  .btn-voltar {
    width: 100%;
  }

  .box_empresa_cadastrar,
  .box_schema_cadastrar {
    padding: 20px;
  }

  .form-actions {
    flex-direction: column;
  }

  .schemas-grid {
    grid-template-columns: 1fr;
  }
}


.card-filtro {
  background-color: #ffffff;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  /* Sombra suave */
  border: 1px solid #eef2f7;
  margin-bottom: 30px;
}

/* Cabeçalho do Card */
.filtro-header h2 {
  font-size: 1.25rem;
  color: #333;
  font-weight: 700;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.filtro-header h2 svg {
  color: #4a90e2;
  /* Azul destaque */
}

.text-muted {
  color: #8898aa;
  font-size: 0.9rem;
  margin-bottom: 20px;
  margin-top: 0;
}

/* Layout do Formulário */
.form-filtro {
  display: flex;
  gap: 15px;
  align-items: center;
}

/* Estilização do Input com Ícone */
.input-group-custom {
  position: relative;
  flex-grow: 1;
  /* Ocupa todo o espaço disponível */
}

.icon-input {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #adb5bd;
  pointer-events: none;
  /* Permite clicar através do ícone */
}

.input-filtro {
  width: 100%;
  padding: 12px 15px 12px 45px;
  /* Padding extra na esquerda pro ícone */
  border: 2px solid #eef2f7;
  border-radius: 8px;
  font-size: 0.95rem;
  color: #495057;
  transition: all 0.3s ease;
  background-color: #f8f9fa;
  outline: none;
}

.input-filtro:focus {
  background-color: #fff;
  border-color: #4a90e2;
  /* Cor de foco */
  box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.1);
  /* Brilho ao redor */
}

.input-filtro::placeholder {
  color: #adb5bd;
}

/* Estilização do Botão */
.btn-filtrar {
  padding: 12px 25px;
  background-color: var(--primary);
  /* Cor principal */
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(74, 144, 226, 0.2);
}

.btn-filtrar:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(74, 144, 226, 0.3);
}

.btn-filtrar:active {
  transform: translateY(0);
}

/* Responsividade para celular */
@media (max-width: 768px) {
  .form-filtro {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-filtrar {
    justify-content: center;
  }
}


.status-dot {
  height: 10px;
  width: 10px;
  background-color: #bbb;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.status-online {
  background-color: #28a745;
  box-shadow: 0 0 5px #28a745;
  animation: pulse 1.5s infinite;
}

.status-offline {
  background-color: #dc3545;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
  }

  70% {
    box-shadow: 0 0 0 5px rgba(40, 167, 69, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
  }
}



.card-token {
  background-color: #2d3842;
  border: none;
  border-radius: 15px;
}

.token-display {
  background-color: #ecf0f1;
  border-radius: 8px;
  font-family: 'Courier New', Courier, monospace;
  letter-spacing: 1px;
}



/* ==========================================================================
   STATUS DOTS & ANIMAÇÕES (Adicione ao final do seu CSS)
   ========================================================================== */

.status-container {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  transition: all 0.3s ease;
  background-color: #94a3b8;
  /* Cor padrão (cinza/verificando) */
}

/* Status Offline (Vermelho estático) */
.status-dot.status-offline {
  background-color: var(--danger);
  /* Usa sua variável de erro */
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);
}

/* Status Online (Verde com animação de Ping) */
.status-dot.status-online {
  background-color: var(--success);
  /* Usa sua variável de sucesso */
  box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7);
  animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* Animação do Ping */
@keyframes ping {

  75%,
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

.status-text {
  font-size: 13px;
  font-weight: 500;
}

/* Título pequeno dentro do menu (opcional) */
.dropdown-header {
  padding: 8px 16px;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: bold;
  letter-spacing: 0.5px;
}



/* ========== SUBMENU STYLES ========== */
.nav-item.has-submenu {
  position: relative;
}

.nav-item.has-submenu>.nav-link {
  justify-content: flex-start;
}

.submenu-arrow {
  margin-left: auto;
  transition: transform 0.2s ease;
}

.nav-item.has-submenu.open>.nav-link .submenu-arrow {
  transform: rotate(90deg);
}

.submenu {
  display: none;
  list-style: none;
  padding: 0;
  margin: 0;
  padding-left: 32px;
  overflow: hidden;
}

.nav-item.has-submenu.open>.submenu {
  display: block;
}

.submenu .nav-item {
  margin-bottom: 2px;
}

.submenu .nav-link {
  padding: 8px 16px;
  font-size: 13px;
  border-left: 2px solid transparent;
}

.submenu .nav-link:hover {
  background: var(--surface-2);
  color: var(--primary);
}

.submenu .nav-item.active .nav-link {
  background: var(--primary-soft);
  color: var(--primary);
  border-left-color: var(--primary);
}

/* ========== DASHBOARD OVERVIEW STYLES ========== */

/* Tab Navigation */
.dashboard-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.dashboard-tab {
  padding: 12px 24px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: "Inter", sans-serif;
  margin-bottom: -1px;
}

.dashboard-tab:hover {
  color: var(--primary);
  background: var(--surface-2);
}

.dashboard-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: transparent;
}

/* KPI Cards Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: var(--shadow);
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: var(--primary);
}

.dark-mode .kpi-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.kpi-icon.blue {
  background: rgba(46, 91, 255, 0.12);
  color: var(--primary);
}

.kpi-icon.green {
  background: rgba(22, 163, 74, 0.12);
  color: var(--success);
}

.kpi-icon.red {
  background: rgba(220, 38, 38, 0.12);
  color: var(--danger);
}

.kpi-icon.purple {
  background: rgba(147, 51, 234, 0.12);
  color: #9333ea;
}

.kpi-icon.orange {
  background: rgba(234, 88, 12, 0.12);
  color: #ea580c;
}

.kpi-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.kpi-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.kpi-sub {
  font-size: 12px;
  color: var(--muted);
}

/* Mini Charts Grid */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

@media (max-width: 900px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

.mini-chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
  cursor: pointer;
}

.mini-chart-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: var(--primary);
}

.dark-mode .mini-chart-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.mini-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.mini-chart-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.mini-chart-badge {
  font-size: 11px;
  padding: 4px 8px;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 6px;
  font-weight: 500;
}

.mini-chart-wrapper {
  width: 100%;
  height: 200px;
  position: relative;
}

.mini-chart-wrapper canvas {
  max-width: 100% !important;
  max-height: 200px !important;
}

/* Full-width chart card */
.full-chart-card {
  grid-column: 1 / -1;
}

/* Tab Content */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* Overview Container */
.dashboard-overview {
  width: 100%;
}

/* View Chart Link */
.view-chart-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--primary);
  text-decoration: none;
  margin-top: 12px;
  font-weight: 500;
}

.view-chart-link:hover {
  text-decoration: underline;
}

.view-chart-link svg {
  width: 14px;
  height: 14px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .kpi-value {
    font-size: 20px;
  }

  .dashboard-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .dashboard-tab {
    padding: 10px 16px;
    white-space: nowrap;
  }
}

/* ========== APPLE-STYLE GRIDSTACK DASHBOARD ========== */

/* GridStack Container */
.grid-stack {
  background: transparent;
}

.grid-stack>.grid-stack-item>.grid-stack-item-content {
  background: transparent;
  overflow: visible;
}

/* Glassmorphism Widget Card */
.widget-card {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  padding: 16px 20px;
  height: 100%;
  min-height: 100px;
  box-sizing: border-box;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow:
    0 4px 30px rgba(0, 0, 0, 0.05),
    0 1px 3px rgba(0, 0, 0, 0.03);
  position: relative;
  overflow: visible;
  display: flex;
  flex-direction: column;
}

.dark-mode .widget-card {
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 4px 30px rgba(0, 0, 0, 0.3),
    0 1px 3px rgba(0, 0, 0, 0.2);
}

.widget-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.4),
      transparent);
}

.widget-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.12),
    0 8px 25px rgba(0, 0, 0, 0.08);
  border-color: rgba(46, 91, 255, 0.3);
}

.dark-mode .widget-card:hover {
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Widget Header */
.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.widget-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

.widget-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(46, 91, 255, 0.15), rgba(46, 91, 255, 0.05));
}

.widget-icon.blue {
  background: linear-gradient(135deg, rgba(46, 91, 255, 0.2), rgba(46, 91, 255, 0.05));
}

.widget-icon.green {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.05));
}

.widget-icon.red {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.2), rgba(220, 38, 38, 0.05));
}

.widget-icon.purple {
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.2), rgba(147, 51, 234, 0.05));
}

.widget-icon.orange {
  background: linear-gradient(135deg, rgba(234, 88, 12, 0.2), rgba(234, 88, 12, 0.05));
}

/* Widget Value */
.widget-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 4px;
  letter-spacing: -0.5px;
  word-break: break-word;
  flex: 1;
  display: flex;
  align-items: center;
}

.widget-value.small {
  font-size: 22px;
}

.widget-sub {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-top: auto;
}

.widget-trend {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

.widget-trend.up {
  color: #16a34a;
  background: rgba(34, 197, 94, 0.1);
}

.widget-trend.down {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.1);
}

/* Chart Widget */
.widget-chart {
  padding: 16px;
}

.widget-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.widget-chart-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.widget-badge {
  font-size: 10px;
  padding: 4px 8px;
  background: rgba(46, 91, 255, 0.1);
  color: var(--primary);
  border-radius: 20px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.widget-chart-wrapper {
  width: 100%;
  height: calc(100% - 50px);
  min-height: 150px;
  position: relative;
}

/* Drag Handle */
.widget-drag-handle {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.dark-mode .widget-drag-handle {
  background: rgba(255, 255, 255, 0.1);
}

.widget-card:hover .widget-drag-handle {
  opacity: 1;
}

.widget-drag-handle:active {
  cursor: grabbing;
}

.widget-drag-handle svg {
  width: 14px;
  height: 14px;
  color: var(--muted);
}

/* Edit Mode */
.dashboard-edit-mode .widget-card {
  border: 2px dashed var(--primary);
  animation: pulse-border 2s infinite;
}

@keyframes pulse-border {

  0%,
  100% {
    border-color: rgba(46, 91, 255, 0.3);
  }

  50% {
    border-color: rgba(46, 91, 255, 0.7);
  }
}

.dashboard-edit-mode .widget-drag-handle {
  opacity: 1;
}

/* Dashboard Controls */
.dashboard-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--menu-bg);
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.dark-mode .dashboard-controls {
  background: var(--menu-bg);
  border: 1px solid var(--menu-border);
}

.dashboard-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dashboard-period {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.dashboard-period strong {
  color: var(--text);
}

.dashboard-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-dashboard {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: "Inter", sans-serif;
}

.btn-dashboard-secondary {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text);
}

.dark-mode .btn-dashboard-secondary {
  background: rgba(255, 255, 255, 0.1);
}

.btn-dashboard-secondary:hover {
  background: rgba(0, 0, 0, 0.1);
}

.dark-mode .btn-dashboard-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-dashboard-primary {
  background: var(--primary);
  color: white;
}

.btn-dashboard-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

/* Responsive GridStack */
@media (max-width: 768px) {
  .widget-value {
    font-size: 26px;
  }

  .widget-card {
    padding: 16px;
    border-radius: 16px;
  }

  .dashboard-controls {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .dashboard-actions {
    justify-content: center;
  }
}

.logo-icon svg {
  display: flex;
  justify-content: flex-start;
  /* Alinha o conteúdo ao início */
  padding-left: 10px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 24px 0;
}

.sidebar-nav a {
  text-decoration: none;
  color: var(--muted);
}

.sidebar-nav a:hover {
  color: var(--primary);
}

.nav-section {
  margin-bottom: 32px;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0 20px;
  display: block;
  margin-bottom: 12px;
}

.sidebar-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-nav>ul>li:first-child {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;

  .logo {
    display: flex;
    justify-content: flex-start;
    /* Alinha o conteúdo ao início */
    padding-left: 10px;
  }
}

#sidebar a,
#sidebar .dropdown-btn,
#sidebar .logo {
  border-radius: .5em;
  padding: .85em;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 1em
}

.dropdown-btn {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
}



.dropdown-btn {
  display: flex;
  /* Alinha os itens lado a lado */
  align-items: center;
  /* Centraliza verticalmente */
  width: 100%;
  background: transparent;
  /* Remove o cinza padrão de botão */
  border: none;
  /* Remove a borda padrão */
  color: inherit;
  /* Herda a cor do texto da sidebar */
  padding: 10px 15px;
  /* Ajuste o espaçamento interno conforme seu gosto */
  cursor: pointer;
  font-size: inherit;
  /* Mantém o tamanho da fonte */
  transition: background-color 0.3s;
}

.dropdown-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  /* Efeito hover suave */
}

/* Espaço entre o ícone da esquerda e o texto */
.dropdown-btn span {
  margin-left: 10px;
  flex-grow: 1;
  /* Faz o texto empurrar a seta para o final */
  text-align: left;
}

/* Garante que a seta não mude de tamanho */
.dropdown-btn .arrow {
  min-width: 24px;
}







/* ============================================================ */
/* CORREÇÃO FINAL PARA MOBILE (Cole no FINAL do arquivo CSS)    */
/* ============================================================ */
@media (max-width: 992px) {

  /* 1. Remove a margem que empurra o conteúdo */
  .main-content {
    margin-left: 0 !important;
    /* IMPORTANTE: Remove o espaço da sidebar */
    width: 100%;
    padding-top: 20px;
  }

  /* 2. Esconde a Sidebar por padrão */
  #sidebar {
    left: -250px;
    /* Esconde para a esquerda */
    transition: left 0.3s ease-in-out;
    z-index: 1050;
    /* Garante que fique acima de tudo */
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
  }

  /* 3. Mostra a Sidebar quando a classe .mobile-open for ativada pelo JS */
  #sidebar.mobile-open {
    left: 0;
    /* Traz de volta para a tela */
  }

  /* 4. Garante que o Header ocupe a tela toda */
  .nav {
    width: 100%;
    justify-content: flex-start;
    /* Alinha itens */
    padding: 10px 15px;
  }

  /* 5. Mostra o botão do menu (Hambúrguer) */
  .mobile-menu-btn {
    display: flex !important;
    margin-right: 15px;
  }

  /* 6. Ajusta o Overlay */
  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
  }

  .sidebar-overlay.active {
    display: block;
  }
}

/* Garante que no Desktop o botão suma */
@media (min-width: 993px) {
  .mobile-menu-btn {
    display: none !important;
  }
}


#lista_funcao {
  background-color: white;
  color: var(--primary);
  border-radius: 10px;
  height: 40px;
  width: 200px;

}

/* ========== DARK MODE - CARD MENU DROPDOWN ========== */
.dark-mode .card-menu-dropdown,
html[data-bs-theme="dark"] .card-menu-dropdown {
  background: var(--menu-bg) !important;
  border-color: var(--menu-border) !important;
  box-shadow: var(--shadow) !important;
}

.dark-mode .card-menu-dropdown label,
html[data-bs-theme="dark"] .card-menu-dropdown label {
  color: var(--muted) !important;
}

.dark-mode .card-menu-dropdown input[type="date"],
html[data-bs-theme="dark"] .card-menu-dropdown input[type="date"] {
  background: var(--input-bg) !important;
  border-color: var(--input-border) !important;
  color: var(--text) !important;
}

.dark-mode .card-menu-dropdown .period-btn,
html[data-bs-theme="dark"] .card-menu-dropdown .period-btn {
  background: var(--surface-2) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

.dark-mode .card-menu-dropdown .period-btn:hover,
html[data-bs-theme="dark"] .card-menu-dropdown .period-btn:hover {
  background: var(--menu-hover) !important;
}

.dark-mode .card-menu-dropdown .period-btn.active,
html[data-bs-theme="dark"] .card-menu-dropdown .period-btn.active {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: var(--primary-contrast) !important;
}

.dark-mode .card-menu-btn,
html[data-bs-theme="dark"] .card-menu-btn {
  color: var(--muted) !important;
}

.dark-mode .card-menu-btn:hover,
html[data-bs-theme="dark"] .card-menu-btn:hover {
  background: var(--surface-2) !important;
  color: var(--text) !important;
}

.dark-mode .period-indicator,
html[data-bs-theme="dark"] .period-indicator {
  color: var(--muted) !important;
}

.dark-mode #lista_funcao,
html[data-bs-theme="dark"] #lista_funcao {
  background-color: var(--input-bg) !important;
  color: var(--text) !important;
  border-color: var(--input-border) !important;
}

/* KPI Cards */
.dark-mode .kpi-card,
html[data-bs-theme="dark"] .kpi-card {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}

.dark-mode .kpi-value,
html[data-bs-theme="dark"] .kpi-value {
  color: var(--text) !important;
}

.dark-mode .kpi-sub,
html[data-bs-theme="dark"] .kpi-sub {
  color: var(--muted) !important;
}

.dark-mode .kpi-label,
html[data-bs-theme="dark"] .kpi-label {
  color: var(--text-2) !important;
}

/* Mini chart cards */
.dark-mode .mini-chart-card,
html[data-bs-theme="dark"] .mini-chart-card {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}

/* Dashboard tabs */
.dark-mode .dashboard-tab,
html[data-bs-theme="dark"] .dashboard-tab {
  color: var(--muted) !important;
}

.dark-mode .dashboard-tab.active,
html[data-bs-theme="dark"] .dashboard-tab.active {
  color: var(--primary) !important;
}

@media (max-width: 768px) {
  .main-login-container {
    flex-direction: column !important;
    padding: 0 !important;
    min-height: 100vh !important;
  }

  .bloco_apresentacao {
    display: block !important;
    width: 100% !important;
    padding: 30px 20px !important;
    text-align: center !important;
  }

  .titulo_apresentacao h2 {
    padding-left: 0 !important;
    text-align: center !important;
    font-size: 1.3rem !important;
  }

  .subtitulo_apresentacao h4 {
    padding-left: 0 !important;
    text-align: center !important;
    font-size: 0.95rem !important;
  }

  .logo_white {
    padding-left: 0 !important;
    text-align: center !important;
    display: flex !important;
    justify-content: center !important;
  }

  .logo_white img {
    max-width: 150px !important;
    height: auto !important;
  }

  .bloco_login_externo {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: auto !important;
    padding: 20px !important;
    border-radius: 20px 20px 0 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    justify-content: flex-start !important;
    align-items: center !important;
    flex: 1 !important;
  }

  .bloco_login {
    width: 100% !important;
    max-width: 100% !important;
    padding: 2rem !important;
    margin: 0 auto !important;
  }

  .bloco_selecionar_empresa {
    width: 100% !important;
    max-width: 100% !important;
    padding: 1.5rem !important;
    margin: 0 auto !important;
  }

  #label_login {
    text-align: center !important;
    margin-bottom: 1rem !important;
  }

  .user_login,
  .senha_login {
    transform: translateX(0) !important;
  }

  input[type="text"],
  input[type="password"] {
    width: 100% !important;
  }

  #button_login {
    width: 100% !important;
    margin-left: 0 !important;
  }

  .bloco_dashboard {
    text-align: center !important;
  }

  .bloco_dashboard .label_dashboard,
  .bloco_dashboard .label_subdashboard {
    padding-left: 0 !important;
  }
}