/* ============================================================
   ShortLink Pro — Cyberpunk Dark Theme
   ============================================================ */

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

/* Variables */
:root {
  --bg:        #050508;
  --bg2:       #0d0d14;
  --bg3:       #12121e;
  --border:    rgba(0, 212, 255, 0.15);
  --border2:   rgba(0, 212, 255, 0.08);
  --cyan:      #00d4ff;
  --cyan-dim:  rgba(0, 212, 255, 0.15);
  --cyan-glow: rgba(0, 212, 255, 0.4);
  --pink:      #ff2d78;
  --pink-dim:  rgba(255, 45, 120, 0.15);
  --green:     #00ff88;
  --green-dim: rgba(0, 255, 136, 0.15);
  --red:       #ff4444;
  --red-dim:   rgba(255, 68, 68, 0.15);
  --yellow:    #ffd600;
  --text:      #e8eaf2;
  --text-dim:  #6b7087;
  --text-mid:  #9ca3b8;
  --sidebar-w: 240px;
  --radius:    10px;
  --font-head: 'Orbitron', monospace;
  --font-body: 'Rajdhani', sans-serif;
  --font-mono: 'Space Mono', monospace;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

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

/* Background decoration */
.app-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,212,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ============================================================
   Auth Page
   ============================================================ */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }

.auth-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.4;
}
.glow-1 { width: 500px; height: 500px; background: var(--cyan); top: -150px; right: -150px; }
.glow-2 { width: 400px; height: 400px; background: var(--pink); bottom: -100px; left: -100px; }

.auth-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 20px;
}

.auth-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 0 60px rgba(0,212,255,0.1), 0 0 120px rgba(255,45,120,0.05);
  backdrop-filter: blur(20px);
  animation: fadeUp 0.5s ease;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}
.auth-logo .logo-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 12px var(--cyan));
}
.auth-logo h1 {
  font-family: var(--font-head);
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--text);
}
.auth-logo h1 span { color: var(--cyan); }
.auth-logo p { color: var(--text-dim); font-size: 0.85rem; margin-top: 4px; }

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border2);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-logo {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border2);
  font-family: var(--font-head);
  font-size: 1rem;
  letter-spacing: 1px;
}
.sidebar-logo .logo-icon {
  font-size: 1.4rem;
  filter: drop-shadow(0 0 8px var(--cyan));
}
.sidebar-logo strong { color: var(--cyan); }

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius);
  color: var(--text-mid);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}
.nav-item:hover {
  background: var(--cyan-dim);
  color: var(--cyan);
}
.nav-item.active {
  background: var(--cyan-dim);
  color: var(--cyan);
  border-left: 3px solid var(--cyan);
}
.nav-icon { font-size: 1rem; }

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border2);
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-mid);
}
.user-avatar {
  width: 32px; height: 32px;
  background: var(--cyan-dim);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
  border: 1px solid var(--border);
}
.btn-logout {
  color: var(--red);
  text-decoration: none;
  font-size: 1.2rem;
  opacity: 0.6;
  transition: opacity 0.2s;
  padding: 4px;
}
.btn-logout:hover { opacity: 1; }

/* ============================================================
   Main Content
   ============================================================ */
.main-content {
  margin-left: var(--sidebar-w);
  padding: 32px;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}
.page-header h2 {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text);
}
.page-sub { color: var(--text-dim); font-size: 0.875rem; margin-top: 2px; }

/* ============================================================
   Stats Grid
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--cyan);
}
.stat-card.stat-green::before { background: var(--green); }
.stat-card.stat-red::before   { background: var(--red); }
.stat-card.stat-cyan::before  { background: var(--pink); }
.stat-card:hover { border-color: var(--border); transform: translateY(-2px); }

.stat-icon { font-size: 1.8rem; }
.stat-value {
  font-family: var(--font-head);
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
}
.stat-label { color: var(--text-dim); font-size: 0.8rem; margin-top: 4px; text-transform: uppercase; letter-spacing: 1px; }

/* ============================================================
   Toolbar
   ============================================================ */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 200px;
}

