@import url('base.css');
@import url('components.css');
@import url('utilities.css');
@import url('sidebar.css');
@import url('cards.css');

.text-brand {
  color: var(--primary);
}

.bg-brand {
  background-color: var(--primary);
}

.section {
  background-color: var(--background);
  border-radius: 1rem;
  box-shadow: var(--card-shadow);
  padding: 1.5rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
}

.content-wrapper {
  flex: 1;
  margin-left: 0;
  margin-top: var(--navbar-height);
  padding: 30px;
}

.alert-success {
  color: var(--success);
  padding: 12px 20px;
  border-radius: 0.5rem;
  border-left: 4px solid var(--success);
  margin-bottom: 20px;
}
.alert-error {
  background-color: rgba(244, 67, 54, 0.1);
  color: var(--error);
  padding: 12px 20px;
  border-radius: 0.5rem;
  border-left: 4px solid var(--error);
  margin-bottom: 20px;
}
.dark-mode-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--gray-300);
  transition: 0.4s;
  border-radius: 1.5rem;
}
.dark-mode-slider:before {
  position: absolute;
  content: '';
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: var(--secondary);
  transition: 0.4s;
  border-radius: 50%;
}
input:checked + .dark-mode-slider {
  background-color: var(--primary);
}
input:checked + .dark-mode-slider:before {
  transform: translateX(26px);
}
/* Caixa principal */
.introjs-tooltip {
  border-radius: 1rem;
  padding: 1.5rem;
  background: var(--secondary);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
  font-family: 'Inter', sans-serif;
  color: var(--gray-800);
  max-width: 320px;
}

/* Título */
.introjs-tooltip-header {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--orange-500);
  border-bottom: 2px solid var(--orange-500);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

/* Texto */
.introjs-tooltiptext {
  font-size: 0.95rem;
  line-height: 1.4rem;
}

/* Botões */
.introjs-button {
  border-radius: 0.5rem;
  padding: 0.4rem 1rem;
  font-weight: 500;
  border: none;
}

.introjs-nextbutton {
  background-color: var(--orange-500);
  color: var(--white);
}

.introjs-prevbutton {
  background-color: var(--border);
  color: var(--gray-800);
}

.introjs-skipbutton {
  color: var(--gray-400);
  background: none;
}

/* Pontinhos de progresso */
.introjs-bullets li a {
  background-color: var(--gray-300);
  border-radius: 50%;
}

.introjs-bullets li a.active {
  background-color: var(--orange-500);
}
@keyframes skeleton-loading {
  0%,
  100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.badge {
  margin-left: 5px;
}

.main-content {
  flex: 1;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

h1 {
  color: var(--text);
  margin-bottom: 25px;
  font-size: 2.2rem;
  padding-bottom: 15px;
  border-bottom: 3px solid var(--primary);
}

h2 {
  color: var(--text);
  margin-top: 30px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
  font-size: 1.6rem;
}

h3 {
  color: var(--text);
  margin-top: 25px;
  margin-bottom: 15px;
  font-size: 1.3rem;
}

h4 {
  color: var(--text);
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.result {
  background: #f8f9fa;
  padding: 20px;
  margin-top: 25px;
  border-radius: 0.625rem;
  border-left: 4px solid var(--primary);
}
.result strong {
  color: var(--primary);
}
.summary-box {
  background: #f8f9fa;
  border-radius: 0.625rem;
  padding: 20px;
  margin-bottom: 20px;
  border-left: 4px solid var(--primary);
}
.resumo-container {
  padding: 25px;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--secondary);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  margin-top: 20px;
}

.btn-group {
  display: flex;
  gap: 15px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.flex-item {
  flex: 1;
  min-width: 300px;
}
.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--primary);
  color: var(--white);
  border-radius: 50%;
  margin-right: 8px;
  font-size: 14px;
}
.footer {
  text-align: center;
  margin-top: 30px;
  padding: 20px;
  color: #7f8c8d;
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
}
input,
select {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  font-size: 16px;
  transition: 0.3s;
  font-family: Inter, sans-serif;
  width: 100%;
}
input:focus,
select:focus {
  outline: 0;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(244, 92, 0, 0.2);
}
label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text);
}
button {
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: 12px 25px;
  border-radius: 1.875rem;
  font-family: Inter, sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: 0.3s;
  font-size: 16px;
}
button:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}
.flex-container {
  flex-direction: column;
}
.app-container {
  display: flex;
  min-height: 100vh;
}
.logo-container {
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.logo {
  display: flex;
  align-items: center;
  font-size: 1.3rem;
  font-weight: 600;
  font-family: Inter, sans-serif;
  gap: 10px;
}
.logo i {
  font-size: 1.8rem;
  color: var(--primary);
}
.nav-menu {
  padding: 1.5rem 0;
}
.nav-item {
  padding: 0.8rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--transition);
  cursor: pointer;
  font-family: Inter, sans-serif;
  font-size: 0.95rem;
}
.nav-item.active,
.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-left: 3px solid var(--primary);
}
.nav-item i {
  width: 24px;
  text-align: center;
}
.user-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.user-info {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.user-avatar {
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}
.action-btn {
  background: 0 0;
  border: none;
  color: var(--primary);
  cursor: pointer;
  position: relative;
  font-size: 1.1rem;
}
.notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--error);
  color: var(--white);
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dark-mode-toggle {
  background: #e0e0e0;
  border-radius: 0.8125rem;
  cursor: pointer;
  transition: background 0.3s;
}
.dark-mode-toggle.active {
  background: var(--primary);
}
.toggle-switch {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--secondary);
  transition: transform 0.3s;
}
.dark-mode-toggle.active .toggle-switch {
  transform: translateX(24px);
}

