:root {
  --bg-dark: #09090b;
  --bg-card: #121215;
  --bg-card-hover: #18181b;
  --border: #27272a;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --accent-green: #00a884;
  --accent-green-bg: rgba(0, 168, 132, 0.15);
  --accent-purple: #a855f7;
  --radius-card: 16px;
  --radius-pill: 9999px;
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.5;
  padding-bottom: 60px;
  -webkit-font-smoothing: antialiased;
}

.dash-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.flex-align {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Header */
.dash-header {
  background: rgba(18, 18, 21, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 68px;
}

.dash-logo {
  height: 36px;
  width: auto;
}

.dash-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.dash-badge {
  background: var(--accent-green-bg);
  color: var(--accent-green);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(0, 168, 132, 0.3);
  margin-left: 6px;
}

.system-status {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  background: #18181b;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-green);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.btn-dash-subtle {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  transition: var(--transition);
}

.btn-dash-subtle:hover {
  background: #18181b;
  color: var(--text-primary);
}

/* Toolbar & Filters */
.toolbar-flex {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin: 36px 0 28px 0;
  gap: 20px;
  flex-wrap: wrap;
}

.page-title {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.page-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.period-filters {
  display: flex;
  background: #121215;
  border: 1px solid var(--border);
  padding: 4px;
  border-radius: 12px;
  gap: 4px;
}

.filter-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.filter-btn:hover {
  color: var(--text-primary);
}

.filter-btn.active {
  background: #27272a;
  color: #ffffff;
  font-weight: 600;
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 22px;
  transition: var(--transition);
}

.metric-card:hover {
  border-color: #3f3f46;
  transform: translateY(-2px);
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.card-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.trend-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.trend-badge.positive {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.trend-badge.neutral {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.card-value {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.sub-val {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.card-foot {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Chart Section */
.chart-section {
  margin-bottom: 28px;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px;
}

.chart-head {
  margin-bottom: 20px;
}

.chart-head h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.chart-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Table Section */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px;
}

.table-head-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.table-head-flex h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.table-sub {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.search-input {
  background: #18181b;
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.82rem;
  width: 280px;
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  border-color: #52525b;
}

.table-responsive {
  overflow-x: auto;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.dash-table th {
  color: var(--text-secondary);
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dash-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.dash-table tbody tr:hover {
  background: var(--bg-card-hover);
}

.text-center {
  text-align: center;
}

/* User Status Badges */
.badge-plan {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  display: inline-block;
}

.badge-plan.pro {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.badge-plan.free {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.badge-lang {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  background: #18181b;
  color: var(--text-secondary);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.btn-action-plan {
  background: #27272a;
  border: 1px solid #3f3f46;
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-action-plan:hover {
  background: #3f3f46;
}

/* Responsive */
@media (max-width: 1024px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  .toolbar-flex {
    flex-direction: column;
    align-items: flex-start;
  }
  .search-input {
    width: 100%;
  }
}
