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

:root {
  --bg-base: #0b0f19;
  --bg-panel: rgba(21, 26, 40, 0.65);
  --bg-sidebar: rgba(15, 20, 31, 0.95);
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.4);
  --accent: #0ea5e9;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: rgba(255, 255, 255, 0.1);
  --border-radius-lg: 16px;
  --border-radius-md: 10px;
  --transition: all 0.3s ease;
  --font-family: 'Inter', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-family);
  background-color: var(--bg-base);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 85% 30%, rgba(14, 165, 233, 0.1) 0%, transparent 50%);
  background-attachment: fixed;
}

/* Glassmorphism Panels */
.glass {
  background: var(--bg-panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
}

/* --- Autenticação (Login) --- */
.login-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 1rem;
}

.login-box {
  width: 100%;
  max-width: 420px;
  padding: 2.5rem;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
  position: relative;
  overflow: hidden;
}

.login-box::before {
  content: '';
  position: absolute;
  top: -2px; left: -2px; right: -2px; height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  z-index: 1;
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
}

.login-header h1 span { color: var(--primary); }
.login-header p { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.5rem; }

/* Formulário e Inputs */
.form-group { margin-bottom: 1.5rem; }
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

.form-control {
  width: 100%;
  padding: 0.85rem 1rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  color: var(--text-main);
  font-size: 1rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.btn {
  display: inline-block;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  border: none;
  border-radius: var(--border-radius-md);
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
  transition: var(--transition);
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

/* --- Layout Principal (Dashboard) --- */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background: var(--bg-sidebar);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  z-index: 1000;
}

.sidebar-brand {
  padding: 1.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  border-bottom: 1px solid var(--border-color);
}
.sidebar-brand span { color: var(--primary); }

.nav-list {
  list-style: none;
  padding: 1.5rem 1rem;
  flex: 1;
}

.nav-item { margin-bottom: 0.5rem; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--border-radius-md);
  font-weight: 500;
  transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
  background: rgba(255, 255, 255, 0.05);
  color: var(--primary);
}

.nav-link.active {
  background: rgba(99, 102, 241, 0.1);
  border-left: 3px solid var(--primary);
}

.nav-link i { font-size: 1.2rem; }

/* Cored Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Header */
.top-header {
  height: 70px;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; justify-content: center; align-items: center;
  font-weight: bold; color: #fff;
}

/* Content Area */
/* Animações Premium */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.content-wrapper {
  padding: 2rem;
  flex: 1;
  overflow-y: auto;
  animation: fadeInUp 0.5s ease backwards;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 1rem 2rem;
  background: var(--primary);
  color: #fff;
  border-radius: var(--border-radius-md);
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  z-index: 9999;
  display: none;
  animation: fadeInUp 0.3s ease;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

/* Cards (Estatísticas) */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.stat-icon {
  width: 50px; height: 50px;
  border-radius: 12px;
  display: flex; justify-content: center; align-items: center;
  font-size: 1.5rem;
}
.stat-icon.primary { background: rgba(99, 102, 241, 0.15); color: var(--primary); }
.stat-icon.success { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.stat-icon.danger { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.stat-icon.warning { background: rgba(245, 158, 11, 0.15); color: var(--warning); }

.stat-details h3 { font-size: 1.5rem; margin-bottom: 0.25rem; }
.stat-details p { color: var(--text-muted); font-size: 0.85rem; }

/* Tabela Básica */
.table-container {
  width: 100%;
  overflow-x: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th, .table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}
.table th {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
}
.badge {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-success { background: rgba(16, 185, 129, 0.2); color: var(--success); }
.badge-danger { background: rgba(239, 68, 68, 0.2); color: var(--danger); }

/* Botão Flutuante Mobile */
.btn-float {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 60px;
  height: 60px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4);
  z-index: 999;
  text-decoration: none;
  transition: transform 0.3s ease;
}

.btn-float:active {
  transform: scale(0.9);
}

.d-md-none { display: none; }

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.8; }
  100% { transform: scale(1); opacity: 1; }
}

.notifications span {
  animation: pulse 2s infinite ease-in-out;
}

@media (max-width: 768px) {
  .d-md-none { display: flex !important; }
  
  .sidebar {
    position: fixed;
    height: 100%;
    transform: translateX(-100%);
  }
  .sidebar.active { transform: translateX(0); }
}