.search-wrap { flex: 1; }

.filter-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 4px;
}
.filter-tab {
  padding: 6px 14px;
  border-radius: 7px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s;
}
.filter-tab:hover { color: var(--text); }
.filter-tab.active {
  background: var(--cyan-dim);
  color: var(--cyan);
}

/* ============================================================
   Data Table
   ============================================================ */
.table-wrap {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  overflow: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.data-table th {
  padding: 12px 16px;
  text-align: left;
  color: var(--text-dim);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--border2);
  white-space: nowrap;
  background: var(--bg3);
}
.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border2);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr {
  transition: background 0.15s;
}
.data-table tbody tr:hover { background: rgba(0,212,255,0.03); }

.td-num { color: var(--text-dim); font-size: 0.8rem; width: 40px; }

.slug-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.slug-badge {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: var(--cyan-dim);
  color: var(--cyan);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(0,212,255,0.2);
}
.link-title { display: block; color: var(--text-dim); font-size: 0.8rem; }
.slug-copy {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
  opacity: 0.5;
}
.slug-copy:hover { color: var(--cyan); opacity: 1; }

.td-url { max-width: 200px; }
.url-text {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-mid);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  max-width: 200px;
}
.url-backup { color: var(--text-dim); }
.no-backup { color: var(--text-dim); opacity: 0.4; }

/* Toggle Button */
.toggle-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: opacity 0.2s;
}
.toggle-btn.toggling { opacity: 0.5; pointer-events: none; }

.toggle-track {
  width: 44px; height: 22px;
  border-radius: 11px;
  background: var(--bg3);
  border: 1px solid var(--border);
  position: relative;
  transition: all 0.3s;
  display: block;
}
.toggle-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: all 0.3s;
}
.toggle-on .toggle-track {
  background: var(--green-dim);
  border-color: var(--green);
  box-shadow: 0 0 8px rgba(0,255,136,0.3);
}
.toggle-on .toggle-thumb {
  background: var(--green);
  left: 25px;
  box-shadow: 0 0 6px var(--green);
}
.toggle-off .toggle-track {
  background: var(--red-dim);
  border-color: var(--red);
}
.toggle-off .toggle-thumb {
  background: var(--red);
}
.toggle-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
  min-width: 24px;
}
.toggle-on .toggle-label { color: var(--green); }
.toggle-off .toggle-label { color: var(--red); }

.td-clicks .click-badge {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--pink);
  background: var(--pink-dim);
  padding: 2px 8px;
  border-radius: 4px;
}

.td-date { color: var(--text-dim); font-size: 0.85rem; white-space: nowrap; }

.td-actions { white-space: nowrap; }
.action-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background 0.2s;
  text-decoration: none;
  display: inline-block;
  opacity: 0.6;
}
.action-btn:hover { background: var(--bg3); opacity: 1; }

/* Empty State */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-dim);
}
.empty-icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state h3 { font-family: var(--font-head); font-size: 1.2rem; margin-bottom: 8px; color: var(--text-mid); }
.empty-state p { margin-bottom: 24px; }

/* ============================================================
   Form Card
   ============================================================ */
.form-card {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 760px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
.form-col-full { grid-column: 1 / -1; }

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-mid);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.label-req { color: var(--red); }
.label-opt { color: var(--text-dim); font-weight: 400; text-transform: none; }

