:root {
  --bg-main: #0b0e14;
  --bg-sidebar: #101522;
  --bg-card: #151c2d;
  --bg-card-hover: #1b2338;
  --bg-input: #0c111a;
  --border-color: #212c44;
  --border-focus: #3b82f6;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-blue: #3b82f6;
  --accent-blue-hover: #2563eb;
  --accent-red: #ef4444;
  --accent-red-hover: #dc2626;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-purple: #8b5cf6;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);

  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-main);
  min-height: 100vh;
  width: 100%;
  line-height: 1.4;
  font-size: clamp(13px, 0.75vw, 17px);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* App Layout Grid */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Sidebar */
.sidebar {
  width: clamp(260px, 15vw, 360px);
  min-width: clamp(260px, 15vw, 360px);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: clamp(14px, 1vw, 24px) clamp(12px, 0.8vw, 18px);
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  z-index: 10;
  font-size: clamp(12px, 0.7vw, 15px);
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-ball {
  font-size: 24px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.3);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
}

.brand-text h1 {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-secondary);
  display: block;
}

.status-indicator-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
}

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

.pulse-dot.reconnecting {
  background-color: var(--accent-amber);
  box-shadow: 0 0 8px var(--accent-amber);
}

.pulse-dot.disconnected, .pulse-dot.error {
  background-color: var(--accent-red);
  box-shadow: 0 0 8px var(--accent-red);
}

/* Sidebar Section */
.sidebar-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.section-heading h2 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-primary);
}

.section-heading .icon {
  font-size: 15px;
}

.control-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 6px;
}

.filter-control-group {
  margin-bottom: 10px;
}

.stepper-input {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.stepper-input input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  padding: 8px 10px;
  text-align: center;
  font-size: 14px;
  outline: none;
}

.btn-step {
  background: var(--bg-card);
  border: none;
  color: var(--text-primary);
  width: 34px;
  height: 34px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.btn-step:hover {
  background: var(--bg-card-hover);
  color: var(--accent-blue);
}

.btn-mini-step {
  background: var(--bg-card);
  border: none;
  color: var(--text-primary);
  width: 26px;
  height: 26px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-mini-step:hover {
  background: var(--bg-card-hover);
}

.mini-stepper {
  display: inline-flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.input-mini {
  width: 60px;
  background: transparent;
  border: none;
  color: #fff;
  padding: 4px 6px;
  text-align: center;
  font-size: 12px;
  outline: none;
}

/* Range controls */
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}

.range-control-group {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.range-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

.slider-range {
  width: 100%;
  accent-color: var(--accent-blue);
  cursor: pointer;
}

.action-btn-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.telegram-meta-box {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

.meta-label {
  color: var(--text-muted);
}

.meta-val {
  color: var(--text-primary);
  font-size: 11px;
}

.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group input {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
}

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

.input-with-eye {
  position: relative;
  display: flex;
}

.input-with-eye input {
  width: 100%;
  padding-right: 36px;
}

.btn-eye {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
}

.sidebar-footer {
  margin-top: auto;
  text-align: center;
  padding-top: 10px;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: clamp(16px, 1.2vw, 32px);
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1vw, 24px);
  width: 100%;
  min-width: 0;
  max-width: none;
  overflow-x: auto;
}

/* Top Navigation Tabs */
.top-nav-tabs {
  display: flex;
  gap: 8px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  padding: 6px;
  border-radius: var(--radius-lg);
  width: fit-content;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: clamp(8px, 0.6vw, 12px) clamp(14px, 1vw, 24px);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: clamp(13px, 0.75vw, 16px);
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.nav-tab.active {
  color: #fff;
  background: var(--bg-card);
  border-color: var(--border-color);
  box-shadow: var(--shadow-sm);
}

.nav-tab.active.tt-elite-tab {
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.15);
}

.nav-tab.active.tt-cup-tab {
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.15);
}

.nav-tab.active.analytics-tab {
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.15);
}

/* View Panels */
.view-panel {
  display: none;
  flex-direction: column;
  gap: clamp(12px, 1vw, 24px);
  width: 100%;
}

.view-panel.active {
  display: flex;
}

/* League Header Banner */
.league-header-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(90deg, #131b2e 0%, #17233d 100%);
  border: 1px solid var(--border-color);
  padding: clamp(12px, 0.9vw, 20px) clamp(16px, 1.2vw, 24px);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--accent-red);
}

