:root {
  --bg-deep: #050505;
  --bg-surface: #0d0d0d;
  --bg-card: #141414;
  --accent-primary: #00f2ff;
  --accent-secondary: #7000ff;
  --text-main: #e0e0e0;
  --text-dim: #888888;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --glass-bg: rgba(20, 20, 20, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
  --font-display: 'Syncopate', sans-serif;
  --font-body: 'Space Grotesk', sans-serif;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Layout Structures */
.app-container {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.flex-row { display: flex; align-items: center; gap: 12px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-column { display: flex; flex-direction: column; }

.mt-auto { margin-top: auto; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

.p-1 { padding: 1rem; }
.p-2 { padding: 1.5rem; }

.border-top { border-top: 1px solid var(--border-subtle); }
.border-bottom { border-bottom: 1px solid var(--border-subtle); }

.w-full { width: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-mono { font-family: monospace; }
.font-bold { font-weight: 600; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.85rem; }
.text-danger { color: #ff3e3e; }

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-secondary);
  flex-shrink: 0;
}

.avatar-lg {
  width: 100px;
  height: 100px;
}

.chart-grid {
  display: grid; 
  grid-template-columns: 2fr 1fr; 
  gap: 1.5rem; 
  margin-bottom: 2rem;
}

.region-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.danger-card {
  border-color: rgba(255, 62, 62, 0.3);
}

.sidebar {
  width: 260px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem;
  position: fixed;
  height: 100vh;
  z-index: 100;
}

.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 2rem 3rem;
  max-width: calc(100vw - 260px);
}

/* Typography */
h1, h2, h3 {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: -1px;
}

.text-gradient {
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Components */
.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  margin-bottom: 3rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 6px;
}

.nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-link {
  text-decoration: none;
  color: var(--text-dim);
  padding: 0.8rem 1rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--transition);
}

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

.nav-link.active {
  border-left: 3px solid var(--accent-primary);
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at top right, rgba(0, 242, 255, 0.03), transparent 70%);
  pointer-events: none;
}

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

.stat-card .value {
  font-size: 2rem;
  font-weight: 600;
  margin: 0.5rem 0;
}

.stat-card .trend {
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

.trend.up { color: #00ff88; }
.trend.down { color: #ff3e3e; }

.btn {
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  border: none;
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

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

.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 20px rgba(0, 242, 255, 0.3);
}

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

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Visualization Placeholders */
.chart-container {
  width: 100%;
  height: 300px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding-top: 2rem;
}

.bar {
  flex: 1;
  background: linear-gradient(to top, var(--accent-secondary), var(--accent-primary));
  border-radius: 4px 4px 0 0;
  min-height: 10px;
  transition: var(--transition);
  opacity: 0.7;
}

.bar:hover {
  opacity: 1;
}

.area-chart-svg {
  width: 100%;
  height: 100%;
}

.pie-chart {
  width: 80px;
  height: 80px;
}

/* Table Style */
.table-container {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

th {
  text-align: left;
  color: var(--text-dim);
  font-weight: 500;
  padding: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

/* Login Page */
.auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: radial-gradient(circle at center, #111, #000);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  padding: 3rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.form-input {
  width: 100%;
  background: #1a1a1a;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  color: white;
  font-family: var(--font-body);
  transition: var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(0, 242, 255, 0.1);
}

/* Badge */
.badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success { background: rgba(0, 255, 136, 0.1); color: #00ff88; }
.badge-warning { background: rgba(255, 170, 0, 0.1); color: #ffaa00; }

/* Settings Structure */
.settings-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 3rem;
}

.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.settings-section {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Responsive */
@media (max-width: 1024px) {
  .sidebar { width: 80px; padding: 2rem 0.5rem; align-items: center; }
  .nav-link span, .logo span { display: none; }
  .main-content { margin-left: 80px; max-width: calc(100vw - 80px); }
  .logo-icon { margin: 0; }
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; max-width: 100vw; padding: 1.5rem; }
  .stats-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
}
