/* Reset básico para garantir consistência entre navegadores */
* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  color: #0f172a;
  background: #f8fafc;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font-family: inherit;
}

/* Paleta de cores e tokens do design */
:root {
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1f2937;
  --slate-900: #0f172a;

  --emerald-50: #ecfdf5;
  --emerald-100: #d1fae5;
  --emerald-500: #10b981;
  --emerald-600: #059669;
  --emerald-700: #047857;

  --amber-50: #fffbeb;
  --amber-100: #fef3c7;
  --amber-500: #f59e0b;
  --amber-600: #d97706;

  --red-50: #fef2f2;
  --red-100: #fee2e2;
  --red-500: #ef4444;
  --red-600: #dc2626;

  --orange-50: #fff7ed;
  --orange-500: #f97316;

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 8px rgba(0, 0, 0, 0.04);
  --radius: 16px;
}

/* Animação de entrada suave */
@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fade-in 0.3s ease-out forwards;
}

/* Layout geral das páginas */
.page {
  min-height: 100vh;
}

.container {
  max-width: 96rem;
  margin: 0 auto;
}

.header {
  height: 64px;
  background: #ffffff;
  border-bottom: 1px solid var(--slate-200);
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.header-title {
  font-weight: 700;
  color: var(--emerald-600);
  font-size: 20px;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--emerald-600);
  object-fit: cover;
}

.sidebar {
  width: 256px;
  background: #ffffff;
  border-right: 1px solid var(--slate-200);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  display: none;
  flex-direction: column;
  z-index: 40;
}

.sidebar-header {
  padding: 24px;
  font-weight: 700;
  color: var(--emerald-600);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
}

.nav {
  flex: 1;
  padding: 0 16px;
  margin-top: 16px;
}

.nav-item {
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--slate-600);
  background: transparent;
  border: none;
  cursor: pointer;
}

.nav-item:hover {
  background: var(--slate-50);
}

.nav-item.active {
  background: var(--emerald-50);
  color: var(--emerald-700);
  font-weight: 600;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid #f8fafc;
}

.logout {
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  color: var(--red-600);
  border-radius: 10px;
  border: none;
  background: transparent;
  cursor: pointer;
}

.logout:hover {
  background: var(--red-50);
}

.main {
  padding: 24px;
  background: var(--slate-50);
  min-height: calc(100vh - 64px);
}

.main-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding-bottom: 96px;
}

.mobile-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  border-top: 1px solid var(--slate-200);
  display: flex;
  justify-content: space-around;
  padding: 8px;
  z-index: 50;
}

.mobile-nav button {
  padding: 12px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: var(--slate-400);
}

.mobile-nav button.active {
  background: var(--emerald-100);
  color: var(--emerald-700);
}

/* Cartões visuais usados em várias seções */
.card {
  background: #ffffff;
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--slate-200);
}

.card-title {
  font-weight: 700;
  color: var(--slate-900);
}

/* Grade responsiva */
.grid {
  display: grid;
  gap: 24px;
}

.grid-2 {
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

/* Campos de entrada e botões */
.input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--slate-200);
  outline: none;
  transition: box-shadow 0.2s ease;
}

.input:focus {
  box-shadow: 0 0 0 2px var(--emerald-500);
}

.btn {
  display: inline-block;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 700;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--emerald-600);
  color: #ffffff;
  box-shadow: 0 8px 16px rgba(16, 185, 129, 0.2);
}

.btn-primary:hover {
  background: var(--emerald-700);
}

.btn-primary:disabled {
  background: var(--slate-200);
  box-shadow: none;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--emerald-600);
  color: #ffffff;
}

.btn-link {
  color: var(--emerald-600);
  font-weight: 700;
  font-size: 12px;
  background: transparent;
  border: none;
  cursor: pointer;
}

/* Distintivos (badges) */
.badge {
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  text-transform: uppercase;
}

.badge-red {
  background: var(--red-100);
  color: var(--red-600);
}

.badge-amber {
  background: var(--amber-100);
  color: var(--amber-600);
}

/* Barra de progresso */
.progress {
  width: 100%;
  height: 8px;
  background: var(--slate-100);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--emerald-600);
  transition: width 1s ease;
}

/* Tabela de dados */
table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: var(--slate-50);
  color: var(--slate-500);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

th {
  text-align: left;
  padding: 16px 24px;
}

td {
  padding: 16px 24px;
}

tbody tr {
  border-top: 1px solid var(--slate-100);
}

/* Utilitários rápidos */
.center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hidden {
  display: none;
}

.mt-4 {
  margin-top: 16px;
}

.mb-4 {
  margin-bottom: 16px;
}

.mb-6 {
  margin-bottom: 24px;
}

.gap-2 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.gap-3 {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.gap-4 {
  display: inline-flex;
  align-items: center;
  gap: 16px;
}

.text-muted {
  color: var(--slate-500);
}

.text-success {
  color: var(--emerald-700);
}

.text-warning {
  color: var(--amber-600);
}

.text-danger {
  color: var(--red-600);
}

.rounded {
  border-radius: 12px;
}

.rounded-full {
  border-radius: 999px;
}

.pill {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pill-emerald {
  background: var(--emerald-100);
  color: var(--emerald-600);
}

.pill-amber {
  background: var(--amber-100);
  color: var(--amber-600);
}

.pill-red {
  background: var(--red-100);
  color: var(--red-600);
}

.pill-orange {
  background: var(--orange-50);
  color: var(--orange-500);
}

/* Regras responsivas */
@media (min-width: 768px) {
  .sidebar {
    display: flex;
  }

  .main {
    margin-left: 256px;
  }

  .mobile-nav {
    display: none;
  }
}