.league-header-banner.tt-cup-banner {
  border-left-color: var(--accent-blue);
  background: linear-gradient(90deg, #111a2f 0%, #152240 100%);
}

.league-header-banner.analytics-banner {
  border-left-color: var(--accent-green);
}

.league-main-title {
  font-size: clamp(16px, 1.1vw, 24px);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #fff;
}

.league-subtitle {
  font-size: clamp(11px, 0.68vw, 14px);
  color: var(--text-secondary);
  margin-top: 2px;
}

.live-feed-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--accent-red);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: clamp(11px, 0.65vw, 13px);
  font-weight: 700;
  font-family: var(--font-mono);
}

.live-feed-badge.blue {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
  color: var(--accent-blue);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 1.2s infinite;
}

/* Stat Cards Grid */
.stat-cards-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(10px, 0.8vw, 18px);
  width: 100%;
}

.stat-cards-grid.four-cols {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: clamp(12px, 0.9vw, 20px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, border-color 0.15s ease;
  min-width: 0;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}

.stat-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-tag {
  font-size: clamp(9px, 0.55vw, 12px);
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.card-icon {
  font-size: clamp(13px, 0.8vw, 16px);
}

.stat-title {
  font-size: clamp(10px, 0.65vw, 13px);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stat-number {
  font-size: clamp(20px, 1.4vw, 32px);
  font-weight: 800;
  font-family: var(--font-mono);
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-number.font-md {
  font-size: clamp(16px, 1.1vw, 26px);
}

.stat-number-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: clamp(18px, 1.3vw, 28px);
  font-weight: 800;
  font-family: var(--font-mono);
}

.stat-subtext {
  font-size: clamp(10px, 0.6vw, 13px);
  color: var(--text-muted);
}

/* Table Controls Bar */
.table-controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: clamp(8px, 0.6vw, 14px) clamp(12px, 0.8vw, 18px);
  border-radius: var(--radius-md);
  gap: clamp(10px, 0.8vw, 20px);
  flex-wrap: wrap;
  width: 100%;
}

.controls-left, .controls-center, .controls-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-inline-label {
  font-size: clamp(11px, 0.68vw, 14px);
  font-weight: 500;
  color: var(--text-secondary);
}

.select-styled {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: clamp(12px, 0.7vw, 14px);
  outline: none;
  cursor: pointer;
}

/* Tables */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  width: 100%;
}

.table-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(10px, 0.7vw, 16px) clamp(14px, 1vw, 22px);
  border-bottom: 1px solid var(--border-color);
}

.table-header-row h3 {
  font-size: clamp(13px, 0.8vw, 17px);
  font-weight: 700;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  max-height: calc(100vh - 350px);
}

.data-table {
  width: 100%;
  min-width: 100%;
  border-collapse: collapse;
  font-size: clamp(12px, 0.68vw, 15px);
  text-align: left;
}

.data-table th {
  background: #111728;
  color: var(--text-secondary);
  font-weight: 600;
  padding: clamp(10px, 0.65vw, 15px) clamp(12px, 0.75vw, 18px);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
  font-size: clamp(11px, 0.62vw, 14px);
}

