/* Tipografia */
body {
  font-family: "Courier New", monospace;
  font-size: 14px;
}

* {
  font-family: "Courier New", monospace;
  font-size: 16px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: bold;
  font-size: 16px;
}

h1,
h2,
h3 {
  font-size: 24px;
  padding-bottom: 20px;
  text-transform: uppercase;
}

/* Navbar */
.navbar {
  z-index: 1001;
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
}

.navbar-brand {
  text-transform: uppercase;
  font-size: 24px !important;
  font-weight: bold;
}

.navbar-text {
  color: #fff;
  font-size: 14px;
  font-weight: bold;
}

/* Cartões */
.card-header h4 {
  font-size: 16px;
}

/* Tabela */
th {
  font-size: 16px !important;
}

.table {
  font-size: 14px;
  min-width: 500px;
}

.table-responsive {
  max-width: 100%;
  overflow-x: auto;
}

/* Navegação lateral */
.sidebar {
  position: fixed;
  top: 56px;
  left: 0;
  width: 220px;
  height: calc(100vh - 56px);
  background-color: #f8f9fa;
  display: flex;
  flex-direction: column;
  padding: 10px 0;
  overflow-y: auto;
  z-index: 1000;
}

.sidebar .nav {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.sidebar .nav-link {
  padding: 10px 10px;
  display: flex;
  align-items: center;
  color: #333;
  border-radius: 4px;
  margin: 4px 12px;
  text-decoration: none;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  background-color: #007bff;
  color: white;
}

.sidebar .nav-link i {
  width: 20px;
  margin-right: 10px;
  display: inline-block;
}

/* Ajustar largura do offcanvas no mobile */
.offcanvas.offcanvas-start {
  width: 250px !important;
  max-width: 80vw;
}

/* Fundo e cores do offcanvas para combinar com sidebar desktop */
.offcanvas.offcanvas-start {
  background-color: #f8f9fa;
}

/* Links do offcanvas */
.offcanvas .nav-link {
  color: #333;
  padding: 12px 20px;
  margin: 4px 12px;
  border-radius: 4px;
  transition: background-color 0.3s ease, color 0.3s ease;
  text-decoration: none;
}

/* Hover e ativo no offcanvas */
.offcanvas .nav-link:hover,
.offcanvas .nav-link.active {
  background-color: #007bff;
  color: white;
}

/* Logout link no offcanvas */
.offcanvas .logout-link {
  margin-top: auto;
  padding: 12px 20px;
  color: #dc3545;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  border-top: 1px solid #ccc;
  transition: background-color 0.3s ease, color 0.3s ease;
  text-decoration: none;
  color: white;
}

.offcanvas .logout-link:hover {
  background-color: #dc3545;
  color: white;
}

/* Botão de logout com hover vermelho e texto branco */
a.logout-link:hover,
a.logout-link:focus,
button.logout-link:hover,
button.logout-link:focus {
  background-color: #dc3545 !important;
  color: #fff !important;
}

a.logout-link.text-danger:hover,
a.logout-link.text-danger:focus {
  background-color: #dc3545 !important;
  color: #fff !important;
}

a.logout-link.text-danger:hover i,
a.logout-link.text-danger:focus i {
  color: #fff !important;
}

/* Conteúdo */
.content-wrapper {
  margin-left: 220px;
  padding: 20px;
  padding-top: calc(56px + 20px);
  transition: margin-left 0.3s ease;
}

/* Formulários */
.form-label,
.form-control,
.form-select,
.btn {
  font-size: 14px;
  max-width: 100%;
}

/* Cards */
.card {
  max-width: 100%;
  overflow: hidden;
}

/* Grid */
.row {
  margin: 0;
}

.col-md-8,
.col-md-4 {
  padding-left: 5px;
  padding-right: 5px;
}

/* Navbar toggler para mobile */
.navbar-toggler {
  border-color: #007bff;
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml;charset=utf8,%3csvg viewBox='0 0 30 30' ... %3c/svg%3e");
}

.card-header {
  font-weight: 700;
  font-size: 18px;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
}

.d-grid .btn {
  font-weight: 600;
  font-size: 1.1rem;
}

/* Colunas da tabela */
.table td,
.table th {
  vertical-align: middle;
  font-size: 14px;
  white-space: normal;
  word-break: break-word;
}

.table-responsive {
  overflow-x: auto;
}

#imagem-preview {
  display: none;
  max-height: 150px;
}

