/* Importar fonte Inter do Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Variáveis CSS - Tema Claro */
:root {
  --font-size: 16px;
  --background: #ffffff;
  --foreground: #0f172a;        /* trocado */
  --card: #ffffff;
  --card-foreground: #0f172a;   /* trocado */
  --primary: #0f172a;           /* trocado */
  --primary-foreground: #ffffff;
  --secondary: #f8f8f8;
  --secondary-foreground: #0f172a; /* trocado */
  --muted: #f8f8f8;
  --muted-foreground: #6b6b6b;
  --accent: #f0f0f0;
  --destructive: #d4183d;
  --border: #e5e5e5;
  --input-background: #fafafa;
  --chart-1: #8b7355;
  --chart-2: #5c4a3a;
  --chart-3: #a89080;
  --radius: 0.75rem;
  --sidebar: #fafafa;
}


/* Tema Escuro */
.dark {
  --background: #1a1511;
  --foreground: #f0ede8;
  --card: #2a2420;
  --card-foreground: #f0ede8;
  --primary: #a89080;
  --primary-foreground: #1a1511;
  --secondary: #3a3430;
  --secondary-foreground: #f0ede8;
  --muted: #3a3430;
  --muted-foreground: #a0a0a0;
  --accent: #4a4440;
  --destructive: #d4183d;
  --border: #3a3430;
  --input-background: #2a2420;
  --chart-1: #a89080;
  --chart-2: #8b7355;
  --chart-3: #6b5d50;
  --sidebar: #1a1511;
}

/* Reset e Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: var(--font-size);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.5;
}

/* Tipografia */
h1 {
  font-size: 1.875rem; /* 30px */
  font-weight: 500;
  line-height: 1.5;
  color: var(--foreground);
}

h2 {
  font-size: 1.5rem; /* 24px */
  font-weight: 500;
  line-height: 1.5;
  color: var(--foreground);
}

h3 {
  font-size: 1.125rem; /* 18px */
  font-weight: 500;
  line-height: 1.5;
  color: var(--foreground);
}

h4 {
  font-size: 1rem; /* 16px */
  font-weight: 500;
  line-height: 1.5;
  color: var(--foreground);
}

p {
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
}

label {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
}

button {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
  border: none;
  outline: none;
}

input, textarea, select {
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  font-family: inherit;
}

