/* ══════════════════════════════════════════════════════════════════════
   TIKTOK IDOL MANAGEMENT SYSTEM - COMMERCIAL EDITION STYLESHEET
   ══════════════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  --bg-main: #090d16;
  --bg-card: #0f172a;
  --bg-card-hover: #172554;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(244, 63, 94, 0.3);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --brand-tiktok: #FE2C55;
  --brand-cyan: #00F2FE;
  --accent-gold: #f59e0b;
  --accent-green: #10b981;
  --accent-purple: #a855f7;
  --accent-blue: #38bdf8;
  --shadow-glow: 0 0 20px rgba(254, 44, 85, 0.15);
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Top Navigation Bar ── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #FE2C55, #00F2FE);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(254, 44, 85, 0.4);
}

.brand-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.3px;
  background: linear-gradient(90deg, #fff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-badge {
  background: rgba(254, 44, 85, 0.15);
  border: 1px solid rgba(254, 44, 85, 0.35);
  color: #fb7185;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── Buttons ── */
.btn-primary {
  background: linear-gradient(135deg, #FE2C55, #e11d48);
  color: #fff;
  border: none;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(254, 44, 85, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(254, 44, 85, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  border: 1px solid var(--border-subtle);
  font-weight: 600;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

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

/* ── Container Layout ── */
.main-content {
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px;
}

/* ── KPI Grid ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

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

.kpi-card.live-glow {
  border-color: rgba(239, 68, 68, 0.4);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), var(--bg-card));
}

.kpi-icon {
  font-size: 24px;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-label {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.kpi-val {
  font-size: 19px;
  font-weight: 800;
  color: #fff;
  margin-top: 2px;
  letter-spacing: -0.5px;
}

/* ── Toolbar & Filter Controls ── */
.toolbar {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 260px;
  max-width: 450px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}

.search-input {
  width: 100%;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 12px 8px 36px;
  color: #fff;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.2s ease;
}

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

.filter-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px;
  border-radius: 8px;
  gap: 4px;
}

.filter-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12.5px;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-tab-btn.active {
  background: #1e293b;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.filter-tab-btn.live.active {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.select-control {
  background: #0d1220;
  border: 1px solid var(--border-subtle);
  color: #e2e8f0;
  font-size: 12.5px;
  padding: 6px 10px;
  border-radius: 8px;
  outline: none;
  font-family: inherit;
}

.view-mode-toggle {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.view-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.view-btn.active {
  background: #334155;
  color: #fff;
}

.toolbar-controls-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar-control-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.control-label {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ── Table View ── */
.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  overflow-x: auto;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  text-align: left;
}

.custom-table th {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.custom-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.custom-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.custom-table tr.tr-is-live td {
  background: rgba(239, 68, 68, 0.04);
}

/* ── Avatar & Profile ── */
.avatar-wrap {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
}

.avatar-wrap img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.avatar-wrap.live-ring img {
  border: 2px solid #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.live-pulse-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  background: #ef4444;
  color: #fff;
  font-size: 8px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 4px;
  text-transform: uppercase;
  box-shadow: 0 0 6px #ef4444;
}

.idol-nickname {
  font-weight: 700;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: color 0.15s ease;
}

.idol-nickname:hover {
  color: #f43f5e;
}

.tiktok-link {
  color: #fb7185;
  text-decoration: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
}

.tiktok-link:hover {
  text-decoration: underline;
}

.btn-copy {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  cursor: pointer;
}

/* ── Badges & Pills ── */
.tier-pill {
  font-size: 9px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.tier-diamond { background: rgba(56, 189, 248, 0.15); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.35); }
.tier-gold { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.35); }
.tier-silver { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.35); }
.tier-new { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.35); }

.live-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}

.live-status-pill.live {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.live-status-pill.offline {
  background: rgba(148, 163, 184, 0.1);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 6px #ef4444;
  animation: pulseDot 1.2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
}

.diamond-val {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 12.5px;
}

.diamond-val.today { color: var(--accent-gold); }
.diamond-val.month { color: var(--accent-blue); }
.diamond-val.rolling { color: var(--accent-purple); }

@keyframes diamondPulse {
  0% { transform: scale(1); filter: brightness(1); }
  35% { transform: scale(1.35); filter: brightness(1.8) drop-shadow(0 0 10px #fbbf24); color: #fff; }
  100% { transform: scale(1); filter: brightness(1); }
}

.pulse-diamond {
  display: inline-block;
  animation: diamondPulse 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.badge-time {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
}

.badge-time.today {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-time.month {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

/* ── Actions Buttons in Table ── */
.action-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: #cbd5e1;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.action-btn.timeline {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.3);
}

.action-btn.watch-live {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
}

.action-btn.edit {
  color: #fbbf24;
}

.action-btn.delete {
  color: #f87171;
}

/* ── Grid View ── */
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.card-idol {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 16px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

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

.card-idol.is-live {
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.1);
}

/* ── Modals ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop.active {
  display: flex;
}

.modal-window,
.modal-content {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  0% { opacity: 0; transform: scale(0.95); }
  100% { opacity: 1; transform: scale(1); }
}

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

.modal-title {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
}

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

.modal-body {
  padding: 20px;
}

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

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.form-input {
  width: 100%;
  background: #090d16;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 9px 12px;
  color: #fff;
  font-size: 13.5px;
  outline: none;
  font-family: inherit;
}

.form-input:focus {
  border-color: #f43f5e;
}

/* ── Timeline Bar Chart ── */
.chart-container {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 120px;
  padding-top: 10px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 16px;
  overflow-x: auto;
}

.chart-col {
  flex: 1;
  min-width: 14px;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.chart-bar-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.chart-bar {
  width: 8px;
  border-radius: 3px 3px 0 0;
  transition: height 0.3s ease;
}

.chart-day-label {
  font-size: 9.5px;
  color: #64748b;
  margin-top: 4px;
}

.chart-day-label.today {
  color: #f43f5e;
  font-weight: 800;
}

.session-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.session-item:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.035);
}

.session-item.active-live {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.06);
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.15);
}

/* Timeline Filter Buttons */
.tl-filter-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: #94a3b8;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tl-filter-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.tl-filter-btn.active {
  background: rgba(244, 63, 94, 0.15);
  border-color: #f43f5e;
  color: #fb7185;
}

/* Smart Session Badges */
.badge-boom {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.25), rgba(245, 158, 11, 0.25));
  border: 1px solid rgba(245, 158, 11, 0.6);
  color: #fbbf24;
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.25);
}