.field-hint {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 6px;
}
.hint-url {
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

/* Status toggle in form */
.form-status-group {}
.status-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.status-desc strong { display: block; font-size: 0.9rem; color: var(--text); }
.status-desc small  { color: var(--text-dim); font-size: 0.8rem; }

/* Big toggle for form */
.big-toggle { position: relative; cursor: pointer; }
.big-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.big-toggle-track {
  display: block;
  width: 56px; height: 28px;
  border-radius: 14px;
  background: var(--red-dim);
  border: 1px solid var(--red);
  position: relative;
  transition: all 0.3s;
}
.big-toggle-thumb {
  position: absolute;
  top: 4px; left: 4px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--red);
  transition: all 0.3s;
}
.big-toggle input:checked + .big-toggle-track {
  background: var(--green-dim);
  border-color: var(--green);
  box-shadow: 0 0 10px rgba(0,255,136,0.25);
}
.big-toggle input:checked + .big-toggle-track .big-toggle-thumb {
  left: 30px;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

/* Redirect preview */
.redirect-preview {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}
.rp-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 16px;
}
.rp-flow {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.rp-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  transition: border-color 0.3s;
}
.rp-user   { border-color: rgba(255,214,0,0.3); color: var(--yellow); }
.rp-short  { border-color: var(--border); color: var(--cyan); }
.rp-check  { border-color: rgba(0,212,255,0.2); color: var(--text-mid); }
.rp-arrow  { color: var(--text-dim); font-size: 1rem; }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--cyan);
  color: var(--bg);
  border-color: var(--cyan);
}
.btn-primary:hover {
  background: transparent;
  color: var(--cyan);
  box-shadow: 0 0 16px var(--cyan-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--text-mid);
  border-color: var(--border);
}
.btn-ghost:hover {
  background: var(--bg3);
  color: var(--text);
  border-color: var(--border);
}

.btn-danger {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.btn-danger:hover {
  background: transparent;
  color: var(--red);
}

.btn-full { width: 100%; justify-content: center; }
.btn-arrow { margin-left: auto; transition: transform 0.2s; }
.btn:hover .btn-arrow { transform: translateX(4px); }

/* ============================================================
   Inputs
   ============================================================ */
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon {
  position: absolute;
  left: 12px;
  font-size: 0.9rem;
  pointer-events: none;
  opacity: 0.6;
}
.input-wrap input {
  width: 100%;
  padding: 10px 12px 10px 38px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.input-wrap input::placeholder { color: var(--text-dim); }
.input-wrap input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-dim);
}

/* ============================================================
   Alerts
   ============================================================ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  animation: slideIn 0.3s ease;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.alert-success { background: var(--green-dim); border: 1px solid rgba(0,255,136,0.3); color: var(--green); }
.alert-error   { background: var(--red-dim);   border: 1px solid rgba(255,68,68,0.3);  color: #ff8888; }
.alert-warning { background: rgba(255,214,0,0.1); border: 1px solid rgba(255,214,0,0.3); color: var(--yellow); }
.alert-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.alert-dismissible { position: relative; padding-right: 40px; }
.alert-close {
  position: absolute;
  right: 12px; top: 10px;
  background: none; border: none; cursor: pointer;
  color: inherit; font-size: 1.1rem; opacity: 0.6;
}
.alert-close:hover { opacity: 1; }

/* ============================================================
   Modal
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadein 0.2s ease;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 0 60px rgba(255,68,68,0.15);
  animation: scaleIn 0.2s ease;
}
@keyframes scaleIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-icon { font-size: 3rem; margin-bottom: 12px; }
.modal h3 { font-family: var(--font-head); margin-bottom: 12px; }
.modal p { color: var(--text-dim); font-size: 0.9rem; line-height: 1.6; }
.modal-actions { display: flex; gap: 12px; justify-content: center; margin-top: 24px; }

/* ============================================================
   Toast notifications
   ============================================================ */
.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 9999;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s ease;
  max-width: 320px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast-success { border-color: rgba(0,255,136,0.4); color: var(--green); }
.toast-warning { border-color: rgba(255,214,0,0.4); color: var(--yellow); }
.toast-error   { border-color: rgba(255,68,68,0.4);  color: var(--red); }

/* ============================================================
   Auth form
   ============================================================ */
.auth-form { display: flex; flex-direction: column; gap: 18px; }
.auth-form .form-group { display: flex; flex-direction: column; gap: 8px; }
.auth-form label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
}