#imagem-preview[src] {
  display: inline-block;
}

#imagem-preview:not([src]),
#imagem-preview[src=""] {
  display: none;
}

#btn-remover-preview {
  display: none;
}

.btn-shadow:focus {
  box-shadow: none;
}

.no-select {
  user-select: none;
  pointer-events: none;
  background-color: #e9ecef;
  color: #6c757d;
}

/* Garantir que o botão de incremento/descremento apareça corretamente em telas menores */
#quantidade {
  -webkit-appearance: textfield;
  /* Remover o estilo padrão em navegadores Webkit (como Chrome) */
  -moz-appearance: textfield;
  /* Remover o estilo padrão em Firefox */
  appearance: textfield;
  /* Remover o estilo padrão em outros navegadores */
}

#quantidade::-webkit-outer-spin-button,
#quantidade::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Remove os spinners do input type=number no Chrome, Safari, Edge, Opera */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Remove os spinners do input type=number no Firefox */
input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* Responsividade */

/* Mobile: esconde sidebar e remove margem */
@media (max-width: 991px) {
  .sidebar {
    display: none !important;
  }

  .content-wrapper {
    margin-left: 0 !important;
    padding-top: calc(56px + 10px);
  }
}

/* Desktop: mostra sidebar fixa */
@media (min-width: 992px) {
  .sidebar {
    display: flex !important;
    width: 220px;
  }

  .content-wrapper {
    margin-left: 220px;
    padding-top: calc(56px + 20px);
  }

  /* Quando o usuário não estiver logado, removemos o margin-left */
  .no-sidebar {
    margin-left: 0 !important;
  }
}

/* Responsividade para celular menor */
@media (max-width: 767px) {
  .sidebar {
    display: none;
  }

  .content-wrapper {
    margin-left: 0 !important;
    padding-top: calc(56px + 10px);
  }

  .table-responsive {
    display: none;
  }

  .table td,
  .table th {
    font-size: 0.85rem;
    padding: 0.4rem 0.5rem;
  }

  .btn-voltar {
    display: none;
  }

  .form-label {
    font-size: 0.9rem;
  }

  .btn {
    font-size: 0.9rem;
  }

  #quantidade {
    width: 50%;
  }

  .input-group {
    width: 100%;
  }
}

@media (max-width: 576px) {
  .navbar {
    padding-top: 0.25rem !important;
    padding-bottom: 0.25rem !important;
  }

  .navbar-brand img {
    height: 24px !important;
    margin-right: 5px !important;
  }

  .navbar-brand span {
    font-size: 18px !important;
  }

  .navbar-text {
    display: none !important;
  }

  form.d-flex {
    flex-direction: column;
    gap: 0.5rem;
  }

  .btn-copiar-link {
    width: 100%;
  }

  #quantidade {
    width: 50%;
  }

  .input-group {
    width: 100%;
  }
}

.btn:focus,
.btn:active,
.btn:focus:active {
  box-shadow: none !important;
  outline: none !important;
}

/* Estilos gerais */
.btn-voltar {
  margin-bottom: 1rem;
}

/* Estilos para tabelas */
.table-responsive {
  overflow-x: auto;
}

.table th {
  white-space: nowrap;
}

.table td {
  vertical-align: middle;
}

/* Estilos para colunas específicas */
.col-id {
  max-width: 50px;
  width: 50px;
}

.col-imagem {
  width: 80px;
  text-align: center;
}

.col-nome {
  min-width: 240px;
  width: 240px;
}

.col-preco {
  min-width: 120px;
  width: 120px;
  text-align: center;
}

.col-categoria {
  min-width: 160px;
  width: 160px;
}

.col-acoes {
  min-width: 120px;
  width: 120px;
  text-align: center;
}

.col-telefone {
  max-width: 220px;
  text-align: center;
}

.col-email {
  max-width: 240px;
}

.col-endereco {
  max-width: 400px;
}

/* Estilos para imagens */
.img-produto {
  max-width: 80px;
  max-height: 80px;
  object-fit: cover;
  cursor: pointer;
}

.img-produto-mobile {
  object-fit: cover;
  max-height: 80px;
}

.img-preview {
  max-height: 150px;
}

/* Estilos para formulários */
.form-select-categoria {
  min-width: 200px;
}

.form-busca {
  max-width: 400px;
}

.form-busca-historico {
  max-width: 500px;
}

