/* ============================================================
   RodaGrana - CSS Customizado
   Baseado no design system do tema BanCo/Urbanist
   ============================================================ */

/* ---- Layout ---- */
.layout-wrapper .sidebar-wrapper {
  left: -280px;
  transition: left 0.35s cubic-bezier(0.4,0,0.2,1);
}
.layout-wrapper.sidebar-open .sidebar-wrapper {
  left: 0;
}
.layout-wrapper .body-wrapper {
  transition: margin-left 0.35s cubic-bezier(0.4,0,0.2,1);
  margin-left: 0;
}

@media (min-width: 1280px) {
  .layout-wrapper .sidebar-wrapper {
    left: 0;
  }
  .layout-wrapper .body-wrapper {
    margin-left: 280px;
  }
  .topbar-wrapper {
    left: 280px !important;
  }
}

/* Topbar */
.topbar-wrapper {
  left: 0;
  right: 0;
  transition: left 0.35s cubic-bezier(0.4,0,0.2,1);
}

/* ---- Scrollbar ---- */
.scrollbar-none::-webkit-scrollbar { display: none; }
.scrollbar-none { -ms-overflow-style: none; scrollbar-width: none; }

/* ---- Sidebar items active ---- */
.sidebar-item-active {
  background-color: rgba(34, 197, 94, 0.08);
  color: #22C55E;
  font-weight: 600;
}
.dark .sidebar-item-active {
  background-color: rgba(34, 197, 94, 0.12);
}

/* ---- Cards ---- */
.stat-card {
  background: #ffffff;
  border-radius: 1.25rem;
  padding: 1.25rem 1.5rem;
  transition: box-shadow 0.2s, transform 0.2s;
}
.stat-card:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,0.07);
  transform: translateY(-2px);
}
.dark .stat-card {
  background: #1d1e24;
}

/* ---- Progress Bar ---- */
.progress-bar {
  height: 6px;
  border-radius: 9999px;
  background: #e5e7eb;
  overflow: hidden;
}
.dark .progress-bar {
  background: #2d2d35;
}
.progress-fill {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, #22C55E, #16a34a);
  transition: width 1s ease-in-out;
}

/* ---- Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
}
.badge-success { background: #d1fae5; color: #059669; }
.badge-danger  { background: #fee2e2; color: #dc2626; }
.badge-warning { background: #fef3c7; color: #d97706; }
.badge-info    { background: #dbeafe; color: #2563eb; }
.dark .badge-success { background: rgba(5,150,105,0.15); color: #34d399; }
.dark .badge-danger  { background: rgba(220,38,38,0.15);  color: #f87171; }
.dark .badge-warning { background: rgba(217,119,6,0.15);  color: #fbbf24; }
.dark .badge-info    { background: rgba(37,99,235,0.15);  color: #60a5fa; }

/* ---- Formulários ---- */
.form-input {
  width: 100%;
  padding: 0.625rem 1rem;
  border-radius: 0.75rem;
  border: 1.5px solid #e5e7eb;
  background: #f9fafb;
  font-size: 0.875rem;
  color: #111827;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus {
  border-color: #22C55E;
  box-shadow: 0 0 0 3px rgba(34,197,94,0.1);
  background: #ffffff;
}
.dark .form-input {
  background: #14151a;
  border-color: #2d2d35;
  color: #f9fafb;
}
.dark .form-input:focus {
  background: #1d1e24;
  border-color: #22C55E;
}
.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.375rem;
}
.dark .form-label { color: #d1d5db; }

/* ---- Botões ---- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.5rem;
  background: #22C55E;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 0.75rem;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}
.btn-primary:hover {
  background: #16a34a;
  box-shadow: 0 4px 20px rgba(34,197,94,0.35);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.5rem;
  background: #f3f4f6;
  color: #374151;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 0.75rem;
  border: 1.5px solid #e5e7eb;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.btn-secondary:hover { background: #e5e7eb; transform: translateY(-1px); }
.dark .btn-secondary {
  background: #2d2d35;
  color: #d1d5db;
  border-color: #3d3d45;
}
.dark .btn-secondary:hover { background: #3d3d45; }

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.5rem;
  background: #ef4444;
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 0.75rem;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.btn-danger:hover { background: #dc2626; transform: translateY(-1px); }

/* ---- Tabelas ---- */
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.data-table thead th {
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
}
.dark .data-table thead th {
  background: #14151a;
  color: #9ca3af;
  border-color: #2d2d35;
}
.data-table tbody td {
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  color: #374151;
  border-bottom: 1px solid #f3f4f6;
}
.dark .data-table tbody td { color: #d1d5db; border-color: #2d2d35; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: #f9fafb; }
.dark .data-table tbody tr:hover td { background: rgba(255,255,255,0.03); }

/* ---- Animações ---- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-fade-in-up { animation: fadeInUp 0.4s ease-out forwards; }

@keyframes bounceOnce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.animate-bounce-once { animation: bounceOnce 0.5s ease-in-out; }

/* ---- Auth pages ---- */
.auth-bg {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 40%, #fff 100%);
}
.dark .auth-bg {
  background: linear-gradient(135deg, #0d0e12 0%, #1d1e24 100%);
}

/* ---- Gráfico placeholder ---- */
.chart-wrapper { position: relative; width: 100%; }

/* ---- Tooltips ---- */
[data-tooltip] { position: relative; cursor: help; }
[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #111827;
  color: #fff;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.7rem;
  white-space: nowrap;
  z-index: 50;
  pointer-events: none;
}
.dark [data-tooltip]:hover::after { background: #374151; }

/* ---- Zona de risco (mapa) ---- */
.zone-badge        { display: inline-flex; align-items: center; padding: .25rem .75rem; font-size: .75rem; font-weight: 600; border-radius: 9999px; }
.zone-badge-baixo  { background: #d1fae5; color: #059669; }
.zone-badge-medio  { background: #fef3c7; color: #d97706; }
.zone-badge-alto   { background: #fee2e2; color: #dc2626; }

/* ---- Responsividade geral ---- */
@media (max-width: 640px) {
  .stat-card { padding: 1rem; }
  .data-table thead th, .data-table tbody td { padding: 0.625rem 0.75rem; }
}