.data-table td {
  padding: clamp(10px, 0.65vw, 15px) clamp(12px, 0.75vw, 18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  white-space: nowrap;
  vertical-align: middle;
}

.live-bets-table td:nth-child(3) {
  white-space: normal;
  min-width: clamp(160px, 14vw, 320px);
}

.live-bets-table td:nth-child(9) {
  white-space: normal;
  min-width: clamp(130px, 10vw, 240px);
}

.live-bets-table td:nth-child(11) {
  white-space: nowrap;
  min-width: 120px;
}

.data-table tbody tr {
  transition: background-color 0.12s ease;
}

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

.players-table tbody tr {
  cursor: pointer;
}

/* Badges & Elements */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
}

.badge-subtle {
  background: var(--bg-input);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.badge-live {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-finished {
  background: rgba(100, 116, 139, 0.2);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.badge-prematch {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-repeat {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
  font-weight: 700;
}

.badge-single {
  background: rgba(148, 163, 184, 0.08);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.odds-cell {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-green);
  background: rgba(16, 185, 129, 0.08);
  padding: 3px 7px;
  border-radius: var(--radius-sm);
  display: inline-block;
}

.stake-cell {
  font-family: var(--font-mono);
  font-weight: 600;
  color: #fff;
}

.usd-cell {
  font-family: var(--font-mono);
  font-weight: 600;
  color: #38bdf8;
}

.score-cell {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent-amber);
}

.match-link {
  color: var(--accent-blue);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.match-link:hover {
  text-decoration: underline;
  color: #60a5fa;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay.hidden {
  display: none;
}

.modal-content {
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 850px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

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

.modal-icon {
  font-size: 24px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.3);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
}

.modal-title-group h2 {
  font-size: 17px;
  font-weight: 700;
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
}

.btn-close:hover {
  color: #fff;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat-card.mini {
  padding: 10px 12px;
}

.stat-card.mini .stat-value {
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-mono);
}

.section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 6px;
}

.modal-table-wrap {
  max-height: 200px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

/* Empty states */
.empty-state {
  text-align: center;
  padding: 40px 16px !important;
}

.empty-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 32px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
}

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

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

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
}

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

.btn-outline:hover {
  background: var(--bg-card);
  color: #fff;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.btn-block {
  width: 100%;
}

.flex-1 {
  flex: 1;
}

/* Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  transition: .25s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background-color: var(--text-muted);
  transition: .25s;
}

input:checked + .slider {
  background-color: var(--accent-blue);
  border-color: var(--accent-blue);
}

input:checked + .slider:before {
  transform: translateX(18px);
  background-color: white;
}

.slider.round {
  border-radius: 20px;
}

.slider.round:before {
  border-radius: 50%;
}

/* Toast */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.success {
  border-color: var(--accent-green);
  background: #0f231d;
}

.toast.error {
  border-color: var(--accent-red);
  background: #2a1215;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes pulse {
  0% { transform: scale(0.92); opacity: 0.8; }
  50% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(0.92); opacity: 0.8; }
}

/* Utilities */
.mono { font-family: var(--font-mono); }
.font-bold { font-weight: 700; }
.font-sm { font-size: 12px; }
.font-xs { font-size: 11px; }
.text-accent { color: var(--accent-blue); }
.text-win { color: var(--accent-green); }
.text-loss { color: var(--accent-red); }
.text-warn { color: var(--accent-amber); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-4 { margin-top: 14px; }
.mb-2 { margin-bottom: 8px; }
/* Analytics Sub-tabs */
.analytics-sub-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  background: var(--bg-card);
  padding: 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  width: fit-content;
}

.analytics-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.analytics-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.analytics-tab-btn.active {
  background: var(--bg-input);
  color: var(--text-primary);
  border-color: var(--border-focus);
  box-shadow: var(--shadow-sm);
}

/* Responsive Adjustments */
@media (max-width: 1400px) {
  .stat-cards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 950px) {
  .app-layout {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    min-width: 100%;
    height: auto;
    position: relative;
  }
  .stat-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .stat-cards-grid {
    grid-template-columns: 1fr;
  }
  .stat-cards-grid.four-cols {
    grid-template-columns: 1fr;
  }
}