.form-busca-historico .form-control {
  flex: 1 1 auto;
  max-width: 350px;
}

/* Estilos para botões */
.btn-gerenciar-categorias {
  min-width: 160px;
}

.btn-nowrap {
  white-space: nowrap;
}

/* Estilos para elementos específicos */
.imagem-preview-wrapper {
  display: none;
}

.btn-remover-preview {
  display: none;
}

.link-convite {
  display: none;
}

.requisitos-senha {
  list-style: none;
  padding-left: 0;
}

.endereco-readonly {
  overflow: hidden;
  resize: none;
}

/* Estilos para modais */
.modal-pdf {
  overflow-y: auto;
  height: 80vh;
}

.canvas-pdf {
  width: 100%;
}

/* Estilos para elementos condicionais */
.nenhum-item {
  display: none;
}

/* Estilos para layout responsivo */
.flex-shrink-0 {
  flex-shrink: 0;
}

.width-max-content {
  width: max-content;
}

.width-auto {
  width: auto;
}

.min-width-150 {
  min-width: 150px;
}

/* Estilos para tabelas de vendas */
.table-vendas th {
  width: 35%;
}

.table-vendas th.qtd {
  text-align: center;
  width: 10%;
}

.table-vendas th.preco {
  width: 20%;
}

.table-vendas th.total {
  width: 20%;
}

.table-vendas th.acoes {
  text-align: center;
  width: 5%;
}

/* Estilos para botões de ação */
.btn-acao {
  width: 40px;
  height: 40px;
  font-size: 20px;
}

.btn-acao-pequeno {
  width: 70px;
}

/* Estilos para colunas de perfil */
.col-perfil {
  width: 130px;
  white-space: nowrap;
}

/* Estilos para elementos de navegação */
.sidebar {
  height: calc(100vh - 56px);
  top: 56px;
  position: fixed;
  left: 0;
  width: 220px;
  background-color: #f8f9fa;
  overflow-y: auto;
  z-index: 1000;
}

/* Estilos para elementos de layout */
.main-content {
  min-height: 100vh;
}

/* Estilos para elementos de interface */
.toast-container {
  z-index: 1080;
}

.logo-navbar {
  height: 30px;
  margin-right: 10px;
}

.navbar-dark .navbar-brand,
.navbar-dark .navbar-brand:visited {
  color: #fff !important;
  background: transparent !important;
}

.navbar-dark .navbar-brand:hover,
.navbar-dark .navbar-brand:focus {
  color: #ffd700 !important;
  background: transparent !important;
  text-decoration: none;
}

/* Estilos para cards do dashboard - Design Moderno */
.dashboard-card-cliente {
  border-radius: 15px;
  box-shadow: none;
}

.dashboard-card-produto {
  border-radius: 15px;
  box-shadow: none;
}

.dashboard-card-venda {
  border-radius: 15px;
  box-shadow: none;
}

.dashboard-card-total {
  border-radius: 15px;
  box-shadow: none;
}

.dashboard-card-cliente .card-header {
  border-radius: 12px 12px 0 0;
  border: none;
  font-weight: 600;
  background: none;
}

.dashboard-card-produto .card-header {
  border-radius: 12px 12px 0 0;
  border: none;
  font-weight: 600;
  background: none;
}

.dashboard-card-venda .card-header {
  border-radius: 12px 12px 0 0;
  border: none;
  font-weight: 600;
  background: none;
}

.dashboard-card-total .card-header {
  border-radius: 12px 12px 0 0;
  border: none;
  font-weight: 600;
  background: none;
}

/* Estilos adicionais para modernizar o dashboard */
.dashboard-card {
  transition: all 0.3s ease;
  border: none;
  background: #ffffff;
}

.dashboard-card:hover {
  transform: translateY(-2px);
  box-shadow: none;
}

/* Centralização e alinhamento do conteúdo dos cards do dashboard */
.dashboard-card .card-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 120px;
  gap: 0.5rem;
}

.dashboard-card .card-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.25rem;
  min-height: 56px;
}

.dashboard-card .card-title {
  margin-bottom: 0.25rem;
}

.dashboard-card .card-text {
  margin-bottom: 0.5rem;
}

.dashboard-card .btn {
  margin-top: 0.5rem;
}