.badge-valid {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
}

.badge-invalid {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
}

/* Top Gifter Avatars in Session Card */
.session-top-gifters {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.session-gifter-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 7px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.session-gifter-avatar {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Bar Chart Column Highlight on Click */
.chart-col {
  transition: transform 0.15s ease;
}
.chart-col:hover {
  transform: scaleY(1.05);
}
.chart-col-selected .chart-bar {
  outline: 2px solid #38bdf8;
  outline-offset: 1px;
}

/* ── Pagination ── */
.pagination-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  padding: 10px 0;
}

.page-btn {
  background: #1e293b;
  border: 1px solid var(--border-subtle);
  color: #cbd5e1;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  margin: 0 2px;
}

.page-btn.active {
  background: #f43f5e;
  color: #fff;
  border-color: #f43f5e;
}

.page-btn.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ── Contract Badge Styles ── */
.contract-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: -0.2px;
}
.contract-badge.valid {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.contract-badge.warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.contract-badge.urgent {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.contract-badge.expired {
  background: rgba(100, 116, 139, 0.2);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

/* ── Top User Modal Styles (Desktop & Base) ── */
.tl-main-tabs {
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 16px;
  gap: 6px;
}

.top-user-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.top-user-tab-btn:hover {
  color: #fff;
}

.top-user-tab-btn.active {
  background: #fbbf24;
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(251, 191, 36, 0.35);
}

.tl-scope-tabs {
  display: inline-flex;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  gap: 4px;
}

.tl-summary-banner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.tl-summary-card {
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.tl-summary-card.stat-diamonds {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.12), rgba(251, 191, 36, 0.03));
  border: 1px solid rgba(251, 191, 36, 0.25);
}

.tl-summary-card.stat-users {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(56, 189, 248, 0.03));
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.tl-summary-icon {
  font-size: 22px;
  flex-shrink: 0;
}

.tl-summary-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.stat-diamonds .tl-summary-label {
  color: #fbbf24;
}

.stat-users .tl-summary-label {
  color: #38bdf8;
}

.tl-summary-val {
  font-size: 17px;
  font-weight: 900;
  color: #fff;
  margin-top: 1px;
}

.tl-podium-wrap {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 18px;
  padding-top: 6px;
}

.podium-card {
  border-radius: 14px;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  transition: transform 0.2s ease;
  min-width: 0;
}

.podium-card:hover {
  transform: translateY(-3px);
}

.podium-card.rank-1 {
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.18), rgba(251, 191, 36, 0.04));
  border: 1px solid rgba(251, 191, 36, 0.45);
  box-shadow: 0 10px 25px rgba(251, 191, 36, 0.15);
  padding-top: 20px;
}