/* Utilidades */
.hidden { display: none; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.block { display: block; }
.min-h-screen { min-height: 100vh; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-5 > * + * { margin-top: 1.25rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-6 { margin-top: 1.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: var(--radius); }
.rounded-full { border-radius: 9999px; }
.border { border: 1px solid var(--border); }
.border-2 { border: 2px solid var(--border); }
.border-b { border-bottom: 1px solid var(--border); }
.border-t { border-top: 1px solid var(--border); }
.border-dashed { border-style: dashed; }
.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.transition-all { transition: all 0.2s ease-in-out; }
.cursor-pointer { cursor: pointer; }
.relative { position: relative; }
.absolute { position: absolute; }
.sticky { position: sticky; }
.top-0 { top: 0; }
.bottom-0 { bottom: 0; }
.left-0 { left: 0; }
.right-3 { right: 0.75rem; }
.z-10 { z-index: 10; }
.z-50 { z-index: 50; }
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }

/* Cores de texto */
.text-primary { color: var(--primary); }
.text-muted { color: var(--muted-foreground); }
.text-foreground { color: var(--foreground); }
.text-white { color: white; }
.text-green-600 { color: #059669; }
.text-green-700 { color: #047857; }
.text-orange-600 { color: #ea580c; }
.text-orange-700 { color: #c2410c; }
.text-red-600 { color: #dc2626; }
.text-red-700 { color: #b91c1c; }
.text-blue-600 { color: #2563eb; }
.text-blue-700 { color: #1d4ed8; }

/* Cores de fundo */
.bg-white { background-color: white; }
.bg-primary { background-color: var(--primary); }
.bg-secondary { background-color: var(--secondary); }
.bg-muted { background-color: var(--muted); }
.bg-input { background-color: var(--input-background); }
.bg-sidebar { background-color: var(--sidebar); }
.bg-green-50 { background-color: #f0fdf4; }
.bg-green-100 { background-color: #dcfce7; }
.bg-orange-50 { background-color: #fff7ed; }
.bg-orange-100 { background-color: #ffedd5; }
.bg-red-50 { background-color: #fef2f2; }
.bg-red-100 { background-color: #fee2e2; }
.bg-blue-50 { background-color: #eff6ff; }
.bg-blue-100 { background-color: #dbeafe; }

/* Cores de borda */
.border-primary { border-color: var(--primary); }
.border-border { border-color: var(--border); }
.border-green-200 { border-color: #bbf7d0; }
.border-orange-200 { border-color: #fed7aa; }
.border-red-200 { border-color: #fecaca; }
.border-blue-200 { border-color: #bfdbfe; }

/* Layout Principal */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: white;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.header-container {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1rem;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background-color: var(--primary);
  border-radius: 0.5rem;
}

.sidebar {
  width: 16rem;
  min-height: calc(100vh - 4rem);
  border-right: 1px solid var(--border);
  background-color: var(--sidebar);
  position: relative;
}

.sidebar-nav {
  padding: 1rem;
}

.sidebar-nav > * + * {
  margin-top: 0.5rem;
}

.nav-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  background-color: transparent;
  color: var(--foreground);
  transition: all 0.2s ease-in-out;
}

.nav-button:hover {
  background-color: white;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.nav-button.active {
  background-color: var(--primary);
  color: white;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.main-content {
  flex: 1;
  padding: 1.5rem 2rem;
  max-width: 80rem;
}

.card {
  background-color: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 500;
  transition: all 0.2s ease-in-out;
  cursor: pointer;
  border: none;
}

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

.btn-primary:hover {
  background-color: #4a3a2a;
}

.btn-secondary {
  background-color: var(--secondary);
  color: var(--foreground);
}

.btn-secondary:hover {
  background-color: #f0f0f0;
}

.input {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: var(--input-background);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  color: var(--foreground);
  transition: all 0.2s ease-in-out;
}

.input:focus {
  outline: none;
  ring: 2px;
  ring-color: var(--primary);
  border-color: transparent;
}

.input-icon {
  position: relative;
}

.input-icon input {
  padding-left: 2.75rem;
}

.input-icon svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.25rem;
  height: 1.25rem;
  color: var(--muted-foreground);
}

.alert {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 0.5rem;
  border: 1px solid;
}

.alert-success {
  background-color: #f0fdf4;
  border-color: #bbf7d0;
  color: #047857;
}

.alert-error {
  background-color: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.alert-warning {
  background-color: #fff7ed;
  border-color: #fed7aa;
  color: #c2410c;
}

.alert-info {
  background-color: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

/* Grid Responsivo */
.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Tabelas */
table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  border-bottom: 1px solid var(--border);
}

tbody td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

tbody tr:hover {
  background-color: var(--muted);
  transition: all 0.2s ease-in-out;
}

/* Toggle Switch */
.toggle {
  position: relative;
  width: 3rem;
  height: 1.5rem;
  border-radius: 9999px;
  background-color: var(--border);
  transition: background-color 0.2s ease-in-out;
  cursor: pointer;
}

.toggle.active {
  background-color: var(--primary);
}

.toggle-knob {
  position: absolute;
  top: 0.25rem;
  left: 0.25rem;
  width: 1rem;
  height: 1rem;
  background-color: white;
  border-radius: 9999px;
  transition: transform 0.2s ease-in-out;
}

.toggle.active .toggle-knob {
  transform: translateX(1.5rem);
}

/* Progress Bar */
.progress-bar {
  width: 100%;
  height: 0.75rem;
  background-color: #f0f0f0;
  border-radius: 9999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background-color: var(--primary);
  border-radius: 9999px;
  transition: width 0.5s ease-in-out;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
}

.badge-success {
  background-color: #dcfce7;
  color: #047857;
}

.badge-warning {
  background-color: #ffedd5;
  color: #c2410c;
}

/* Animações */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(1.25rem); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

.fade-in {
  animation: fadeIn 0.4s ease-out;
}

/* Loader */
.loader {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid white;
  border-top-color: transparent;
  border-radius: 9999px;
  animation: spin 1s linear infinite;
}

/* Responsivo */
@media (min-width: 640px) {
  .sm\\:block { display: block; }
}

@media (min-width: 768px) {
  .md\\:hidden { display: none; }
  .md\\:flex { display: flex; }
  .md\\:block { display: block; }
  .md\\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md\\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .md\\:p-8 { padding: 2rem; }
}

@media (min-width: 1024px) {
  .lg\\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg\\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lg\\:col-span-2 { grid-column: span 2 / span 2; }
  .lg\\:px-8 { padding-left: 2rem; padding-right: 2rem; }
}

@media (max-width: 767px) {
  .mobile-menu {
    display: block !important;
  }

  .sidebar {
    display: none;
  }

  .main-content {
    padding: 1.5rem;
  }
}

/* Dark Mode */
.dark body {
  background-color: var(--background);
  color: var(--foreground);
}

.dark .card {
  background-color: var(--card);
  color: var(--card-foreground);
  border-color: var(--border);
}

.dark .header {
  background-color: var(--card);
  border-color: var(--border);
}

.dark .sidebar {
  background-color: var(--sidebar);
  border-color: var(--border);
}

.dark .input {
  background-color: var(--input-background);
  border-color: var(--border);
  color: var(--foreground);
}

.dark .nav-button:hover {
  background-color: var(--muted);
}

.dark tbody tr:hover {
  background-color: var(--muted);
}

/* Icon sizing */
.icon-sm { width: 1rem; height: 1rem; }
.icon { width: 1.25rem; height: 1.25rem; }
.icon-md { width: 1.5rem; height: 1.5rem; }
.icon-lg { width: 2rem; height: 2rem; }
.icon-xl { width: 2.5rem; height: 2.5rem; }