/* Quick messages board */
.quick-messages-board {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.75rem;
  border-radius: 1.5rem;
  border: 1px solid rgba(99, 102, 241, 0.18);
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.12) 0%,
    rgba(255, 255, 255, 0.95) 60%
  );
  box-shadow: 0 20px 40px -28px rgba(30, 64, 175, 0.45);
  overflow: hidden;
}

.quick-messages-board::before {
  content: '';
  position: absolute;
  inset: -45% auto auto -35%;
  width: 320px;
  height: 320px;
  background: radial-gradient(
    circle,
    rgba(129, 140, 248, 0.28) 0%,
    transparent 70%
  );
  opacity: 0.6;
  pointer-events: none;
}

.quick-messages-board__header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
}

.quick-messages-board__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--blue-800);
  margin-bottom: 0.25rem;
}

.quick-messages-board__subtitle {
  font-size: 0.9rem;
  color: var(--gray-600);
  max-width: 32rem;
}

.quick-messages-board__tag {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(99, 102, 241, 0.16);
  color: var(--blue-800);
  padding: 0.55rem 1rem;
  border-radius: 999px;
  box-shadow: 0 10px 25px -18px rgba(99, 102, 241, 0.5);
}

.quick-messages-board__tag i {
  font-size: 0.85rem;
}

.quick-messages-board__grid {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.quick-messages-board__empty {
  position: relative;
  z-index: 1;
  text-align: center;
  font-size: 0.9rem;
  color: var(--gray-500);
  padding: 1.5rem;
  border-radius: 1rem;
  border: 1px dashed rgba(99, 102, 241, 0.3);
  background: rgba(255, 255, 255, 0.8);
}

.quick-message-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: 1rem;
  background: var(--white);
  border: 1px solid rgba(99, 102, 241, 0.18);
  box-shadow: 0 16px 30px -22px rgba(30, 64, 175, 0.5);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.quick-message-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 1rem;
  border: 1px solid transparent;
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.18) 0%,
    rgba(99, 102, 241, 0.05) 50%,
    transparent 100%
  );
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.quick-message-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 36px -24px rgba(30, 64, 175, 0.55);
}

.quick-message-card:hover::after {
  opacity: 1;
}

.quick-message-card__badge {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(59, 130, 246, 0.15);
  color: #1d4ed8;
}

.quick-message-card__badge i {
  font-size: 1.15rem;
}

.quick-message-card__content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

.quick-message-card__label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  align-self: flex-start;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(59, 130, 246, 0.18);
  color: #1d4ed8;
}

.quick-message-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.quick-message-card__author {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-700);
}

.quick-message-card__date {
  font-size: 0.8rem;
  color: var(--gray-500);
}

.quick-message-card__text {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--gray-700);
  white-space: pre-line;
}

