:root {
  /* Apple-style Dark Mode Color Palette */
  --bg-color: #000000;
  --bg-secondary: #1c1c1e;
  --text-primary: #ffffff;
  --text-secondary: #8e8e93;
  --accent-color: #0a84ff;
  --accent-hover: #007aff;
  --border-color: rgba(255, 255, 255, 0.1);
  --glass-bg: rgba(28, 28, 30, 0.6);
  --glass-border: rgba(255, 255, 255, 0.15);
  
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* Glassmorphism Utilities */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.glass-header {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
}

/* Typography */
h1, h2, h3 {
  font-weight: 600;
  letter-spacing: -0.5px;
}

h3 {
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  text-decoration: none;
  display: inline-block;
}

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

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

.btn.secondary {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
}

.btn.secondary:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

.btn.outline {
  background-color: transparent;
  color: var(--accent-color);
  border: 1px solid var(--accent-color);
}

.btn.outline:hover {
  background-color: rgba(10, 132, 255, 0.1);
}

/* Login Overlay */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.login-card {
  width: 100%;
  max-width: 400px;
}

.login-card h2 {
  margin-bottom: 24px;
  text-align: center;
}

.input-group {
  margin-bottom: 16px;
}

.input-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.input-group input {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.05);
  color: white;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.input-group input:focus {
  border-color: var(--accent-color);
}

#login-form .btn {
  width: 100%;
  margin-top: 8px;
}

.error-msg {
  color: #ff453a;
  font-size: 0.85rem;
  margin-top: 12px;
  text-align: center;
  min-height: 20px;
}

/* Dashboard Layout */
.dashboard {
  display: flex;
  flex-direction: column;
}

.header-actions {
  display: flex;
  gap: 12px;
}

.content {
  padding: 32px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Stats Section */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
}

/* Charts Section */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.chart-card.full-width {
  grid-column: 1 / -1;
}

.chart-card canvas {
  width: 100% !important;
  max-height: 300px;
}

/* Table Section */
.table-responsive {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th, td {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
}

th {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
}

td {
  font-size: 0.95rem;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

@media (max-width: 768px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
}
