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

:root {
  --primary: #06367e;
  --primary-light: #0a4ba8;
  --secondary: #64748b;
  --success: #10b981;
  --danger: #b00020;
  --warning: #f59e0b;
  --background: #000000;
  --background-gradient: linear-gradient(135deg, #000000 0%, #0a0a0a 100%);
  --surface: #1a1a1a;
  --border: #333;
  --text: #e0e0e0;
  --text-muted: #999;
  --sidebar-bg: #111;
  --sidebar-text: #e0e0e0;
  --sidebar-hover: #222;
}

body.light-theme {
  --background: #f5f5f5;
  --background-gradient: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
  --surface: #ffffff;
  --border: #d0d0d0;
  --text: #1a1a1a;
  --text-muted: #666;
  --sidebar-bg: #ffffff;
  --sidebar-text: #1a1a1a;
  --sidebar-hover: #f0f0f0;
}

body {
  background: var(--background-gradient);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: all 0.3s ease;
}

/* Login Screen */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--background-gradient);
  padding: 20px;
}

.login-container {
  background: var(--surface);
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--border);
}

.login-container h1 {
  text-align: center;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 32px;
}

.subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 32px;
  font-size: 14px;
}

.login-form h2,
.register-form h2 {
  margin-bottom: 24px;
  color: var(--text);
  font-size: 24px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-weight: 500;
  font-size: 14px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s;
  background: var(--surface);
  color: var(--text);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 5px rgba(0, 74, 173, 0.3);
}

.btn-primary {
  width: 100%;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 2px 4px rgba(0, 74, 173, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 74, 173, 0.5);
}

.toggle-form {
  margin-top: 20px;
  text-align: center;
  font-size: 14px;
}

.toggle-form a {
  color: var(--primary-light);
  text-decoration: none;
  font-weight: 600;
}

/* Main App Layout */
#mainApp {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  box-shadow: 4px 0 6px rgba(0, 0, 0, 0.3);
  border-right: 2px solid var(--primary);
  transition: all 0.3s ease;
}

body.light-theme .sidebar {
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}

.sidebar-header h2 {
  font-size: 20px;
  color: white;
  margin-bottom: 12px;
}

.theme-toggle-small {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: white;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 18px;
  padding: 0;
}

.theme-toggle-small:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.theme-icon {
  font-size: 18px;
  line-height: 1;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: 8px;
  margin-bottom: 4px;
  transition: all 0.3s;
  font-weight: 500;
}

body.light-theme .nav-item {
  color: #1a1a1a;
}

body.light-theme .nav-item:hover {
  background: #e8e8e8;
  color: #000;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: white;
}

.nav-item.active {
  background: var(--primary);
  color: white;
  border-bottom: 3px solid var(--primary-light);
}

.nav-item .icon {
  font-size: 20px;
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 18px;
}

.user-details {
  flex: 1;
}

.user-name {
  font-weight: 600;
  color: white;
  font-size: 14px;
}

body.light-theme .user-name {
  color: #1a1a1a;
}

.user-role {
  font-size: 12px;
  color: var(--sidebar-text);
}

body.light-theme .user-role {
  color: #666;
}

.btn-logout {
  width: 100%;
  padding: 8px 16px;
  background: rgba(176, 0, 32, 0.1);
  color: #fca5a5;
  border: 1px solid rgba(176, 0, 32, 0.2);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
}

.btn-logout:hover {
  background: rgba(176, 0, 32, 0.2);
}

/* Main Content */
.main-content {
  margin-left: 280px;
  flex: 1;
  padding: 30px;
  min-height: 100vh;
}

.page {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-header {
  margin-bottom: 32px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.page-header h1 {
  font-family: Arial, Helvetica, sans-serif;
  font-weight: bold;
  font-size: 32px;
  margin-bottom: 8px;
  color: var(--text);
  border-bottom: 2px solid var(--primary);
  padding-bottom: 10px;
}

.page-header p {
  color: var(--text-muted);
  font-size: 14px;
}

/* Cards */
.card {
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  margin-bottom: 24px;
  border-left: 4px solid var(--primary);
  border: 1px solid var(--border);
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.card-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.card-body {
  padding: 24px;
}

/* Ranking Table */
.ranking-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.ranking-table th, .ranking-table td {
  padding: 15px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.ranking-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--border);
  font-weight: bold;
  font-size: 14px;
}

.rank-badge.top-1 { background: #ffd700; color: #000; }
.rank-badge.top-2 { background: #c0c0c0; color: #000; }
.rank-badge.top-3 { background: #cd7f32; color: #000; }

.vendas-count {
  font-weight: bold;
  color: var(--success);
  font-size: 18px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--surface);
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  border-left: 4px solid var(--primary);
  border: 1px solid var(--border);
  transition: all 0.3s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.stat-card h3 {
  color: var(--text);
  font-size: 16px;
  margin-bottom: 8px;
}

.stat-label {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 32px;
  font-weight: bold;
  color: var(--text);
}

.numero {
  font-size: 32px;
  font-weight: bold;
  color: var(--text);
}

/* Filters */
.filters-card {
  background: var(--surface);
  padding: 20px 24px;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  border-left: 4px solid var(--primary);
  border: 1px solid var(--border);
}

.filtros {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 25px;
  background: var(--surface);
  padding: 20px;
  border-radius: 8px;
  border-left: 4px solid var(--primary);
  border: 1px solid var(--border);
}

.filtros label {
  display: block;
  margin-bottom: 5px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.filter-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-weight: 500;
  font-size: 14px;
}

.filter-group input,
.filter-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
  transition: all 0.3s;
}

.filter-group input:focus,
.filter-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 5px rgba(0, 74, 173, 0.3);
}

/* Produtos Grid */
.produtos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 24px;
}

.produto-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: all 0.3s;
  border-left: 4px solid var(--primary);
  border: 1px solid var(--border);
}

.produto-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.produto-card-header {
  margin-bottom: 12px;
}

.produto-card-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}