@media (max-width: 640px) {
  .quick-messages-board {
    padding: 1.25rem;
  }

  .quick-messages-board__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .quick-message-card {
    padding: 1rem;
    gap: 0.75rem;
  }

  .quick-message-card__badge {
    width: 42px;
    height: 42px;
  }
}
.page-title {
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: Inter, sans-serif;
}
.page-title i {
  background: var(--primary-light);
  color: var(--primary);
  width: 50px;
  height: 50px;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.alert {
  padding: 1rem;
  border-radius: 0.75rem;
  margin: 1rem 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.alert-container {
  position: sticky;
  top: calc(var(--navbar-height) + 1rem);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.alert .alert-content {
  flex: 1;
}

.alert-close {
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  transition: background-color 0.2s ease;
}

.alert-close:hover,
.alert-close:focus-visible {
  background-color: rgba(17, 24, 39, 0.08);
  outline: none;
}
.card-metric-novo {
  background: var(--secondary);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
  border-left: 5px solid var(--primary);
  transition:
    transform 0.3s,
    box-shadow 0.3s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 160px;
}
.card-metric-novo:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
}
.card-metric-novo h4 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  color: var(--text);
  font-family: Inter, sans-serif;
}
.card-metric-novo .valor-principal {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--primary);
}
.card-metric-novo .info-secundaria {
  margin-top: 0.3rem;
  font-size: 0.95rem;
  color: var(--gray);
}
.card-metric-novo .card-botoes {
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Metric cards on Atualizações page */
.card.metric-card {
  min-width: 200px;
  background: linear-gradient(135deg, #f8fafc, #e2e8f0);
}
.card.metric-card .metric-item + .metric-item {
  margin-top: 0.5rem;
}
.card.metric-card .metric-value {
  font-weight: 700;
  font-size: 1.125rem;
}

/* Layout for histórico de faturamento cards */
.faturamento-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.faturamento-header {
  width: 160px;
  text-align: center;
  background: linear-gradient(135deg, #e000ff, #ff8b8b);
  color: var(--white);
  font-weight: 700;
  border-radius: 0.5rem;
  padding: 0.5rem;
}

.faturamento-dia {
  width: 160px;
  background: linear-gradient(135deg, var(--border), var(--white));
  border-radius: 0.5rem;
  padding: 0.5rem;
  text-align: center;
  font-size: 0.875rem;
}

.faturamento-dia .valor {
  font-weight: 700;
}

.faturamento-dia .resultado {
  margin-top: 0.5rem;
  font-weight: 700;
}

.faturamento-dia .resultado.positivo {
  color: #16a34a;
}

.faturamento-dia .resultado.negativo {
  color: #dc2626;
}
.form-group {
  margin-bottom: 1.2rem;
}
.form-control {
  padding: 0.8rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.625rem;
  width: 100%;
  font-size: 1rem;
  transition: var(--transition);
  background: #f8fafc;
  font-family: Inter, sans-serif;
}
.form-control:focus {
  outline: 0;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(244, 92, 0, 0.15);
}
.form-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.form-row .form-group {
  flex: 1;
  min-width: 200px;
  margin-bottom: 0;
}
.form-row .form-group.compact {
  flex: 0 0 150px;
  min-width: 150px;
}
.form-row button.compact {
  flex: 0 0 auto;
}

.actions-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 1rem;
}

.status-critico {
  background-color: #ffebee;
  color: #b71c1c;
  font-weight: bold;
}

.status-correto {
  background-color: #e8f5e9;
  color: #1b5e20;
}

.data-table tbody tr.faixa-abaixo-minimo {
  background-color: #f8d7da !important;
  color: #721c24;
}

.data-table tbody tr.faixa-entre-minimo-medio {
  background-color: #fff3cd !important;
  color: #856404;
}

.data-table tbody tr.faixa-entre-medio-maximo {
  background-color: #d1ecf1 !important;
  color: #0c5460;
}

.data-table tbody tr.faixa-acima-maximo {
  background-color: #d4edda !important;
  color: #155724;
}

.data-table tbody tr.referencia-minima {
  background-color: #f8d7da !important;
  color: #721c24;
}

.data-table tbody tr.referencia-media {
  background-color: #fff3cd !important;
  color: #856404;
}

.data-table tbody tr.referencia-maxima {
  background-color: #d4edda !important;
  color: #155724;
}

.data-table tbody tr.faixa-abaixo-minimo a,
.data-table tbody tr.faixa-entre-minimo-medio a,
.data-table tbody tr.faixa-entre-medio-maximo a,
.data-table tbody tr.faixa-acima-maximo a {
  color: inherit;
}
.data-table tbody tr.referencia-minima a,
.data-table tbody tr.referencia-media a,
.data-table tbody tr.referencia-maxima a {
  color: inherit;
}
.input-with-icon {
  position: relative;
}
.input-with-icon i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray);
}
.input-with-icon input {
  padding-left: 3rem;
}
.badge {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  border-radius: 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
}
.badge-success {
  background: rgba(76, 175, 80, 0.15);
  color: #2e7d32;
}
.badge-warning {
  background: rgba(255, 193, 7, 0.15);
  color: #8d6e00;
}
.badge-danger {
  background: rgba(244, 67, 54, 0.15);
  color: #c62828;
}
.badge-info {
  background: rgba(28, 43, 54, 0.15);
  color: var(--primary);
}
.badge-secondary {
  background: rgba(158, 158, 158, 0.15);
  color: var(--gray);
}
.chart-container {
  background: var(--secondary);
  border-radius: 1rem;
  padding: 1.5rem;
  margin: 2rem 0;
  box-shadow: var(--card-shadow);
}
.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.chart-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--primary);
  font-family: Inter, sans-serif;
}
.history-item {
  padding: 1rem;
  border-bottom: 1px solid #edf2f7;
  background: var(--secondary);
  border-radius: 0.625rem;
  margin-bottom: 0.5rem;
  transition: var(--transition);
}
.history-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}
.history-date {
  color: var(--gray);
  font-size: 0.85rem;
  margin-top: 0.3rem;
}
.connection-status {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  padding: 0.6rem 1.2rem;
  border-radius: 3.125rem;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.online {
  background: var(--success);
  color: var(--white);
}
.offline {
  background: var(--error);
  color: var(--white);
}
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.offline .status-dot,
.online .status-dot {
  background: var(--white);
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.menu-toggle {
  display: none;
  background: 0 0;
  border: none;
  color: var(--primary);
  font-size: 1.5rem;
  cursor: pointer;
}
body.dark-mode {
  --background: #0f172a;
  --primary: #6366f1;
  --primary-hover: #818cf8;
  --secondary: #1e293b;
  --text: #e5e7eb;
  --text-light: #94a3b8;
  --border: #334155;
  --highlight: #14b8a6;
  --highlight-hover: #0d9488;
  --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.4);
  color: var(--text);
  background: var(--background);
}
body.dark-mode .card,
body.dark-mode .chart-container,
body.dark-mode .table-container {
  background: var(--secondary);
  color: var(--text);
}
body.dark-mode .navbar {
  background: var(--nav-bg);
  color: var(--nav-text);
  border-bottom: 1px solid var(--nav-border);
}
body.dark-mode .navbar .menu-item {
  color: var(--nav-text);
}
body.dark-mode .navbar .menu-item:hover,
body.dark-mode .navbar .menu-item.active {
  background-color: var(--nav-hover);
  color: var(--nav-text);
}
body.dark-mode .form-control {
  background: #334155;
  border-color: #334155;
  color: var(--text);
}
body.dark-mode .table th,
body.dark-mode .data-table th {
  background: #334155;
}

.submenu .nav-item {
  padding: 0.6rem 1.5rem;
  font-size: 0.9rem;
  background-color: transparent;
}

.submenu .nav-item:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-left: 2px solid var(--primary);
}

