/* =================================================================
   NOVO DESIGN PROFISSIONAL - VERSÃO PRETO GRADIENTE
   ================================================================= */

/* --- 1. Variáveis Globais e Tema --- */
:root {
  /* Paleta de Cores: um tema escuro mais elegante e com maior contraste */
  --color-bg-start: #111111; /* Alterado: Início do gradiente (preto profundo) */
  --color-bg-end: #000000;   /* Alterado: Fim do gradiente (preto puro) */
  --color-surface: #1A1A1A; /* Alterado: Painéis um pouco mais escuros para maior contraste */
  --color-surface-light: #2C2C2C; /* Alterado: Cor de hover mais clara */
  --color-border: #2C2C2C; /* Alterado: Bordas sutis que combinam com o novo fundo */
  
  --color-brand: #007AFF; /* Alterado: Azul um pouco mais brilhante da Apple para destaque */
  --color-brand-muted: rgba(0, 122, 255, 0.15); /* Alterado: Mudo correspondente */
  --color-danger: #FF3B30; /* Alterado: Vermelho mais vibrante para ações destrutivas */

  --color-text-primary: #FFFFFF; /* Alterado: Texto principal em branco puro para máxima visibilidade */
  --color-text-secondary: #AEAEB2; /* Alterado: Texto secundário (cinza claro e legível) */
  --color-text-muted: #8E8E93; /* Alterado: Texto para placeholders e notas */
  
  /* Tipografia */
  --font-family-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, sans-serif;
  
  /* Outras Variáveis */
  --border-radius-sm: 6px;
  --border-radius-md: 8px;
  --border-radius-lg: 12px;
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --transition-speed: 0.2s;
}

/* --- 2. Reset Básico e Estilos Globais --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  color-scheme: dark;
}

body {
  /* Alterado: Aplicando o fundo preto gradiente */
  background: linear-gradient(135deg, var(--color-bg-start), var(--color-bg-end));
  background-attachment: fixed; /* Garante que o gradiente não role com a página */
  
  color: var(--color-text-primary);
  font-family: var(--font-family-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- 3. Layout e Classes Utilitárias (Mantidas para compatibilidade) --- */
.flex { display: flex; }
.grid { display: grid; }
.flex-1 { flex: 1 1 0%; }
.min-h-screen { min-height: 100vh; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.w-64 { width: 16rem; }
.p-6{padding:1.5rem}.p-4{padding:1rem}.p-3{padding:.75rem}.p-2{padding:.5rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.mb-4{margin-bottom:1rem}.mb-3{margin-bottom:.75rem}.mb-2{margin-bottom:.5rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}
.gap-6{gap:1.5rem}.gap-2{gap:.5rem}
@media(min-width:768px){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* --- 4. Componentes Principais --- */

/* Sidebar */
.sidebar {
  /* Alterado: Sidebar com fundo semi-transparente para um efeito de vidro */
  background-color: rgba(26, 26, 26, 0.7);
  backdrop-filter: blur(10px);
  border-right: 1px solid var(--color-border);
  transition: width var(--transition-speed) ease;
}

.sidebar .surface { /* Cabeçalho da Sidebar */
  border: none;
  background: none;
  border-radius: 0;
  border-bottom: 1px solid var(--color-border);
}

.sidebar .brand {
  font-weight: 800;
  color: var(--color-text-primary);
}

.sidebar .brand-badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: var(--border-radius-sm);
  background-color: var(--color-brand-muted);
  color: var(--color-brand);
  font-size: 0.7rem;
  font-weight: 600;
  border: none;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.8rem;
  border-radius: var(--border-radius-md);
  color: var(--color-text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: all var(--transition-speed) ease;
}

.sidebar nav a .icon {
  width: 20px;
  height: 20px;
  opacity: 0.9;
}

.sidebar nav a:hover {
  background-color: var(--color-surface-light);
  color: var(--color-text-primary);
}

.sidebar nav a.active {
  background-color: var(--color-brand);
  color: #fff; /* Alterado: Texto do botão ativo para branco puro */
  font-weight: 600;
}

/* Topbar */
.topbar {
  padding: 0.75rem 1.5rem;
  background-color: rgba(10, 10, 10, 0.7); /* Fundo semi-transparente */
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar .title { font-weight: 700; }

/* Cards e Superfícies */
.surface, .tile, .panel {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
}

/* --- 5. Elementos de Formulário --- */

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: 0.5rem;
}

input, textarea, select {
  width: 100%;
  background-color: #111111; /* Alterado: Fundo dos inputs para combinar */
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 0.9rem;
  transition: all var(--transition-speed) ease;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px var(--color-brand-muted);
}

input[type="checkbox"] {
  width: auto;
  height: 1.1em;
  width: 1.1em;
  border-radius: 4px;
}

/* --- 6. Botões --- */
.btn, .btn-rose, .btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--border-radius-md);
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-speed) ease;
}
.btn:hover, .btn-rose:hover, .btn-ghost:hover {
  transform: translateY(-2px);
  filter: brightness(1.1); /* Efeito de brilho no hover */
}

.btn {
  background-color: var(--color-brand);
  color: #fff;
}

.btn-rose {
  background-color: var(--color-danger);
  color: #fff;
}

.btn-ghost {
  background-color: transparent;
  border-color: var(--color-border);
  color: var(--color-text-primary);
}
.btn-ghost:hover {
  background-color: var(--color-surface-light);
  border-color: var(--color-surface-light);
}

/* --- 7. Tabelas --- */

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th, .table td {
  text-align: left;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--color-border);
}

.table th {
  color: var(--color-text-secondary);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table tr:last-child td {
  border-bottom: none;
}

.table tr:hover td {
  background-color: var(--color-surface-light);
}
.truncate { max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* --- 8. Componentes Específicos --- */

/* Página de Login */
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background-color: rgba(26, 26, 26, 0.7); /* Efeito de vidro */
  backdrop-filter: blur(10px);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-md);
}

.login-title { font-weight: 700; font-size: 1.5rem; margin-bottom: 0.5rem; text-align: center; }

/* Alertas */
.alert{padding:.8rem 1rem;border-radius:var(--border-radius-md);border:1px solid;font-weight:500;margin-bottom:1rem;}
.alert-bad{background:rgba(255,59,48,.15);border-color:rgba(255,59,48,.3);color:#FF453A}
.alert-good{background:rgba(48,209,88,.15);border-color:rgba(48,209,88,.3);color:#32D74B}
.alert-info{background:rgba(255,204,0,.15);border-color:rgba(255,204,0,.3);color:#FFCC00}

/* Modal */
.modal-backdrop{position:fixed;inset:0;background:rgba(0, 0, 0, 0.7);backdrop-filter:blur(8px);display:none;align-items:center;justify-content:center;z-index:50}
.modal{width:100%;max-width:640px;background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--border-radius-lg);box-shadow:0 10px 40px rgba(0,0,0,.5); overflow: hidden;}
.modal header{display:flex;align-items:center;justify-content:space-between;padding:1rem 1.5rem;border-bottom:1px solid var(--color-border); font-size: 1.1rem; font-weight: 600;}
.modal .content{padding:1.5rem}
.modal footer{display:flex;justify-content:flex-end;gap:.75rem;padding:1rem 1.5rem;background-color:#111111;border-top:1px solid var(--color-border)}
.modal-backdrop.show{display:flex}
.text-2xl{font-size:1.5rem; line-height:2rem;}.font-bold{font-weight:700}.font-semibold{font-weight:600}.text-subtle{color:var(--text-secondary)}