* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  background: #0f172a;
  color: #0f172a;
}

.bg-gradient {
  background: linear-gradient(135deg, #0f172a, #1d4ed8);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.login-container {
  width: 100%;
  max-width: 420px;
}

.card {
  background: #ffffff;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(15,23,42,0.35);
}

.logo {
  font-size: 1.8rem;
  font-weight: 800;
  color: #0f172a;
}
.logo span {
  color: #2563eb;
}
.subtitle {
  font-size: 0.9rem;
  color: #6b7280;
  margin-bottom: 16px;
}

label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
  margin-top: 12px;
  display: block;
}
input, select, textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  padding: 10px 12px;
  margin-top: 4px;
  font-size: 0.95rem;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid #2563eb33;
  border-color: #2563eb;
}

.btn-primary, .btn-secondary {
  border-radius: 999px;
  padding: 10px 16px;
  border: none;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  margin-top: 16px;
}
.btn-primary {
  background: #22c55e;
  color: white;
  width: 100%;
}
.btn-primary:hover {
  background: #16a34a;
}
.btn-secondary {
  background: #e5e7eb;
}
.full-width {
  width: 100%;
}

.alert {
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.85rem;
  margin-bottom: 10px;
}
.alert-error {
  background: #fee2e2;
  color: #b91c1c;
}
.alert-success {
  background: #dcfce7;
  color: #166534;
}

.footer-text {
  text-align: center;
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: 12px;
}

/* Topbar */
.topbar {
  background: #0f172a;
  color: #f9fafb;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.role-badge {
  background: #1e293b;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.7rem;
  margin-left: 8px;
}
.role-badge.gerente {
  background: #0f766e;
}
.link-sair {
  color: #f97316;
  text-decoration: none;
  font-size: 0.85rem;
}

/* Conteúdo padrão */
.page-content {
  padding: 16px;
  color: #111827;
}
.page-content h2, .page-content h3 {
  margin-bottom: 10px;
}
.form-mobile {
  margin-top: 8px;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

/* KPIs */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px 0;
}
.kpi-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 10px 20px rgba(15,23,42,0.1);
}
.kpi-label {
  font-size: 0.75rem;
  color: #6b7280;
}
.kpi-value {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 4px;
}

.filter-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  align-items: center;
}

/* Canvas Chart */
card canvas, .card canvas {
  width: 100% !important;
  height: 260px !important;
}

@media (min-width: 768px) {
  .cards-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .login-container {
    max-width: 380px;
  }
}