.submenu-link {
  color: var(--white);
  text-decoration: none;
  display: block;
  transition: color 0.2s;
}

.submenu-link:hover {
  color: var(--primary);
}

/* Utilitário para esconder o submenu */
.hidden {
  display: none;
}
.product-price {
  color: var(--success);
}

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--navbar-height);
  padding: 0 1rem;
  background: var(--nav-bg);
  color: var(--nav-text);
  border-bottom: 1px solid var(--nav-border);
}
@media (min-width: 768px) {
  .navbar {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}
.navbar .hamburger {
  display: none;
}
.navbar svg {
  color: var(--nav-text);
  stroke: var(--nav-text);
}
.navbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: flex-end;
  flex: 1 1 auto;
  min-width: 0;
}
.navbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}
.navbar-center {
  display: flex;
  justify-content: center;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 1rem;
}
.navbar-center.hidden {
  display: none;
}
.schedule-alert-banner {
  display: none;
  position: relative;
  isolation: isolate;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.75rem 1.75rem;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(
    180deg,
    rgba(220, 38, 38, 0.15) 0%,
    rgba(220, 38, 38, 0.6) 45%,
    rgba(185, 28, 28, 0.95) 100%
  );
  box-shadow: 0 18px 36px -18px rgba(185, 28, 28, 0.8);
  font-weight: 800;
  font-size: clamp(1rem, 0.9rem + 0.6vw, 1.4rem);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: center;
  line-height: 1.2;
}
.schedule-alert-banner::before {
  content: '';
  position: absolute;
  inset: 58% -1.5rem -0.9rem -1.5rem;
  border-radius: 22px;
  background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%);
  box-shadow: 0 18px 32px -18px rgba(185, 28, 28, 0.65);
  z-index: -1;
}
.schedule-alert-banner:not(.hidden) {
  display: inline-flex;
}
.schedule-alert-banner .alert-title {
  font-size: inherit;
}
.schedule-alert-banner .alert-details {
  font-weight: 700;
  font-size: clamp(0.95rem, 0.9rem + 0.4vw, 1.2rem);
  text-transform: none;
  letter-spacing: 0.02em;
}
.schedule-alert-banner .alert-extra {
  font-weight: 600;
  font-size: clamp(0.85rem, 0.8rem + 0.35vw, 1.05rem);
  text-transform: none;
  letter-spacing: 0.01em;
}
.navbar-search {
  height: 2.5rem;
  padding: 0 0.75rem;
  border-radius: 0.5rem;
  border: none;
}

