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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f6fa;
  color: #333;
}

/* =======================
Dashboard Layout
======================= */
.dashboard-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-rows: 60px 1fr;
  min-height: 100vh;
}

/* =======================
Header
======================= */
.dashboard-header {
  grid-column: 1 / -1;
  background: #2c3e50;
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.dashboard-header h1 {
  font-size: 1.1rem;
  font-weight: 600;
}

.header-controls {
  display: flex;
  gap: 10px;
}

.header-controls input {
  padding: 5px 8px;
  border-radius: 4px;
  border: 1px solid #555;
  background: #34495e;
  color: white;
}

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

#user-display {
  font-size: 0.9rem;
  color: #bdc3c7;
}

#logout-btn {
  background: none;
  border: 1px solid #e74c3c;
  color: #e74c3c;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
}

#logout-btn:hover {
  background: #e74c3c;
  color: white;
}

/* =======================
Sidebar
======================= */
.sidebar {
  background: white;
  border-right: 1px solid #ddd;
  padding-top: 20px;
}

.sidebar a {
  display: block;
  padding: 10px 20px;
  text-decoration: none;
  color: #333;
  font-size: 0.95rem;
}

.sidebar a:hover {
  background: #eaf2f8;
  color: #2E86C1;
}

.sidebar a.active {
  background: #eaf2f8;
  color: #2E86C1;
  font-weight: 600;
  border-left: 3px solid #2E86C1;
}

.sidebar a.disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* =======================
Main Content
======================= */
.main-content {
  padding: 20px;
  overflow-y: auto;
}

/* =======================
Pageviews Section
======================= */
.pageviews-container,
.pageviews-aggregated-container {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  margin-bottom: 20px;
}

.pageviews-container h2,
.pageviews-aggregated-container h2 {
  font-size: 1.2rem;
  margin-bottom: 15px;
  color: #2E86C1;
}

/* =======================
Chart
======================= */
.chart-container {
  background: white;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  border: 1px solid #eee;
}

/* =======================
Controls & Toggle Buttons
======================= */
.pageviews-controls,
.view-toggle {
  margin-bottom: 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pageviews-controls input,
.view-toggle button {
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid #ccc;
}

.pageviews-controls button,
.view-toggle button {
  background: #2E86C1;
  color: white;
  cursor: pointer;
}

.pageviews-controls button:hover,
.view-toggle button:hover {
  background: #1B4F72;
}

/* =======================
Table
======================= */
.table-container {
  overflow-x: auto;
}

.pageviews-table,
.aggregated-table {
  width: 100%;
  border-collapse: collapse;
}

.pageviews-table th,
.aggregated-table th {
  background: #2E86C1;
  color: white;
  padding: 12px;
  text-align: left;
}

.pageviews-table td,
.aggregated-table td {
  padding: 10px;
  border-bottom: 1px solid #eee;
}

.pageviews-table tr:hover,
.aggregated-table tr:hover {
  background: #f9f9f9;
  cursor: pointer;
}

/* =======================
Responsive
======================= */
@media (max-width: 768px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
}