.podium-card.rank-2 {
  background: linear-gradient(180deg, rgba(203, 213, 225, 0.14), rgba(203, 213, 225, 0.03));
  border: 1px solid rgba(203, 213, 225, 0.35);
}

.podium-card.rank-3 {
  background: linear-gradient(180deg, rgba(217, 119, 6, 0.14), rgba(217, 119, 6, 0.03));
  border: 1px solid rgba(217, 119, 6, 0.35);
}

.podium-medal {
  font-size: 20px;
  margin-bottom: 4px;
  line-height: 1;
}

.podium-avatar-wrap {
  position: relative;
  margin-bottom: 6px;
}

.podium-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.2);
  display: block;
}

.podium-card.rank-1 .podium-avatar {
  width: 60px;
  height: 60px;
  border-color: #fbbf24;
}

.podium-card.rank-2 .podium-avatar {
  border-color: #cbd5e1;
}

.podium-card.rank-3 .podium-avatar {
  border-color: #d97706;
}

.podium-badge {
  position: absolute;
  bottom: -3px;
  right: -3px;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 9.5px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.podium-card.rank-1 .podium-badge {
  border-color: #fbbf24;
  color: #fbbf24;
}

.podium-name {
  font-size: 12.5px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.podium-uname {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  margin-bottom: 6px;
}

.podium-diamonds {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 3px 8px;
  border-radius: 16px;
  font-size: 11.5px;
  font-weight: 900;
  color: #fbbf24;
  white-space: nowrap;
}

.podium-card.rank-2 .podium-diamonds {
  color: #e2e8f0;
}

.podium-card.rank-3 .podium-diamonds {
  color: #f59e0b;
}

.podium-gift {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Top 4-10 Leaderboard Base */
.topuser-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.topuser-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.15s ease;
  min-height: 52px;
  box-sizing: border-box;
}

.topuser-row:last-child {
  border-bottom: none;
}

.topuser-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.topuser-left {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  min-width: 0 !important;
  flex: 1 !important;
  overflow: hidden !important;
}

.rank-pill {
  width: 26px !important;
  height: 26px !important;
  min-width: 26px !important;
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--text-muted) !important;
  flex-shrink: 0 !important;
}

.topuser-avatar {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  max-width: 36px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  flex-shrink: 0 !important;
  display: block !important;
  margin: 0 2px !important;
}

.topuser-meta {
  min-width: 0 !important;
  flex: 1 !important;
  overflow: hidden !important;
}

.topuser-name {
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #fff !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  line-height: 1.3 !important;
}

.topuser-sub {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-size: 10.5px !important;
  color: var(--text-muted) !important;
  margin-top: 2px !important;
  overflow: hidden !important;
}

.topuser-uname {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 110px !important;
  flex-shrink: 0 !important;
}

.topuser-gift-tag {
  display: inline-block !important;
  font-size: 9.5px !important;
  color: #fbbf24 !important;
  background: rgba(251, 191, 36, 0.12) !important;
  padding: 1px 5px !important;
  border-radius: 4px !important;
  max-width: 130px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.col-gift-desktop {
  display: none !important;
}

.topuser-right {
  text-align: right !important;
  flex-shrink: 0 !important;
  margin-left: 8px !important;
}

.topuser-diamonds {
  font-size: 13px !important;
  font-weight: 800 !important;
  color: #fbbf24 !important;
  white-space: nowrap !important;
}

.topuser-count {
  font-size: 10px !important;
  color: var(--text-muted) !important;
  white-space: nowrap !important;
}

/* Ẩn các thông tin theo yêu cầu */
.user-hide-item {
  display: none !important;
}

/* ══════════════════════════════════════════════════════════════════════
   MOBILE & TABLET RESPONSIVE SYSTEM (iOS & Android Optimized)
   ══════════════════════════════════════════════════════════════════════ */

/* Tablet & Mobile Screens (<= 992px) */
@media (max-width: 992px) {
  .navbar {
    padding: 10px 16px;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
  }

  .brand-wrap {
    justify-content: flex-start;
  }

  .brand-subtitle {
    display: none;
  }

  .nav-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
  }

  .nav-actions .btn-primary,
  .nav-actions .btn-secondary {
    padding: 6px 12px;
    font-size: 12px;
  }

  .main-content {
    padding: 16px 12px;
  }

  .kpi-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
  }
}

  .toolbar {
    padding: 12px 14px;
    gap: 10px;
  }
}