@media (max-width: 600px) {
  .dashboard-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .dashboard-card {
    width: 100% !important;
    min-width: 0;
    margin: 0 0 1rem 0;
    box-sizing: border-box;
  }

  .dashboard-card .card-body {
    padding: 1rem;
    min-height: 80px;
    gap: 0.5rem;
  }

  .dashboard-card-cliente .card-body h4.card-title,
  .dashboard-card-produto .card-body h4.card-title,
  .dashboard-card-venda .card-body h4.card-title,
  .dashboard-card-total .card-body h4.card-title {
    font-size: 1rem !important;
    font-weight: 700 !important;
    line-height: 1.1 !important;
    color: inherit !important;
  }
}

/* Estilo para o container do gráfico */
.grafico-container {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  padding: 1.5rem;
  border: 1px solid #f3f4f6;
}

.grafico-container h5 {
  color: #374151;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* Melhorias nos cards de estatísticas */
.stats-card {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 120px;
}

.stats-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.stats-card .stats-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.stats-card .stats-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 0;
}

.stats-card .stats-change {
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: 0.5rem;
}

.stats-card .stats-change.positive {
  color: #10b981;
}

.stats-card .stats-change.negative {
  color: #ef4444;
}

/* Hover effects para cards do dashboard */
.dashboard-card-cliente:hover,
.dashboard-card-produto:hover,
.dashboard-card-venda:hover,
.dashboard-card-total:hover {
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

/* Estilos para badges de status */
.badge.bg-success {
  background-color: #28a745 !important;
}

.badge.bg-danger {
  background-color: #dc3545 !important;
}

.badge.bg-warning {
  background-color: #ffc107 !important;
  color: #212529 !important;
}

.badge.bg-info {
  background-color: #17a2b8 !important;
}

.badge.bg-secondary {
  background-color: #6c757d !important;
}

/* Estilos para o gráfico do dashboard */
#graficoMensal {
  max-height: 400px;
  width: 100% !important;
}

.chart-container {
  position: relative;
  height: 400px;
  width: 100%;
  padding-left: 48px;
  padding-right: 48px;
}

/* Responsividade para o gráfico */
@media (max-width: 768px) {
  #graficoMensal {
    max-height: 300px;
  }

  .chart-container {
    height: 300px;
    padding-left: 24px;
    padding-right: 24px;
  }
}

@media (max-width: 480px) {
  .chart-container {
    padding-left: 24px;
    padding-right: 24px;
  }

  #btnPeriodoAnterior,
  #btnPeriodoProximo {
    width: 32px !important;
    height: 32px !important;
    font-size: 1rem !important;
    padding: 0 !important;
  }
}

/* Ícone de senha responsivo ao tema */
.senha-icon-bg {
  background: var(--senha-bg, #fff);
  border: 1px solid var(--senha-border, #ced4da);
  border-left: none;
  display: flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
}

.senha-eye-icon {
  color: var(--senha-eye, #007bff);
  transition: color 0.2s;
}

/* Tema claro */
[data-theme="light"] .senha-icon-bg {
  background: var(--input-bg);
  border-color: var(--input-border);
}

[data-theme="light"] .senha-eye-icon {
  color: #007bff !important;
}

/* Tema escuro */
[data-theme="dark"] .senha-icon-bg {
  background: var(--input-bg);
  border-color: var(--input-border);
}

[data-theme="dark"] .senha-eye-icon {
  color: #4da3ff !important;
}

/* Remove sombra dupla ao focar */
.input-group .form-control:focus {
  z-index: 2;
}

#togglePassword:focus {
  box-shadow: none !important;
  outline: none !important;
}

#togglePassword:hover,
#togglePassword:active {
  background: none !important;
}

/* Remove box-shadow dos campos de input ao focar */
#username:focus,
#password:focus {
  box-shadow: none !important;
  outline: none !important;
}

/* Quando o input de senha está em foco, a borda do ícone acompanha */
#password:focus + .senha-icon-bg,
#username:focus + .senha-icon-bg {
  border-color: #007bff !important;
}

/* Adiciona borda uniforme ao redor do grupo inteiro */
.input-group {
  border: 1px solid var(--input-border);
  border-radius: 0.375rem;
  background: var(--input-bg);
  transition: border-color 0.2s;
}

/* Borda de foco para o grupo inteiro */
.input-group:focus-within {
  border-color: #007bff !important;
}

.alert-fixed-top-wrapper {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  min-width: 300px;
  max-width: 90vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  /* Espaço entre os alerts */
}

.alert-fixed-top-wrapper .alert {
  margin-bottom: 0;
}
