:root {
  --primary: #5e9cbb;
  --primary-hover: #d4bd37;
  --secondary: #2a5298;
  --background: #f8f9fa;
  --card-bg: #ffffff;
  --text-primary: #2c3e50;
  --text-secondary: #546e7a;
  --accent: #8d8142;
  --border: #e0e0e0;
  --success: #4CAF50;
  --error: #f44336;
  --warning: #ff9800;
  --info: #2196F3;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

html {
  min-height: 100%;
  background-image: url('/imagens/fundo.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  display: flex;
  justify-content: center;
  padding: 10px;
}



body {
  width: 100%;
  max-width: 1800px;
  padding: clamp(15px, 3vw, 30px);
  background: rgba(255, 255, 255, 0.92);
  border-radius: clamp(12px, 2vw, 16px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  line-height: 1.6;
  color: var(--text-primary);
}

header {
  background: linear-gradient(135deg, #5e9cbb 100%, #2c3e50cc 0%);
  color: white;
  border-radius: clamp(8px, 1.5vw, 10px);
  padding: clamp(15px, 3vw, 20px) clamp(15px, 4vw, 30px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: clamp(15px, 2vw, 25px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.1);
  gap: 15px;
}

header h1 {
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: clamp(8px, 2vw, 12px);
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
  letter-spacing: 0.5px;
}

.header-buttons {
  display: flex;
  gap: clamp(10px, 2vw, 15px);
  flex-wrap: wrap;
}

.header-buttons .btn-add {
  display: flex;
  align-items: center;
  gap: clamp(8px, 2vw, 10px);
  font-weight: 600;
  padding: clamp(10px, 2vw, 12px) clamp(15px, 3vw, 20px);
  border-radius: clamp(8px, 2vw, 12px);
  cursor: pointer;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  color: white;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: clamp(0.9rem, 2vw, 1rem);
}

.header-buttons .btn-add::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: 0.5s;
}

.header-buttons .btn-add:hover::before {
  left: 100%;
}

.header-buttons .btn-add:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.header-buttons .btn-add:active {
  transform: translateY(-1px);
}

.btn-acao {
  border: none;
  background: none;
  cursor: pointer;
  font-size: clamp(1rem, 3vw, 1.1rem);
  transition: all 0.3s ease;
  padding: 6px;
  border-radius: 50%;
  width: clamp(32px, 8vw, 38px);
  height: clamp(32px, 8vw, 38px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-acao:hover {
  transform: scale(1.1);
  background: rgba(0, 0, 0, 0.05);
}
.btn-acao.editar { 
  color: var(--success); 
}
.btn-acao.excluir { 
  color: var(--error); 
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
  margin-bottom: 15px;
  gap: clamp(15px, 3vw, 20px);
}
.card {
  background: var(--card-bg);
  padding: clamp(15px, 3vw, 20px);
  border-radius: clamp(8px, 2vw, 10px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transition: transform 0.3s, box-shadow 0.3s;
  border-left: 4px solid var(--primary);
}
.card:hover { 
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.12);
}
.card h3 { 
  font-size: clamp(0.85rem, 2vw, 0.95rem); 
  margin-bottom: 10px; 
  color: var(--text-secondary);
  font-weight: 600;
}
.card p { 
  font-size: clamp(1.2rem, 4vw, 1.5rem); 
  font-weight: 700; 
  color: var(--primary);
}

.filtros-section {
  background: var(--card-bg);
  padding: clamp(15px, 3vw, 20px);
  margin-bottom: clamp(15px, 3vw, 25px);
  border-radius: clamp(8px, 2vw, 12px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.filtros-section h3 {
  margin-bottom: 15px;
  color: var(--text-primary);
  font-size: clamp(1rem, 3vw, 1.1rem);
  display: flex;
  align-items: center;
  gap: 8px;
}

.filtros-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
}

.filtro-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.filtro-group.categorias {
  min-width: min(250px, 100%);
  flex: 2 1 300px;
}

.filtro-group label {
  font-size: clamp(0.8rem, 2vw, 0.85rem);
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.filtro-group input, .filtro-group select {
  padding: clamp(8px, 2vw, 10px) clamp(10px, 2vw, 12px);
  border-radius: clamp(6px, 2vw, 8px);
  border: 1px solid var(--border);
  outline: none;
  background: white;
  color: var(--text-primary);
  font-size: clamp(0.85rem, 2vw, 0.9rem);
  transition: border 0.3s;
  width: 100%;
}

.filtro-group input:focus, .filtro-group select:focus {
  border-color: var(--primary);
}

.filtro-group input[type="date"] {
  min-width: 0;
  flex: 1;
}

.filtros-section button {
  background: var(--primary);
  border: none;
  padding: clamp(10px, 2vw, 12px) clamp(15px, 3vw, 20px);
  border-radius: clamp(8px, 2vw, 12px);
  cursor: pointer;
  font-weight: 600;
  color: white;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
  height: fit-content;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
  font-size: clamp(0.85rem, 2vw, 0.9rem);
}

.filtros-section button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.checkbox-container {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(10px, 3vw, 15px);
  padding: clamp(6px, 2vw, 8px);
  background: rgba(248, 249, 250, 0.8);
  border-radius: clamp(6px, 2vw, 8px);
  border: 1px solid var(--border);
  max-height: 60px;
  overflow-y: auto;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.checkbox-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-bottom: 6px;
  accent-color: var(--primary);
}

.checkbox-item label {
  font-size: clamp(0.8rem, 2vw, 0.85rem);
  color: var(--text-secondary);
  cursor: pointer;
}

.graficos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: clamp(15px, 3vw, 20px);
  margin-bottom: clamp(20px, 4vw, 30px);
}

.grafico-card {
  background: var(--card-bg);
  padding: clamp(15px, 3vw, 20px);
  border-radius: clamp(8px, 2vw, 10px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  min-height: 300px;
  height: clamp(350px, 50vh, 400px);
}

.grafico-card h2 {
  font-size: clamp(1rem, 3vw, 1.1rem);
  margin-bottom: 15px;
  color: var(--text-primary);
  font-weight: 600;
}

.grafico-card canvas, .grafico-card div#mapaVendas {
  flex: 1;
  width: 100% !important;
  height: auto !important;
  min-height: 250px;
}

.grafico-card.produtos-por-estado { 
  grid-column: 1 / -1;
  height: clamp(400px, 60vh, 650px); 
}

.ranking {
  background: var(--card-bg);
  padding: clamp(15px, 3vw, 20px);
  border-radius: clamp(8px, 2vw, 12px);
  margin-bottom: clamp(20px, 4vw, 30px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.ranking h3 { 
  color: var(--text-primary); 
  margin-bottom: 15px;
  font-size: clamp(1rem, 3vw, 1.1rem);
}

.ranking ol {
  list-style-type: none;
  counter-reset: ranking-counter;
  max-height: 294px; 
  overflow-y: auto;
  padding-right: 5px;
}

.ranking li {
  padding: clamp(10px, 2vw, 12px) clamp(12px, 3vw, 15px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  counter-increment: ranking-counter;
  min-height: 49px; 
}

.ranking li::before {
  content: counter(ranking-counter);
  background: var(--primary);
  color: white;
  width: clamp(20px, 5vw, 24px);
  height: clamp(20px, 5vw, 24px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: clamp(8px, 3vw, 12px);
  font-size: clamp(0.7rem, 2vw, 0.8rem);
  font-weight: bold;
  flex-shrink: 0;
}

.ranking li:nth-child(-n+3)::before {
  background: var(--accent);
}

.ranking ol::-webkit-scrollbar {
  width: 6px;
}

.ranking ol::-webkit-scrollbar-thumb {
  background: #c5c5c5;
  border-radius: 3px;
}

.ranking ol::-webkit-scrollbar-thumb:hover {
  background: #a5a5a5;
}

.ranking ol::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.tabela {
  background: var(--card-bg);
  padding: clamp(15px, 3vw, 20px);
  border-radius: clamp(8px, 2vw, 12px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  overflow: auto;
}

.tabela h2 { 
  color: var(--text-primary); 
  margin-bottom: 15px;
  font-size: clamp(1rem, 3vw, 1.1rem);
}

.tabela table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text-primary);
  min-width: 800px;
}

.tabela thead {
  background: var(--primary);
  color: white;
}

.tabela th {
  padding: clamp(10px, 2vw, 12px) clamp(12px, 3vw, 15px);
  text-align: left;
  font-weight: 600;
  font-size: clamp(0.8rem, 2vw, 0.9rem);
  white-space: nowrap;
}

.tabela td {
  padding: clamp(10px, 2vw, 12px) clamp(12px, 3vw, 15px);
  border-bottom: 1px solid var(--border);
  font-size: clamp(0.8rem, 2vw, 0.9rem);
}

.tabela tbody tr {
  transition: background 0.2s;
}

.tabela tbody tr:hover {
  background: rgba(94, 156, 187, 0.05);
}

.tabela table tbody {
  display: block;
  max-height: 350px;
  overflow-y: auto;
}

.tabela table thead,
.tabela table tbody tr {
  display: table;
  width: 100%;
  table-layout: fixed;
}

.modal {
  position: fixed; 
  top: 0; 
  left: 0; 
  width: 100%; 
  height: 100%;
  background: rgba(0,0,0,0.7); 
  display: flex; 
  align-items: center; 
  justify-content: center;
  z-index: 9000;
  padding: clamp(10px, 3vw, 20px);
}

.modal-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

#btnCancelarExclusao:hover {
  background: #5a6268;
  transform: translateY(-1px);
}

#btnConfirmarExclusao:hover {
  background: #d32f2f;
  transform: translateY(-1px);
}

.modal-content-venda {
  background: white;
  border-radius: clamp(12px, 3vw, 16px);
  width: 100%;
  max-width: min(750px, 95vw);
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

.modal-header-venda {
  background: var(--primary);
  color: white;
  padding: clamp(15px, 4vw, 25px) clamp(20px, 4vw, 30px);
  border-radius: clamp(12px, 3vw, 16px) clamp(12px, 3vw, 16px) 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header-venda h2 {
  margin: 0;
  font-size: clamp(1.2rem, 4vw, 1.5rem);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: clamp(8px, 3vw, 12px);
}

.select-estado {
  padding: clamp(12px, 3vw, 14px) clamp(12px, 3vw, 15px);
  border-radius: clamp(8px, 2vw, 10px);
  border: 2px solid var(--border);
  background: white;
  color: var(--text-primary);
  font-size: clamp(0.9rem, 3vw, 1rem);
  transition: all 0.3s;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23546e7a' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right clamp(12px, 3vw, 15px) center;
  background-size: 16px;
  cursor: pointer;
  padding-right: 45px;
  width: 100%;
}

.select-estado:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(94, 156, 187, 0.15);
  transform: translateY(-1px);
}

.select-estado option {
  padding: 10px;
  font-size: clamp(0.85rem, 3vw, 0.95rem);
}

.select-estado option:checked {
  background: var(--primary);
  color: white;
}

.close-venda {
  background: none;
  border: none;
  color: white;
  width: clamp(35px, 8vw, 40px);
  height: clamp(35px, 8vw, 40px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: clamp(1rem, 4vw, 1.2rem);
  transition: all 0.3s;
  flex-shrink: 0;
}

.close-venda:hover {
  transform: rotate(90deg);
}

#formVenda {
  padding: clamp(20px, 4vw, 30px);
}

.form-section {
  margin-bottom: clamp(20px, 4vw, 30px);
  background: #f8f9fa;
  border-radius: clamp(8px, 2vw, 12px);
  padding: clamp(15px, 3vw, 20px);
  border: 1px solid var(--border);
}

.section-title {
  color: var(--text-primary);
  font-size: clamp(1rem, 3vw, 1.1rem);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
  gap: clamp(15px, 3vw, 20px);
}

.form-group-venda {
  display: flex;
  flex-direction: column;
}

.form-group-venda label {
  font-size: clamp(0.85rem, 3vw, 0.9rem);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-group-venda input {
  padding: clamp(12px, 3vw, 14px) clamp(12px, 3vw, 15px);
  border-radius: clamp(8px, 2vw, 10px);
  border: 2px solid var(--border);
  background: white;
  color: var(--text-primary);
  font-size: clamp(0.9rem, 3vw, 1rem);
  transition: all 0.3s;
  outline: none;
  width: 100%;
}

.form-group-venda input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(94, 156, 187, 0.15);
  transform: translateY(-1px);
}

.form-group-venda input::placeholder {
  color: #adb5bd;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: clamp(10px, 3vw, 15px);
  margin-top: clamp(20px, 4vw, 30px);
  padding-top: 20px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.btn-salvar {
  padding: clamp(12px, 3vw, 15px) clamp(20px, 4vw, 30px);
  background:var(--primary);
  border: none;
  border-radius: clamp(8px, 2vw, 12px);
  color: white;
  font-weight: 600;
  font-size: clamp(0.9rem, 3vw, 1rem);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(94, 156, 187, 0.3);
  flex: 1;
  min-width: 150px;
  justify-content: center;
}

.btn-salvar:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(94, 156, 187, 0.4);
}

.btn-cancelar {
  padding: clamp(12px, 3vw, 15px) clamp(15px, 3vw, 25px);
  background: #6c757d;
  border: none;
  border-radius: clamp(8px, 2vw, 12px);
  color: white;
  font-weight: 600;
  font-size: clamp(0.9rem, 3vw, 1rem);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s;
  flex: 1;
  min-width: 150px;
  justify-content: center;
}

.btn-cancelar:hover {
  background: #5a6268;
  transform: translateY(-2px);
}

.modal-content {
  background: white;
  padding: clamp(15px, 4vw, 25px);
  border-radius: clamp(8px, 2vw, 12px);
  width: 100%;
  max-width: min(65%, 500px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.modal-content h2 {
  color: var(--text-primary);
  font-size: clamp(1.2rem, 4vw, 1.4rem);
  align-items: center;
  gap: 10px;
}

.modal-content label { 
  display: block;
  font-size: clamp(0.8rem, 3vw, 0.9rem); 
  margin: clamp(10px, 3vw, 12px) 0 6px; 
  color: var(--text-secondary);
  font-weight: 500;
}

.modal-content input {
  width: 100%; 
  padding: clamp(10px, 3vw, 12px);
  border-radius: clamp(6px, 2vw, 8px); 
  border: 1px solid var(--border); 
  outline: none;
  background: white; 
  color: var(--text-primary);
  font-size: clamp(0.85rem, 3vw, 0.95rem);
  transition: border 0.3s;
}

.modal-content input:focus {
  border-color: var(--primary);
}

.modal-content button {
  margin-top: 20px;
  width: 100%;
  background: linear-gradient(135deg, #2c3e50 0%, #4ca1af 100%);
  border: none;
  padding: clamp(12px, 3vw, 14px);
  border-radius: clamp(8px, 2vw, 10px);
  font-weight: 600;
  color: white;
  cursor: pointer;
  transition: all 0.3s;
  font-size: clamp(0.9rem, 3vw, 1rem);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.modal-content button:hover { 
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.close {
  float: right; 
  cursor: pointer; 
  font-size: clamp(20px, 5vw, 24px);
  color: var(--text-secondary);
  transition: color 0.2s;
}
.close:hover { 
  color: var(--primary);
}

.form-row {
  display: flex;
  gap: clamp(10px, 3vw, 15px);
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.form-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: min(200px, 100%);
}

.form-group label {
  font-size: clamp(0.8rem, 3vw, 0.9rem);
  margin-bottom: 6px;
  color: var(--text-secondary);
  font-weight: 500;
}

.form-group input {
  padding: clamp(8px, 2vw, 10px) clamp(10px, 2vw, 12px);
  border-radius: clamp(5px, 2vw, 6px);
  border: 1px solid var(--border);
  font-size: clamp(0.85rem, 3vw, 0.95rem);
  transition: border-color 0.3s;
}

.form-group input:focus {
  border-color: var(--primary);
  outline: none;
}

::-webkit-scrollbar { 
  width: 8px; 
  height: 8px;
}
::-webkit-scrollbar-thumb { 
  background: #c5c5c5; 
  border-radius: 4px; 
}
::-webkit-scrollbar-thumb:hover { 
  background: #a5a5a5; 
}
::-webkit-scrollbar-track { 
  background: #f1f1f1; 
  border-radius: 4px;
}

.dashboard-layout {
  display: flex;
  gap: clamp(20px, 4vw, 30px);
  margin-top: 20px;
  flex-direction: column;
}

.sidebar-filtros {
  width: 100%;
  background: var(--card-bg);
  border-radius: clamp(8px, 2vw, 10px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: fit-content;
  position: static;
  border: 1px solid rgba(0,0,0,0.05);
}

.sidebar-header {
  background: var(--primary);
  color: white;
  padding: clamp(15px, 3vw, 20px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.sidebar-header h3 {
  margin: 0;
  font-size: clamp(1rem, 3vw, 1.2rem);
  display: flex;
  align-items: center;
  gap: 10px;
}

#botao{
display: none;
}

.sidebar-content {
  padding: clamp(15px, 3vw, 20px);
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 3vw, 0px);
  transition: all 0.3s ease;
}

.sidebar-content .filtro-group {
  margin-bottom: 0;
}

.sidebar-content .filtro-group label {
  font-size: clamp(0.8rem, 2vw, 0.85rem);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-content .filtro-group input,
.sidebar-content .filtro-group select {
  width: 100%;
  padding: clamp(6px, 3vw, 10px) clamp(12px, 3vw, 15px);
  border-radius: clamp(8px, 2vw, 10px);
  border: 2px solid var(--border);
  background: white;
  color: var(--text-primary);
  font-size: clamp(0.85rem, 3vw, 0.9rem);
  transition: all 0.3s;
}

.sidebar-content .filtro-group input:focus,
.sidebar-content .filtro-group select:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(94, 156, 187, 0.15);
  transform: translateY(-1px);
}

.sidebar-content .checkbox-container {
  background: rgba(248, 249, 250, 0.8);
  border-radius: clamp(8px, 2vw, 10px);
  padding: clamp(12px, 3vw, 18px);
  border: 2px solid var(--border);
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 5px;
}

.sidebar-content .checkbox-container::-webkit-scrollbar {
  width: 6px;
}

.sidebar-content .checkbox-container::-webkit-scrollbar-thumb {
  background: #c5c5c5;
  border-radius: 3px;
}

.sidebar-content .checkbox-item {
  display: flex;
  align-items: center;
  gap: clamp(8px, 3vw, 12px);
  padding: 5px 0;
  transition: all 0.2s;
}

.sidebar-content .checkbox-item:hover {
  transform: translateX(3px);
}

.sidebar-content .checkbox-item input[type="checkbox"] {
  width: clamp(18px, 4vw, 20px);
  height: clamp(18px, 4vw, 20px);
  accent-color: var(--primary);
  cursor: pointer;
}

.sidebar-content .checkbox-item label {
  font-size: clamp(0.85rem, 3vw, 0.9rem);
  color: var(--text-secondary);
  cursor: pointer;
  margin: 0;
  font-weight: 500;
  flex: 1;
}

.botoes-filtro {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 2vw, 12px);
  margin-top: 15px;
  padding-top: 20px;
  border-top: 2px solid var(--border);
}

.btn-filtro {
  width: 100%;
  padding: clamp(12px, 3vw, 15px);
  border-radius: clamp(8px, 2vw, 12px);
  border: none;
  background: var(--primary);
  color: white;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s;
  font-size: clamp(0.85rem, 3vw, 0.95rem);
  box-shadow: 0 4px 12px rgba(94, 156, 187, 0.2);
}

.btn-filtro:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(94, 156, 187, 0.3);
}

.btn-filtro.btn-secundario {
  background: #6c757d;
}

.btn-filtro.btn-secundario:hover {
  background: linear-gradient(135deg, #495057 0%, #343a40 100%);
  box-shadow: 0 8px 20px rgba(108, 117, 125, 0.3);
}

.conteudo-dashboard {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
}

.loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(5px);
}

.loader-container {
  background: white;
  padding: clamp(20px, 5vw, 40px) clamp(25px, 6vw, 50px);
  border-radius: clamp(15px, 4vw, 20px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(15px, 4vw, 25px);
  animation: scaleIn 0.3s ease-out;
  margin: 20px;
}

@keyframes scaleIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.loader-spinner {
  width: clamp(40px, 10vw, 60px);
  height: clamp(40px, 10vw, 60px);
  border: 4px solid rgba(94, 156, 187, 0.2);
  border-top: 4px solid var(--primary);
  border-right: 4px solid var(--primary);
  border-radius: 50%;
  animation: spin 0.8s cubic-bezier(0.65, 0.05, 0.36, 1) infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loader-text {
  font-size: clamp(1rem, 4vw, 1.2rem);
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.loader-icon {
  font-size: clamp(1.2rem, 4vw, 1.4rem);
}

.loader-info {
  font-size: clamp(0.8rem, 3vw, 0.9rem);
  color: var(--text-secondary);
  margin-top: 5px;
  text-align: center;
}

.loader-progress {
  width: clamp(150px, 40vw, 200px);
  height: 6px;
  background: #f0f0f0;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 10px;
}

.loader-progress-bar {
  height: 100%;
  background: var(--primary);
  width: 0%;
  animation: progress 2s ease-in-out infinite;
}

@keyframes progress {
  0% { width: 0%; }
  50% { width: 70%; }
  100% { width: 100%; }
}

.btn-loading {
  position: relative;
  color: transparent !important;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  margin-left: -10px;
  margin-top: -10px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.notificacoes-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(350px, 90vw);
}

.notificacao {
  padding: clamp(15px, 3vw, 18px) clamp(15px, 3vw, 20px);
  border-radius: clamp(8px, 2vw, 12px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: clamp(12px, 3vw, 15px);
  animation: slideIn 0.3s ease-out;
  transform-origin: top right;
  border-left: 5px solid;
  background: white;
  position: relative;
  overflow: hidden;
}

.notificacao::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, transparent, rgba(255,255,255,0.1), transparent);
  opacity: 0.3;
}

.notificacao.info {
  border-left-color: var(--info);
  background: linear-gradient(135deg, #f8fdff 0%, #e3f2fd 100%);
}

.notificacao.sucesso {
  border-left-color: var(--success);
  background: linear-gradient(135deg, #f8fff9 0%, #e8f5e9 100%);
}

.notificacao.erro {
  border-left-color: var(--error);
  background: linear-gradient(135deg, #fff8f8 0%, #ffebee 100%);
}

.notificacao.warning {
  border-left-color: var(--warning);
  background: linear-gradient(135deg, #fffdf8 0%, #fff3e0 100%);
}

.notificacao-icon {
  font-size: clamp(1.2rem, 4vw, 1.5rem);
  flex-shrink: 0;
}

.notificacao.info .notificacao-icon {
  color: var(--info);
}

.notificacao.sucesso .notificacao-icon {
  color: var(--success);
}

.notificacao.erro .notificacao-icon {
  color: var(--error);
}

.notificacao.warning .notificacao-icon {
  color: var(--warning);
}

.notificacao-content {
  flex: 1;
  min-width: 0;
}

.notificacao-title {
  font-weight: 600;
  font-size: clamp(0.85rem, 3vw, 0.95rem);
  margin-bottom: 4px;
  color: var(--text-primary);
}

.notificacao-message {
  font-size: clamp(0.8rem, 3vw, 0.9rem);
  color: var(--text-secondary);
}

.notificacao-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: clamp(1rem, 4vw, 1.2rem);
  cursor: pointer;
  padding: 5px;
  margin-left: 5px;
  transition: color 0.2s;
  flex-shrink: 0;
}

.notificacao-close:hover {
  color: var(--text-primary);
}

.notificacao-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(0,0,0,0.1);
  overflow: hidden;
}

.notificacao-progress-bar {
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left;
  animation: progressBar 5s linear forwards;
}

.notificacao.info .notificacao-progress-bar {
  background: var(--info);
}

.notificacao.sucesso .notificacao-progress-bar {
  background: var(--success);
}

.notificacao.erro .notificacao-progress-bar {
  background: var(--error);
}

.notificacao.warning .notificacao-progress-bar {
  background: var(--warning);
}

@keyframes slideIn {
  from {
    transform: translateX(100%) scale(0.9);
    opacity: 0;
  }
  to {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

@keyframes progressBar {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

#graficoPizza {
  max-width: min(300px, 90%);
  max-height: 300px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .dashboard-layout {
    flex-direction: row;
  }
  
  .sidebar-filtros {
    width: min(320px, 100%);
    position: sticky;
    top: 150px;
    height: fit-content;
  }
  
  .sidebar-content {
    display: flex !important;
  }
  
  .sidebar-header {
    cursor: default;
  }
  
  .conteudo-dashboard {
    width: calc(100% - min(320px, 100%) - 30px);
  }
}

@media (max-width: 767px) {

  html{
    padding: 3px;
  }

  .ranking li {

    font-size: 0.8rem;
  }



  .sidebar-filtros.colapsada .sidebar-content {
    display: none;
  }
  
  .sidebar-filtros:not(.colapsada) .sidebar-content {
    display: flex;
  }
  .modal{
    padding: 5px;
  }



    .modal-content-venda::-webkit-scrollbar{
    display: none !important;
  }
  

  .modal-content {
    max-width: 95%;
    padding: 15px;
  }
  
  .modal-header-venda {
    padding: 15px 20px;
  }
  
  .modal-header-venda h2 {
    font-size: 1.2rem;
  }
  
  #formVenda {
    padding: 20px;
  }
  
  .form-section {
    padding: 15px;
  }
  
  .form-actions {
    flex-direction: column;
  }
  
  .btn-salvar, .btn-cancelar {
    width: 100%;
  }
  
  header { 
    flex-direction: column; 
    text-align: center;
    gap: 15px;
  }
  
  .header-buttons {
    justify-content: center;
    width: 100%;
  }
  
  .header-buttons .btn-add {
    flex: 1;
    min-width: 150px;
    justify-content: center;
  }
  
  .tabela table {
    font-size: 0.8rem;
  }
  
  .tabela th, .tabela td {
    padding: 8px 10px;
  }
  
  .notificacoes-container {
    left: 20px;
    right: 20px;
    max-width: none;
  }
  
  .notificacao {
    max-width: 100%;
  }

   .filtro-group input[type="date"],
  .sidebar-content input[type="date"] {
    width: 100%;
    max-width: 100%;
    font-size: 16px !important; 
    padding: 12px 15px;
    box-sizing: border-box;
  }
  
  input[type="date"]::-webkit-calendar-picker-indicator {
    padding: 0;
    margin: 0;
    opacity: 0.7;
  }
  
  input[type="date"] {
    min-height: 44px; 
  }
  
  .filtro-group {
    position: relative;
  }
  
}

@media (max-width: 480px) {
  body {
    padding: 5px;
  }
  
  .cards {
    grid-template-columns: 1fr;
  }
  
  .graficos {
    grid-template-columns: 1fr;
  }
  
  .grafico-card.produtos-por-estado {
    height: 400px;
  }
  
  .modal-content-venda {
    margin: 5px;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
  }
  
  .filtros-row {
    flex-direction: column;
  }
  
  .filtro-group {
    width: 100%;
  }

   .filtro-group input[type="date"] {
    font-size: 14px;
    padding: 10px 12px 10px 40px;
    background-position: left 10px center;
    background-repeat: no-repeat;
    background-size: 20px;
  }
  
  input[type="date"]::-webkit-inner-spin-button,
  input[type="date"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }
  
  input[type="date"]::-webkit-clear-button {
    display: none;
  }
  
  .header-buttons .btn-add {
    min-width: 120px;
    padding: 10px 15px;
  }
  
  .tabela {
    font-size: 0.75rem;
  }
  
  .btn-acao {
    width: 30px;
    height: 30px;
    padding: 4px;
  }
}

@media (min-width: 1200px) {
  .graficos {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .grafico-card.produtos-por-estado {
    grid-column: span 2;
  }
}

@media (max-width: 360px) {
  .filtro-group input[type="date"] {
    font-size: 13px;
    padding: 8px 10px 8px 35px;
  }
  
  .filtro-group label {
    font-size: 12px;
  }
  
  input[type="date"]::placeholder {
    font-size: 12px;
  }
}

@media (max-height: 500px) and (max-width: 767px) {
  .filtro-group input[type="date"]:focus {
    position: relative;
    z-index: 100;
  }
}

@media (orientation: landscape) and (max-height: 600px) {
  .grafico-card {
    height: 250px;
  }
  
  .grafico-card.produtos-por-estado {
    height: 300px;
  }
  
  .modal-content-venda {
    max-height: 95vh;
  }
}

@media print {
  body {
    background: white;
    box-shadow: none;
    padding: 0;
  }
  
  .sidebar-filtros, 
  .header-buttons,
  .btn-acao,
  .modal,
  .notificacoes-container {
    display: none !important;
  }
  
  .grafico-card canvas {
    max-height: 300px !important;
  }
}

.sidebar-filtros.colapsada .sidebar-content {
  display: none;
}

.sidebar-filtros.colapsada {
  width: 60px;
}

.conteudo-dashboard.expandido {
  margin-left: -240px;
  transition: margin-left 0.3s;
}

@media (max-width: 767px) {
  .sidebar-filtros.colapsada {
    width: 100%;
  }
  
  .conteudo-dashboard.expandido {
    margin-left: 0;
  }

  #botao{
        background: var(--primary);
    color: white;
    padding: clamp(5px, 3vw, 20px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
  }
}