/* Smartphone Screens (<= 768px) */
@media (max-width: 768px) {
  body {
    -webkit-tap-highlight-color: transparent;
  }

  .navbar {
    padding: 10px 12px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
  }

  .brand-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .brand-logo {
    width: 32px;
    height: 32px;
    font-size: 16px;
    border-radius: 8px;
  }

  .brand-title {
    font-size: 14.5px;
    letter-spacing: -0.3px;
  }

  .brand-badge {
    display: none;
  }

  .nav-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: calc(100vw - 120px);
    padding-bottom: 2px;
  }
  .nav-actions::-webkit-scrollbar {
    display: none;
  }

  .nav-actions .btn-primary,
  .nav-actions .btn-secondary {
    padding: 6px 10px;
    font-size: 11.5px;
    border-radius: 8px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .main-content {
    padding: 10px 8px;
  }

  /* KPI Grid: 2 columns on phones */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 12px;
  }

  .kpi-card {
    padding: 10px 12px;
    gap: 8px;
    border-radius: 12px;
    transition: transform 0.15s ease;
  }

  .kpi-card:active {
    transform: scale(0.98);
  }

  .kpi-card.live-glow {
    border-color: rgba(239, 68, 68, 0.5);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), var(--bg-card));
  }

  .kpi-icon {
    width: 34px;
    height: 34px;
    font-size: 17px;
    border-radius: 9px;
  }

  .kpi-label {
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0;
  }

  .kpi-val {
    font-size: 15.5px;
    font-weight: 900;
    letter-spacing: -0.4px;
    margin-top: 1px;
  }

  /* Toolbar */
  .toolbar {
    padding: 10px;
    margin-bottom: 12px;
    border-radius: 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .search-input-wrap {
    min-width: 100%;
    max-width: 100%;
    width: 100%;
  }

  .search-input {
    font-size: 13px;
    padding: 8px 10px 8px 32px;
  }

  .search-icon {
    left: 10px;
    font-size: 13px;
  }

  .filter-tabs {
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 2px;
    gap: 4px;
  }
  .filter-tabs::-webkit-scrollbar {
    display: none;
  }

  .filter-tab-btn {
    flex-shrink: 0;
    padding: 5px 9px;
    font-size: 11.5px;
  }

  .toolbar-controls-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    width: 100%;
  }

  .toolbar-control-item {
    width: 100%;
  }

  .toolbar-control-item .select-control {
    width: 100%;
    font-size: 11.5px;
    padding: 6px 8px;
  }

  .toolbar-control-item .control-label {
    display: none;
  }

  .view-mode-toggle {
    width: 100%;
  }

  .view-btn {
    flex: 1;
    text-align: center;
    padding: 5px 6px;
  }

  /* Table View Scrollable */
  .table-wrap {
    border-radius: 10px;
    -webkit-overflow-scrolling: touch;
    box-shadow: inset -10px 0 10px -10px rgba(0, 0, 0, 0.5);
  }

  .custom-table th {
    padding: 8px 10px;
    font-size: 10px;
    white-space: nowrap;
  }

  .custom-table td {
    padding: 10px 8px;
    font-size: 12.5px;
  }

  .avatar-wrap {
    width: 38px;
    height: 38px;
  }

  .idol-nickname {
    font-size: 13px;
  }

  .action-btn {
    padding: 3px 6px;
    font-size: 10.5px;
  }

  /* 1. KHUNG THẺ IDOL FULL WIDTH KHÔNG BỊ NHỎ LỌT */
  #view-mode-grid {
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .grid-container,
  #grid-body {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    gap: 12px !important;
  }

  .card-idol {
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 16px 14px !important;
    border-radius: 14px !important;
    margin: 0 !important;
    background: #0f172a !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
  }

  .card-idol .avatar-wrap {
    width: 56px !important;
    height: 56px !important;
  }

  .card-idol .idol-nickname {
    font-size: 16px !important;
    font-weight: 800 !important;
  }

  .card-idol .action-btn {
    padding: 9px 8px !important;
    font-size: 12.5px !important;
    border-radius: 8px !important;
  }

  /* Pagination */
  .pagination-wrap {
    flex-direction: column;
    gap: 10px;
    align-items: center;
    text-align: center;
  }

  .page-btn {
    padding: 5px 10px;
    font-size: 11.5px;
  }

  /* 2. TỐI ƯU TIMELINE & CÁC MODAL TRÊN MOBILE */
  .modal-backdrop {
    padding: 0;
    align-items: flex-end;
  }

  .modal-window {
    max-width: 100% !important;
    width: 100% !important;
    max-height: 94vh !important;
    border-radius: 20px 20px 0 0 !important;
    border-bottom: none !important;
    margin: 0 !important;
  }

  .modal-header {
    padding: 12px 16px;
    position: sticky;
    top: 0;
    background: #0f172a;
    z-index: 20;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .modal-title {
    font-size: 14.5px;
  }

  .modal-body {
    padding: 12px 14px 30px;
    max-height: calc(94vh - 65px);
  }

  /* Header Modal Timeline on Mobile */
  #modal-timeline .modal-header {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 10px 14px !important;
  }
  #modal-timeline .modal-header > div:first-child {
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }
  #modal-timeline .modal-header > div:last-child {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    flex-wrap: wrap !important;
  }
  #modal-timeline #btn-force-watch-live,
  #modal-timeline .modal-header .btn-primary {
    font-size: 11px !important;
    padding: 5px 8px !important;
  }

  /* 5 Quick KPI Cards in Timeline */
  #modal-timeline .modal-body > div[style*="grid-template-columns:repeat(auto-fit"] {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 7px !important;
    margin-bottom: 12px !important;
  }

  #modal-timeline .modal-body > div[style*="grid-template-columns:repeat(auto-fit"] > div {
    padding: 9px 8px !important;
    border-radius: 9px !important;
    background: rgba(255, 255, 255, 0.03) !important;
  }

  #modal-timeline .modal-body > div[style*="grid-template-columns:repeat(auto-fit"] > div:last-child {
    grid-column: 1 / -1 !important;
  }

  /* Executive Insights Box on Mobile */
  .tl-insights-container {
    padding: 10px 12px !important;
    margin-bottom: 12px !important;
    border-radius: 10px !important;
  }
  .tl-insights-container > div:first-child {
    flex-wrap: wrap !important;
    gap: 6px !important;
    margin-bottom: 8px !important;
  }
  .tl-insights-container > div:first-child span {
    font-size: 12px !important;
  }
  .tl-insights-metrics-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
  }
  .tl-insights-metrics-grid > div:last-child {
    grid-column: 1 / -1 !important;
  }
  .tl-insights-metrics-grid > div {
    padding: 8px 10px !important;
  }
  .tl-insights-metrics-grid > div > div:nth-child(2) {
    font-size: 13.5px !important;
  }

  /* Sub Tabs in Timeline (Lịch sử Live vs Top 10 User vs Lịch PK) */
  .tl-main-tabs {
    display: flex !important;
    width: 100% !important;
    gap: 4px !important;
    margin-bottom: 12px !important;
  }

  .tl-main-tabs .top-user-tab-btn {
    flex: 1 !important;
    text-align: center !important;
    padding: 7px 2px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* Timeline Biểu Đồ Ngày */
  #tl-chart-bars {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    width: 100% !important;
    padding: 10px 4px 6px !important;
    height: 110px !important;
    scrollbar-width: none !important;
  }
  #tl-chart-bars::-webkit-scrollbar {
    display: none !important;
  }
  #tl-chart-bars .chart-col {
    min-width: 16px !important;
    margin: 0 1px !important;
  }

  /* Session Filters on Mobile - Horizontal Swipe */
  .tl-session-filters {
    display: flex !important;
    width: 100% !important;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 5px !important;
    padding: 2px 0 6px !important;
    scrollbar-width: none !important;
  }
  .tl-session-filters::-webkit-scrollbar {
    display: none !important;
  }
  .tl-filter-btn {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    font-size: 11px !important;
    padding: 3px 8px !important;
  }

  /* Thẻ Active Day Filter trên Mobile */
  #tl-active-day-filter {
    font-size: 11px !important;
    padding: 5px 8px !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
  }

  /* Danh Sách Ca Live trong Timeline */
  .session-item {
    padding: 10px 10px !important;
    border-radius: 10px !important;
    margin-bottom: 8px !important;
    background: rgba(255, 255, 255, 0.03) !important;
  }

  .session-item > div:first-child {
    flex-wrap: wrap !important;
    gap: 4px !important;
    margin-bottom: 6px !important;
  }

  .session-item > div:first-child > div:first-child {
    font-size: 12.5px !important;
  }

  .session-item > div:first-child > div:last-child {
    font-size: 13.5px !important;
  }

  .session-item > div:nth-child(2) {
    flex-wrap: wrap !important;
    gap: 8px !important;
    font-size: 11px !important;
    padding: 5px 8px !important;
  }

  /* Top Fan Ca trên Mobile */
  .session-top-gifters {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 4px !important;
    padding: 5px 8px !important;
  }
  .session-top-gifters > div {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
    width: 100% !important;
  }
  .session-gifter-badge {
    font-size: 10px !important;
    padding: 2px 5px !important;
    max-width: 100% !important;
  }

  /* Top 10 User Scope Tabs on Mobile */
  .tl-scope-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    margin-bottom: 12px !important;
  }

  .tl-scope-tabs {
    display: flex !important;
    width: 100% !important;
    background: rgba(0, 0, 0, 0.5) !important;
    padding: 3px !important;
    border-radius: 10px !important;
    gap: 3px !important;
  }

  .tl-scope-tabs .top-user-tab-btn {
    flex: 1 !important;
    text-align: center !important;
    padding: 7px 2px !important;
    font-size: 11px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    border-radius: 7px !important;
  }

  #tl-session-select,
  #topuser-session-select,
  #topuser-idol-select {
    width: 100% !important;
    min-width: 100% !important;
  }

  .topuser-select-row {
    width: 100% !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }

  /* Summary Banner in Top User on Mobile */
  .tl-summary-banner {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    margin-bottom: 12px !important;
  }

  .tl-summary-card {
    padding: 8px 10px !important;
    gap: 8px !important;
    border-radius: 10px !important;
  }

  .tl-summary-icon {
    font-size: 18px !important;
  }

  .tl-summary-label {
    font-size: 9.5px !important;
    letter-spacing: 0 !important;
  }

  .tl-summary-val {
    font-size: 14.5px !important;
  }

  /* Top 3 Podium on Mobile */
  .tl-podium-wrap,
  #topuser-podium,
  #tl-user-podium {
    display: grid !important;
    grid-template-columns: 1fr 1.12fr 1fr !important;
    gap: 5px !important;
    padding-top: 4px !important;
    margin-bottom: 14px !important;
    align-items: flex-end !important;
  }

  .podium-card {
    padding: 8px 3px 6px !important;
    border-radius: 10px !important;
  }

  .podium-card.rank-1 {
    min-height: 155px !important;
    padding-top: 10px !important;
  }

  .podium-card.rank-2 {
    min-height: 135px !important;
  }

  .podium-card.rank-3 {
    min-height: 130px !important;
  }

  .podium-medal {
    font-size: 17px !important;
    margin-bottom: 2px !important;
  }

  .podium-avatar-wrap {
    margin-bottom: 4px !important;
  }

  .podium-avatar {
    width: 38px !important;
    height: 38px !important;
  }

  .podium-card.rank-1 .podium-avatar {
    width: 46px !important;
    height: 46px !important;
  }

  .podium-badge {
    width: 15px !important;
    height: 15px !important;
    font-size: 8.5px !important;
    bottom: -2px !important;
    right: -2px !important;
  }

  .podium-name {
    font-size: 11px !important;
    line-height: 1.2 !important;
  }

  .podium-uname {
    font-size: 9px !important;
    margin-bottom: 4px !important;
  }

  .podium-diamonds {
    font-size: 10px !important;
    padding: 2px 5px !important;
    border-radius: 10px !important;
  }

  .podium-gift {
    font-size: 9px !important;
    margin-top: 3px !important;
  }

  /* Top 4-10 Leaderboard Table on Mobile */
  .topuser-table-head {
    display: none !important;
  }

  .col-gift-desktop {
    display: none !important;
  }

  .topuser-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 9px 10px !important;
    gap: 8px !important;
    min-height: 50px !important;
    box-sizing: border-box !important;
  }

  .topuser-left {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    min-width: 0 !important;
    flex: 1 !important;
    overflow: hidden !important;
  }

  .rank-pill {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    font-size: 10.5px !important;
    flex-shrink: 0 !important;
  }

  .topuser-avatar {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    max-width: 34px !important;
    flex-shrink: 0 !important;
    display: block !important;
    margin: 0 2px !important;
  }

  .topuser-meta {
    min-width: 0 !important;
    flex: 1 !important;
    overflow: hidden !important;
  }

  .topuser-name {
    font-size: 12px !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.3 !important;
  }

  .topuser-sub {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    font-size: 10px !important;
    overflow: hidden !important;
  }

  .topuser-uname {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 75px !important;
    flex-shrink: 0 !important;
  }

  .topuser-gift-tag {
    display: inline-block !important;
    font-size: 9px !important;
    color: #fbbf24 !important;
    background: rgba(251, 191, 36, 0.12) !important;
    padding: 1px 4px !important;
    border-radius: 4px !important;
    max-width: 105px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .topuser-right {
    flex-shrink: 0 !important;
    text-align: right !important;
    margin-left: 6px !important;
  }

  .topuser-diamonds {
    font-size: 12px !important;
    white-space: nowrap !important;
  }

  .topuser-count {
    font-size: 9.5px !important;
    white-space: nowrap !important;
  }
}