.navbar-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 0.5rem;
  margin-top: 0.25rem;
  z-index: 50;
  max-height: 15rem;
  overflow-y: auto;
}

.navbar-search-results a {
  display: block;
  padding: 0.5rem 0.75rem;
  color: #374151;
  text-decoration: none;
}

.navbar-search-results a:hover {
  background: #f3f4f6;
}
.navbar-title {
  font-weight: 600;
  font-size: 1.125rem;
}
@media (min-width: 768px) {
  .navbar-title {
    font-size: 1.25rem;
  }
}
.navbar .menu-item {
  color: var(--nav-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.5rem;
  min-width: 2.5rem;
  padding: 0 0.75rem;
  border-radius: 0.5rem;
  white-space: nowrap;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}
.navbar .menu-item:hover,
.navbar .menu-item.active {
  background-color: var(--nav-hover);
  color: var(--nav-text);
}

@media (max-width: 768px) {
  .navbar-center {
    padding: 0 0.5rem;
  }
  .schedule-alert-banner {
    width: 100%;
    flex-direction: column;
    gap: 0.5rem;
  }
  .schedule-alert-banner .alert-details,
  .schedule-alert-banner .alert-extra {
    font-size: 0.95rem;
  }
}
.user-dropdown {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  position: relative;
}
.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--background);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--primary);
}
.user-info {
  display: flex;
  flex-direction: column;
}
.user-name {
  font-weight: 600;
  font-size: 15px;
}
.user-role {
  font-size: 12px;
  color: var(--text-light);
}
.main-content {
  margin-top: var(--navbar-height);
  padding: 25px;
  min-height: calc(100vh - var(--navbar-height));
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 25px rgba(0, 0, 0, 0.1);
}
.input-group {
  margin-bottom: 15px;
}
.input-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--text);
  font-size: 14px;
}
input,
select {
  width: 100%;
  padding: 12px 15px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--background);
  color: var(--text);
  font-size: 14px;
}
input:focus,
select:focus {
  outline: 0;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(244, 92, 0, 0.2);
}
.table-container {
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: var(--background);
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}
.table {
  width: 100%;
  border-collapse: collapse;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 960px;
}
.table th,
.data-table th {
  background: var(--background);
  text-align: left;
  padding: 12px 15px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-light);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
}
.table td,
.data-table td {
  padding: 12px 15px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  vertical-align: top;
}
.table tr:last-child td,
.data-table tr:last-child td {
  border-bottom: none;
}
.table tr:nth-child(2n),
.data-table tr:nth-child(2n) {
  background: rgba(0, 0, 0, 0.02);
}
body.dark-mode .table tr:nth-child(2n),
body.dark-mode .data-table tr:nth-child(2n) {
  background: rgba(255, 255, 255, 0.03);
}
.platform-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 1.25rem;
  font-size: 12px;
  font-weight: 600;
}
.platform-ml {
  background: #ffe0e0;
  color: #c62828;
}
.platform-shopee {
  background: #e3f2fd;
  color: #1565c0;
}
.platform-magalu {
  background: #e8f5e9;
  color: #2e7d32;
}
.platform-shein {
  background: #f3e5f5;
  color: #6a1b9a;
}
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  animation: 0.3s fadeIn;
}

dialog.modal[open] {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background-color: transparent;
}