/* ============================================================
   Scrollbar
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,212,255,0.3); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-240px); }
  .main-content { margin-left: 0; padding: 20px 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-col-full { grid-column: auto; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .rp-flow { justify-content: center; }
  .page-header { flex-direction: column; }
}

/* ============================================================
   Stats Page
   ============================================================ */

/* Filter form */
.stats-filter-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.sel-input {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.85rem;
  padding: 8px 12px;
  outline: none;
  cursor: pointer;
  min-width: 180px;
  transition: border-color 0.2s;
}
.sel-input:focus { border-color: var(--cyan); }

.range-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 4px;
}
.range-tab {
  padding: 5px 12px;
  border-radius: 7px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.2s;
  white-space: nowrap;
}
.range-tab:hover { color: var(--text); }
.range-tab.active { background: var(--cyan-dim); color: var(--cyan); }

/* Chart card */
.chart-card {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}
.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 8px;
}
.chart-title {
  font-family: var(--font-head);
  font-size: 0.9rem;
  letter-spacing: 1px;
  color: var(--text-mid);
  text-transform: uppercase;
}
.chart-peak {
  font-size: 0.82rem;
  color: var(--cyan);
  font-family: var(--font-mono);
  background: var(--cyan-dim);
  padding: 4px 10px;
  border-radius: 6px;
}
.chart-wrap {
  position: relative;
  height: 280px;
}

/* Stats tables grid */
.stats-tables-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 0;
}

.table-card {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  overflow: hidden;
}
.table-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border2);
  background: var(--bg3);
}
.tc-icon { font-size: 1.1rem; }
.table-card-header h3 {
  font-family: var(--font-head);
  font-size: 0.85rem;
  letter-spacing: 1px;
  color: var(--text);
}
.tc-sub { color: var(--text-dim); font-size: 0.75rem; margin-left: auto; }

.mini-table-wrap { overflow-x: auto; max-height: 400px; overflow-y: auto; }

.mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.mini-table th {
  padding: 10px 16px;
  text-align: left;
  color: var(--text-dim);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--border2);
  background: var(--bg3);
  position: sticky;
  top: 0;
  z-index: 1;
}
.mini-table td {
  padding: 9px 16px;
  border-bottom: 1px solid var(--border2);
  vertical-align: middle;
}
.mini-table tr:last-child td { border-bottom: none; }
.mini-table tbody tr { transition: background 0.15s; }
.mini-table tbody tr:hover { background: rgba(0,212,255,0.03); }

.row-today td { background: rgba(0,212,255,0.04); }
.row-today:hover td { background: rgba(0,212,255,0.07) !important; }

.td-day { color: var(--text); white-space: nowrap; }
.td-dow { color: var(--text-dim); font-size: 0.8rem; text-align: center; }
.td-count {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--cyan);
  text-align: right;
  white-space: nowrap;
}
.td-bar { width: 80px; padding-right: 20px; }

.badge-today {
  display: inline-block;
  font-size: 0.65rem;
  background: var(--cyan-dim);
  color: var(--cyan);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 4px;
  font-weight: 700;
  vertical-align: middle;
}

.mini-bar {
  height: 6px;
  background: var(--bg3);
  border-radius: 3px;
  overflow: hidden;
  min-width: 60px;
}
.mini-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), rgba(0,212,255,0.5));
  border-radius: 3px;
  transition: width 0.5s ease;
}
.mini-bar-month {
  background: linear-gradient(90deg, var(--pink), rgba(255,45,120,0.5));
}

.no-data {
  padding: 40px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* Top links table extras */
.medal { font-size: 1.1rem; }
.rank-num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  display: inline-block;
  width: 20px;
  text-align: center;
}
.status-dot { font-size: 0.8rem; font-weight: 600; }
.dot-on  { color: var(--green); }
.dot-off { color: var(--red); }

@media (max-width: 768px) {
  .stats-tables-grid { grid-template-columns: 1fr; }
  .stats-filter-form { flex-direction: column; align-items: stretch; }
  .chart-wrap { height: 200px; }
}
