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

:root{
  --bg: #0f172a; /* slate-900 */
  --card: #1e293b; /* slate-800 */
  --muted: #94a3b8; /* slate-400 */
  --accent: #1e40af; /* blue-800 profissional */
  --accent-2: #3b82f6; /* blue-500 secundário */
  --accent-3: #1d4ed8; /* blue-700 alternativo */
  --glass: rgba(30,64,175,0.05);
  --glass-strong: rgba(30,64,175,0.08);
  --radius: 8px;
  --radius-sm: 4px;
  --gutter: 1rem;
  --shadow: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 16px rgba(30,64,175,0.1);
  --white: #f8fafc;
  --border: rgba(59,130,246,0.1);
}

body{
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, "Helvetica Neue", Arial;
  color: var(--white);
  background: 
    radial-gradient(circle at 20% 20%, rgba(30,64,175,0.08) 0%, transparent 70%),
    radial-gradient(circle at 80% 80%, rgba(59,130,246,0.06) 0%, transparent 70%),
    linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  min-height: 100vh;
  padding: 1rem;
  position: relative;
  overflow-x: hidden;
}

body::before{
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 30% 40%, rgba(30,64,175,0.02) 0%, transparent 60%),
    radial-gradient(circle at 70% 60%, rgba(59,130,246,0.02) 0%, transparent 60%);
  pointer-events: none;
  z-index: -1;
}

/* Mobile-first layout */
.site-header{
  display:flex;
  align-items:center;
  gap:1rem;
  background: linear-gradient(135deg, var(--glass-strong), var(--glass));
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  padding:1rem 1.25rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}

.header-inner{ display:flex; align-items:center; gap:1rem }
.site-title{ 
  font-size:1.25rem; 
  font-weight:700; 
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.menu-toggle{
  background: linear-gradient(135deg, var(--glass-strong), var(--glass));
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  color: var(--white);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.1rem;
}

.menu-toggle:hover{ 
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.menu-toggle:focus{ 
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.layout{
  display:grid;
  gap:1rem;
}

.sidebar{
  display:flex;
  gap: 1rem;
  overflow:auto;
  padding:1.5rem;
  background: linear-gradient(135deg, var(--glass-strong), var(--glass));
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.sidebar ul{ display:flex; gap:0.75rem; list-style:none }
.sidebar a{
  color: var(--muted);
  text-decoration:none;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.sidebar a::before{
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transition: left 0.5s ease;
}

.sidebar a:hover::before{ left: 100%; }
.sidebar a:hover, .sidebar a.active{ 
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--white);
  box-shadow: 0 4px 15px rgba(99,102,241,0.3);
  transform: translateY(-2px);
}

.content{
  display:grid;
  gap:1rem;
}

.stats-section{
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap:0.75rem;
}

.card{
  background: linear-gradient(135deg, var(--glass-strong), var(--glass));
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: all 0.4s ease;
}

.card::before{
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
}

.card:nth-child(1)::before{ background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.card:nth-child(2)::before{ background: linear-gradient(90deg, var(--accent-2), var(--accent-3)); }
.card:nth-child(3)::before{ background: linear-gradient(90deg, var(--accent-3), var(--accent)); }
.card:nth-child(4)::before{ background: linear-gradient(90deg, var(--accent), var(--accent-3)); }

.card:hover{
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4), var(--shadow-glow);
  border-color: rgba(255,255,255,0.15);
}

.card h3{ 
  color: var(--muted); 
  font-size: 0.85rem; 
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
}
.card p{ 
  font-size: 1.75rem; 
  font-weight: 800; 
  color: var(--white);
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.chart-section{ 
  display: grid; 
  gap: 1rem;
  background: linear-gradient(135deg, var(--glass-strong), var(--glass));
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.chart-section h2{
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 1rem;
}

.charts{ display: grid; grid-template-columns: 1fr; gap: 1rem }

.chart-container{ 
  background: { background: linear-gradient(90deg, var(--accent-3), var(--accent)); }
-  background: linear-gradient(135deg, var(--glass), rgba(255,255,255,0.02));
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  height: 180px; 
  border-radius: var(--radius-sm); 
  padding: 1rem;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  
}

.chart-container:hover{
  background: linear-gradient(135deg, var(--glass-strong), var(--glass));
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(30,64,175,0.15);
}

.chart-container canvas{
  width: 100% !important;
  height: 100% !important;
}

.table-section{ 
  overflow: auto;
  background: linear-gradient(135deg, var(--glass-strong), var(--glass));
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.table-section h2{
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 1rem;
}

table{ 
  width: 100%; 
  border-collapse: collapse; 
  min-width: 600px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

th, td{ 
  padding: 1rem; 
  text-align: left; 
  border-bottom: 1px solid var(--border); 
  color: var(--muted);
  transition: all 0.3s ease;
}

th{ 
  font-weight: 700; 
  color: var(--white); 
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

tbody tr{
  transition: all 0.3s ease;
}

tbody tr:hover{
  background: linear-gradient(90deg, rgba(30,64,175,0.06), transparent);
  transform: translateX(4px);
}

tbody tr:hover td{ 
  color: var(--white);
  border-color: rgba(30,64,175,0.15);
}

footer{ 
  text-align: center; 
  color: var(--muted); 
  margin-top: 2rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, var(--glass), rgba(255,255,255,0.02));
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-weight: 500;
}

/* Desktop layout */
@media (min-width:900px){
  body{ padding: 1.5rem; }
  
  .layout{ 
    grid-template-columns: 280px 1fr; 
    align-items: start;
    gap: 2rem;
  }
  
  .sidebar{ 
    flex-direction: column; 
    height: calc(100vh - 180px); 
    position: sticky; 
    top: 1.5rem;
    padding: 2rem 1.5rem;
  }
  
  .sidebar ul{ flex-direction: column; gap: 0.5rem; }
  .sidebar a{ padding: 1rem 1.25rem; }
  
  .content{ gap: 2rem; }
  .stats-section{ grid-template-columns: repeat(4, 1fr); gap: 1rem; }
  
  .charts{ 
    grid-template-columns: repeat(3, 1fr); 
    grid-template-rows: 220px 180px; 
    grid-template-areas: "c1 c2 c3" "c4 c4 c4";
    gap: 1rem;
  }
  
  .chart-container{ height: 100%; }
  
  #chart1{ grid-area: c1; }
  #chart2{ grid-area: c2; }
  #chart3{ grid-area: c3; }
  #chart4{ grid-area: c4; }
}

/* Sidebar open class for mobile */
.sidebar.open{ position:fixed; left:1rem; right:1rem; top:64px; z-index:40 }

/* small screens adjustments */
@media (max-width:599px){
  .stats-section{ grid-template-columns: 1fr }
  .menu-toggle{ font-size:18px }
  .site-title{ font-size:0.95rem }
  table{ min-width:100% }
}