dialog.modal::backdrop {
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}
.modal-content {
  background-color: var(--background);
  margin: 5% auto;
  padding: 25px;
  border-radius: 0.75rem;
  width: 90%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  animation: 0.4s slideIn;
}
.btn-close {
  float: right;
  font-size: 24px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-light);
}
.btn-close:hover {
  color: var(--text);
}
.toast {
  position: fixed;
  bottom: 25px;
  right: 25px;
  padding: 15px 20px;
  border-radius: 0.5rem;
  color: var(--white);
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
  animation:
    0.3s slideIn,
    0.5s 2.5s fadeOut;
}
.toast-success {
  background: var(--success);
}
.toast-error {
  background: var(--error);
}
.toast-warning {
  background: #ffc107;
}
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}
.skeleton {
  background: linear-gradient(
    90deg,
    var(--border) 25%,
    rgba(0, 0, 0, 0.05) 50%,
    var(--border) 75%
  );
  background-size: 200% 100%;
  animation: 1.5s infinite loading;
  border-radius: 0.25rem;
}
@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}
.tooltip {
  position: relative;
  display: inline-block;
}
.tooltip .tooltip-text {
  visibility: hidden;
  width: 120px;
  background-color: var(--primary);
  color: var(--white);
  text-align: center;
  border-radius: 0.375rem;
  padding: 5px 0;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  margin-left: -60px;
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 12px;
}
.tooltip .tooltip-text::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: var(--primary) transparent transparent transparent;
}
.tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}
.tooltip-lg .tooltip-text {
  width: 280px;
  margin-left: -140px;
  text-align: left;
  white-space: normal;
}
.dark-mode-toggle {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}
.dark-mode-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--gray-300);
  transition: 0.4s;
  border-radius: 1.5rem;
}
.toggle-slider:before {
  position: absolute;
  content: '';
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: var(--secondary);
  transition: 0.4s;
  border-radius: 50%;
}
input:checked + .toggle-slider {
  background-color: var(--primary);
}
input:checked + .toggle-slider:before {
  transform: translateX(26px);
}

/* Wrapper to keep charts responsive without overflowing */
.chart-wrapper {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 16rem; /* Tailwind h-64 */
  overflow: hidden;
}

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

@media (max-width: 768px) {
  .card.metric-card {
    min-width: 150px;
    padding: 2rem;
  }
  .card.metric-card .metric-value {
    font-size: 1.25rem;
  }
}

@media (max-width: 768px) {
  /* Ensure form inputs remain side by side on smaller screens */
  .form-row {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.8rem;
  }
  .chart-container {
    padding: 1rem;
  }
  td,
  th {
    padding: 0.8rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 576px) {
  .page-title {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
  }
  .btn {
    width: 100%;
    margin-bottom: 0.5rem;
  }
}

@media (max-width: 992px) {
  .navbar {
    left: 0;
    justify-content: space-between;
  }
  .menu-toggle {
    display: block;
  }
}

@media (max-width: 768px) {
  .grid-cols-2 {
    grid-template-columns: 1fr;
  }
  .modal-content {
    width: 95%;
    margin: 10px auto;
  }
  .navbar {
    left: 0;
    padding: 0 1rem;
  }
  .navbar .menu-item {
    display: none;
  }
  .navbar .menu-item.show-on-mobile {
    display: inline-flex;
  }
  .navbar .hamburger {
    display: block;
  }
  .main-content {
    padding-left: 1rem;
    padding-right: 1rem;
    padding-top: var(--navbar-height);
  }
}

@media (max-width: 640px) {
  .faturamento-header,
  .faturamento-dia {
    width: 130px;
  }
}

/* Mobile adjustments for cards and tables */
@media (max-width: 640px) {
  .card {
    padding: 1rem;
  }
  .data-table {
    display: block;
    width: 100%;
    overflow-x: auto;
  }
  .data-table th,
  .data-table td {
    padding: 0.5rem;
  }
}

@media (max-width: 640px) {
  #resumoTotais .card {
    padding: 0.5rem;
  }
}

#cardsProdutosUsuarios {
  grid-template-columns: repeat(1, minmax(0, 1fr));
  grid-auto-rows: 1fr;
}

@media (min-width: 768px) {
  #cardsProdutosUsuarios {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Garantir que os modais de expedição fiquem acima dos cards */
#pdfModal,
#storeModal,
#commentModal,
#sobrasModal,
#checklistModal,
#gestorModal {
  z-index: 60;
}

#pdfModal > div,
#storeModal > div,
#commentModal > div,
#sobrasModal > div,
#checklistModal > div,
#gestorModal > div {
  position: relative;
  z-index: 61;
}