.produto-card-code {
  font-size: 13px;
  color: var(--text-muted);
}

.produto-lojas {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.loja-badge {
  background: var(--primary);
  color: white;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
}

.produto-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.produto-stat {
  text-align: center;
}

.produto-stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.produto-stat-value {
  font-size: 20px;
  font-weight: bold;
  color: var(--text);
}

/* Form */
.form-container {
  max-width: 800px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.lojas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.loja-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  background: var(--surface);
}

.loja-checkbox:hover {
  border-color: var(--primary);
  background: rgba(0, 74, 173, 0.05);
}

.loja-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.loja-checkbox input[type="checkbox"]:checked + span {
  color: var(--primary-light);
  font-weight: 600;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

.btn-secondary {
  padding: 12px 24px;
  background: #333;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-secondary:hover {
  background: #444;
  transform: translateY(-2px);
}

/* Funcionárias Grid */
.funcionarias-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.funcionaria-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  border-left: 4px solid var(--primary);
  border: 1px solid var(--border);
}

.funcionaria-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.funcionaria-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 24px;
}

.funcionaria-info h3 {
  font-size: 18px;
  margin-bottom: 4px;
  color: var(--text);
}

.funcionaria-username {
  font-size: 14px;
  color: var(--text-muted);
}

.funcionaria-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.funcionaria-stat {
  text-align: center;
}

.funcionaria-stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.funcionaria-stat-value {
  font-size: 24px;
  font-weight: bold;
  color: var(--text);
}

/* Performance List */
.performance-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-bottom: 12px;
  transition: all 0.3s;
  background: var(--surface);
}

.performance-item:hover {
  background: rgba(0, 74, 173, 0.05);
  border-color: var(--primary);
}

.performance-rank {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 74, 173, 0.1);
  color: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 18px;
}

.performance-info {
  flex: 1;
  margin-left: 16px;
}

.performance-name {
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
}

.performance-username {
  font-size: 13px;
  color: var(--text-muted);
}

.performance-stats {
  display: flex;
  gap: 24px;
}

.performance-stat {
  text-align: center;
}

.performance-stat-label {
  font-size: 12px;
  color: var(--text-muted);
}

.performance-stat-value {
  font-size: 18px;
  font-weight: bold;
  color: var(--text);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--surface);
  border-radius: 16px;
  max-width: 800px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border);
}

.modal-header {
  padding: 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 16px 16px 0 0;
}

.modal-header h2 {
  font-size: 24px;
  color: white;
}

.close-btn {
  background: none;
  border: none;
  font-size: 32px;
  cursor: pointer;
  color: white;
  line-height: 1;
}

.close-btn:hover {
  color: rgba(255, 255, 255, 0.7);
}

.modal-body {
  padding: 24px;
}

/* Alert */
.alert {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 16px 24px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 2000;
  animation: slideIn 0.3s;
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.alert-success {
  background: var(--success);
  color: white;
}

.alert-error {
  background: var(--danger);
  color: white;
}

/* Inputs and Forms */
input, select, textarea {
  width: 100%;
  padding: 10px 14px;
  margin-top: 5px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 14px;
  transition: all 0.3s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 5px rgba(0, 74, 173, 0.3);
}

label {
  display: block;
  margin-top: 12px;
  color: var(--text);
  font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    position: relative;
    height: auto;
  }
  
  .main-content {
    margin-left: 0;
    padding: 20px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .produtos-grid {
    grid-template-columns: 1fr;
  }
  
  .funcionarias-grid {
    grid-template-columns: 1fr;
  }
  
  .filtros {
    grid-template-columns: 1fr;
  }
  
  .filters-card {
    grid-template-columns: 1fr;
  }
}

/* Hidden elements */
.admin-only {
  display: none;
}

body.is-admin .admin-only {
  display: block;
}

body.is-admin .nav-item.admin-only {
  display: flex;
}

/* Cards de resumo específicos */
.cards-resumo {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.cards-resumo .card {
  background: var(--surface);
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  border-left: 4px solid var(--primary);
  border: 1px solid var(--border);
  transition: all 0.3s;
}

.cards-resumo .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.cards-resumo .card h3 {
  color: var(--text);
  font-size: 16px;
  margin-bottom: 8px;
}