/* Small Smartphone Screens (<= 480px) */
@media (max-width: 480px) {
  .brand-badge {
    display: none;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .kpi-card {
    padding: 8px 8px;
    gap: 6px;
  }

  .kpi-icon {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  .kpi-val {
    font-size: 14px;
  }

  .toolbar-controls-row {
    grid-template-columns: 1fr;
  }

  .action-btn.edit,
  .action-btn.delete {
    padding: 3px 5px;
  }
}

/* ── Agency Management UI Components ── */
#active-agency-banner {
  box-shadow: 0 4px 20px -2px rgba(30, 58, 138, 0.25);
  animation: bannerFadeIn 0.3s ease;
}

@keyframes bannerFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
  #form-agency > div:first-of-type {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  #form-agency > div:last-of-type {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  #btn-save-agency {
    width: 100% !important;
  }

  #active-agency-banner {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }

  #active-agency-banner button {
    width: 100% !important;
    text-align: center;
  }
}

/* ── Schedule Mobile Optimized Styles ── */
.sched-date-btn.active, .sched-time-pill.active, .sched-dur-pill.active {
  background: rgba(236, 72, 153, 0.22) !important;
  border-color: #f472b6 !important;
  color: #f472b6 !important;
  font-weight: 700 !important;
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.25) !important;
}

@media (max-width: 640px) {
  #sched-field-opponent {
    grid-template-columns: 1fr !important;
  }
  .sched-time-pill {
    flex: 1 1 calc(33.333% - 6px) !important;
    text-align: center !important;
  }
}



