/* ==========================================================
   UGC MODERATION COMMAND CENTER • GFF DESIGN SYSTEM
   ========================================================== */

/* FONTS GARENA FREE FIRE */
@font-face {
  font-family: 'GFF-Black';
  src: url('/fonts/GFF-VN-BLACK.ttf') format('truetype');
  font-weight: 900;
  font-display: swap;
}

@font-face {
  font-family: 'GFF-ExtraBold';
  src: url('/fonts/GFF-LATIN-EXTRABOLD-1-1.ttf') format('truetype');
  font-weight: 800;
  font-display: swap;
}

@font-face {
  font-family: 'GFF-Bold';
  src: url('/fonts/GFF-LATIN-BOLD.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: 'GFF-Light';
  src: url('/fonts/GFF-LATIN-LIGHT.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}

:root {
  --font-brand: 'GFF-Black', sans-serif;
  --font-heading: 'GFF-ExtraBold', sans-serif;
  --font-subheading: 'GFF-Bold', sans-serif;
  --font-body: 'GFF-Light', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Theme: Dark (Default) */
  --bg-app: #080d18;
  --bg-surface: rgba(15, 23, 42, 0.88);
  --bg-surface-elevated: rgba(30, 41, 59, 0.85);
  --bg-sidebar: rgba(11, 17, 32, 0.95);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.05);
  --text-main: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-glow: rgba(59, 130, 246, 0.25);
  
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 14px -1px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 40px -5px rgba(0, 0, 0, 0.6);
}

[data-theme="light"] {
  --bg-app: #f1f5f9;
  --bg-surface: rgba(255, 255, 255, 0.94);
  --bg-surface-elevated: #e2e8f0;
  --bg-sidebar: rgba(255, 255, 255, 0.97);
  --border-color: #cbd5e1;
  --border-subtle: #e2e8f0;
  --text-main: #0f172a;
  --text-secondary: #334155;
  --text-muted: #475569;
  
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-glow: rgba(37, 99, 235, 0.15);
  
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 20px 35px -8px rgba(0, 0, 0, 0.15);
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  overflow-x: hidden;
}

/* ==========================================================
   AUTH SCREEN (LOGIN MODAL)
   ========================================================== */
.auth-wrapper {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(rgba(8, 13, 24, 0.85), rgba(8, 13, 24, 0.92)), url('assets/bg-home.jpg') center/cover no-repeat fixed;
  z-index: 9999;
  padding: 20px;
}

[data-theme="light"] .auth-wrapper {
  background: linear-gradient(rgba(241, 245, 249, 0.88), rgba(241, 245, 249, 0.94)), url('assets/bg-home.jpg') center/cover no-repeat fixed;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 40px 32px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  position: relative;
  backdrop-filter: blur(20px);
}

.auth-logo-img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  margin: 0 auto 16px auto;
  display: block;
  filter: drop-shadow(0 6px 16px rgba(59, 130, 246, 0.4));
}

.auth-header h1 {
  font-family: var(--font-brand);
  font-size: 26px;
  letter-spacing: 0.5px;
  margin-bottom: 24px;
  color: var(--text-main);
  text-transform: uppercase;
}

.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--bg-surface-elevated);
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-main);
  font-family: var(--font-subheading);
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.btn-google:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px var(--primary-glow);
}

.auth-alert {
  margin-top: 18px;
  padding: 12px 16px;
  background: var(--danger-bg);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 10px;
  color: #f87171;
  font-size: 13px;
  text-align: left;
  line-height: 1.4;
}

/* ==========================================================
   APP MAIN LAYOUT
   ========================================================== */
.app-layout {
  display: flex;
  min-height: 100vh;
  background: linear-gradient(rgba(8, 13, 24, 0.88), rgba(8, 13, 24, 0.94)), url('/assets/bg-home.jpg') center/cover no-repeat fixed;
}

[data-theme="light"] .app-layout {
  background: linear-gradient(rgba(241, 245, 249, 0.9), rgba(241, 245, 249, 0.95)), url('/assets/bg-home.jpg') center/cover no-repeat fixed;
}

/* MOBILE TOPBAR (VISIBLE ON MOBILE ONLY) */
.mobile-topbar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-color);
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
  z-index: 1000;
  backdrop-filter: blur(16px);
}

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

.mobile-brand-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.mobile-brand-title {
  font-family: var(--font-brand);
  font-size: 17px;
  color: var(--text-main);
  text-transform: uppercase;
}

.btn-hamburger {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-main);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* SIDEBAR */
.sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1001;
  backdrop-filter: blur(16px);
  transition: transform 0.3s ease;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
}

.sidebar-brand {
  padding: 16px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.sidebar-brand:hover {
  background: rgba(255, 255, 255, 0.03);
}

.sidebar-brand-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.sidebar-brand-img {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(59, 130, 246, 0.4));
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.brand-title {
  font-family: var(--font-brand);
  font-size: 14.5px;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-sidebar-toggle {
  position: static;
  transform: none;
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.btn-sidebar-toggle:hover {
  background: #0284c7;
  color: #ffffff;
  border-color: #38bdf8;
  transform: scale(1.1);
  box-shadow: 0 3px 10px rgba(2, 132, 199, 0.4);
}

.sidebar-nav {
  flex: 1;
  padding: 20px 14px;
  overflow-y: auto;
}

.nav-group-title {
  font-family: var(--font-subheading);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin: 18px 10px 8px 10px;
  text-transform: uppercase;
}

.nav-group-title:first-child {
  margin-top: 0;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: var(--text-secondary);
  font-family: var(--font-subheading);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 4px;
  text-align: left;
}

.nav-item:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
}

.nav-item.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.nav-item svg {
  flex-shrink: 0;
}

.badge-pill {
  margin-left: auto;
  font-family: var(--font-subheading);
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--bg-surface-elevated);
  color: var(--text-secondary);
}

.nav-item.active .badge-pill {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.badge-pill.ready {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.badge-pill.super {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

/* SIDEBAR FOOTER & LANGUAGE SWITCHER */
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.15);
}

.lang-switch-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 6px 10px;
  background: var(--bg-surface-elevated);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.lang-label {
  font-family: var(--font-subheading);
  font-size: 12px;
  color: var(--text-secondary);
}

.lang-btn-group {
  display: flex;
  gap: 4px;
}

.btn-lang {
  background: transparent;
  border: none;
  padding: 4px 8px;
  border-radius: 6px;
  font-family: var(--font-subheading);
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-lang.active {
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
}

.btn-lang-compact {
  display: none;
}

/* GAMING AESTHETIC USER PROFILE (CLEAN, PROFESSIONAL, NO NESTED BOXES) */
.user-profile.gaming-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin-bottom: 12px;
  border-radius: 10px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: all 0.2s ease;
}

[data-theme="light"] .user-profile.gaming-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.user-profile.gaming-card::before {
  display: none !important;
}

.user-profile.gaming-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.user-details .tier-3d-badge {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 1px 0 0 0 !important;
  font-size: 12px !important;
}

.user-details .tier-3d-badge:hover {
  transform: none !important;
}

.user-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gaming-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: cover;
  border: 2px solid #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
  transition: all 0.25s ease;
}

.user-profile.gaming-card:hover .gaming-avatar {
  border-color: #67e8f9;
  box-shadow: 0 0 14px rgba(103, 232, 249, 0.6);
  transform: scale(1.05);
}

.user-status-dot-mini {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid var(--bg-surface);
  box-shadow: 0 0 8px #10b981;
}

.user-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
}

.gaming-name {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-badge-wrap {
  display: flex;
  align-items: center;
}

.gaming-rank-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-family: var(--font-subheading);
  font-weight: 700;
}

/* SIDEBAR ACTIONS - FRAMELESS SLEEK PROFESSIONAL BUTTONS */
.sidebar-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  padding: 4px 0;
}

.btn-icon {
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: none;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #38bdf8;
  transform: scale(1.18);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.25);
}

[data-theme="light"] .btn-icon:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #0284c7;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.2);
}

.btn-icon.danger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  transform: scale(1.18);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* ==========================================================
   MAIN CONTENT AREA
   ========================================================== */
.main-content {
  flex: 1;
  margin-left: 260px;
  width: calc(100vw - 260px);
  max-width: calc(100vw - 260px);
  min-width: 0;
  padding: 24px 28px;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* TOPBAR */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}

.topbar-left h2 {
  font-family: var(--font-brand);
  font-size: 24px;
  color: var(--text-main);
  letter-spacing: 0.3px;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.sync-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-subheading);
  font-size: 12.5px;
  color: var(--text-secondary);
}

.live-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 10px var(--success);
  animation: pulse 2s infinite;
}

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

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.date-filter-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.95);
  border: 1.5px solid #38bdf8;
  padding: 7px 12px;
  border-radius: 10px;
  color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
  color-scheme: dark;
}

.date-filter-wrap select {
  background: transparent;
  border: none;
  color: #ffffff !important;
  font-family: var(--font-subheading);
  font-size: 13.5px;
  font-weight: 700;
  outline: none;
  cursor: pointer;
  color-scheme: dark;
}

.date-filter-wrap select option,
.table-filter option {
  background-color: #0f172a !important;
  color: #ffffff !important;
  padding: 8px 12px;
}

[data-theme="light"] .date-filter-wrap {
  background: #ffffff;
  border: 1.5px solid #0284c7;
  color: #0284c7;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  color-scheme: light;
}

[data-theme="light"] .date-filter-wrap select {
  color: #0f172a !important;
  color-scheme: light;
}

[data-theme="light"] .date-filter-wrap select option,
[data-theme="light"] .table-filter option {
  background-color: #ffffff !important;
  color: #0f172a !important;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 10px;
  font-family: var(--font-subheading);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.btn-action.primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-action.primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-action.secondary {
  background: var(--bg-surface);
  border-color: var(--border-color);
  color: var(--text-secondary);
}

.btn-action.secondary:hover {
  color: var(--text-main);
  background: var(--bg-surface-elevated);
}

/* ==========================================================
   KPI CARDS GRID
   ========================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
  min-width: 0;
  transition: transform 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.kpi-label {
  font-family: var(--font-subheading);
  font-size: 13px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-icon.blue { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.kpi-icon.green { background: var(--success-bg); color: var(--success); }
.kpi-icon.orange { background: var(--warning-bg); color: var(--warning); }
.kpi-icon.red { background: var(--danger-bg); color: var(--danger); }

.kpi-value {
  font-family: var(--font-heading);
  font-size: 34px;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  word-break: break-all;
}

.text-green { color: var(--success) !important; }
.text-orange { color: var(--warning) !important; }
.text-red { color: var(--danger) !important; }

.kpi-meta {
  font-family: var(--font-subheading);
  font-size: 12.5px;
  color: var(--text-muted);
}

/* ==========================================================
   CHARTS GRID
   ========================================================== */
.charts-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-bottom: 24px;
  min-width: 0;
}

.chart-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 22px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
  min-width: 0;
  overflow: hidden;
}

.chart-header {
  margin-bottom: 16px;
}

.chart-header h3 {
  font-family: var(--font-heading);
  font-size: 16px;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.chart-subtitle {
  font-family: var(--font-body);
  font-size: 12.5px;
  color: var(--text-muted);
}

.chart-wrapper {
  position: relative;
  height: 250px;
  width: 100%;
  max-width: 100%;
}

.donut-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================
   TABLE CARD & CLEAN STATUS BADGES (NO EMOJIS)
   ========================================================== */
.table-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 22px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 14px;
}

.table-header-left h3 {
  font-family: var(--font-heading);
  font-size: 16px;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.table-subtitle {
  font-family: var(--font-body);
  font-size: 12.5px;
  color: var(--text-muted);
}

.table-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.table-filter {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 7px 12px;
  color: var(--text-main);
  font-family: var(--font-subheading);
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 7px 12px;
}

.search-input-wrap input {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  width: 200px;
}

/* TOP HORIZONTAL SCROLLBAR (ALWAYS VISIBLE AT TOP OF TABLE) */
.table-top-scrollbar-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  height: 14px;
  margin-bottom: 6px;
  scrollbar-width: thin;
  scrollbar-color: #0284c7 rgba(15, 23, 42, 0.7);
}

.table-top-scrollbar-wrap::-webkit-scrollbar {
  height: 12px;
}

.table-top-scrollbar-wrap::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.7);
  border-radius: 8px;
}

.table-top-scrollbar-wrap::-webkit-scrollbar-thumb {
  background: #0284c7;
  border-radius: 8px;
  border: 2px solid rgba(15, 23, 42, 0.7);
}

.table-top-scrollbar-wrap::-webkit-scrollbar-thumb:hover {
  background: #38bdf8;
}

[data-theme="light"] .table-top-scrollbar-wrap::-webkit-scrollbar-track {
  background: rgba(226, 232, 240, 0.9);
}

[data-theme="light"] .table-top-scrollbar-wrap::-webkit-scrollbar-thumb {
  background: #0284c7;
  border: 2px solid rgba(226, 232, 240, 0.9);
}

.table-top-scrollbar-track {
  width: 1420px;
  height: 1px;
}

.table-responsive {
  width: 100%;
  max-width: 100%;
  max-height: calc(100vh - 290px);
  min-height: 420px;
  overflow-x: auto !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-x pan-y !important;
  display: block;
  padding-bottom: 14px;
  position: relative;
}

.table-responsive::-webkit-scrollbar {
  height: 0px !important;
  width: 8px !important;
}

.table-responsive::-webkit-scrollbar:horizontal,
.table-responsive::-webkit-scrollbar-track:horizontal,
.table-responsive::-webkit-scrollbar-thumb:horizontal,
.table-responsive::-webkit-scrollbar-button:horizontal,
.table-responsive::-webkit-scrollbar-corner,
[data-theme="light"] .table-responsive::-webkit-scrollbar:horizontal,
[data-theme="light"] .table-responsive::-webkit-scrollbar-track:horizontal,
[data-theme="light"] .table-responsive::-webkit-scrollbar-thumb:horizontal,
[data-theme="light"] .table-responsive::-webkit-scrollbar-button:horizontal,
[data-theme="light"] .table-responsive::-webkit-scrollbar-corner {
  display: none !important;
  height: 0px !important;
  width: 0px !important;
  background: transparent !important;
  border: none !important;
}

.table-responsive::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.7);
  border-radius: 8px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: #0284c7;
  border-radius: 8px;
  border: 2px solid rgba(15, 23, 42, 0.7);
}

.table-responsive::-webkit-scrollbar-thumb:hover {
  background: #38bdf8;
}

[data-theme="light"] .table-responsive::-webkit-scrollbar-track {
  background: rgba(226, 232, 240, 0.9);
}

[data-theme="light"] .table-responsive::-webkit-scrollbar-thumb {
  background: #0284c7;
  border: 2px solid rgba(226, 232, 240, 0.9);
}

.data-table {
  width: 100%;
  min-width: 1420px;
  table-layout: fixed !important;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 15;
  background: var(--bg-surface-elevated);
  color: var(--text-secondary);
  font-family: var(--font-subheading);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 11px 12px;
  border-bottom: 1.5px solid var(--border-color);
  box-shadow: 0 1px 0 var(--border-color);
  white-space: nowrap;
  box-sizing: border-box;
}

.data-table tbody tr {
  height: 52px;
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
  color: var(--text-main);
  vertical-align: middle;
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

/* THUMBNAILS & HAMMER ICONS */
.map-cover-thumb {
  width: 50px;
  height: 38px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.map-cover-thumb:hover {
  transform: scale(1.8);
  z-index: 10;
  box-shadow: var(--shadow-md);
}

.hammer-badge-wrap {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-subheading);
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
}

.hammer-icon-box {
  width: 28px;
  height: 28px;
  min-width: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}

.hammer-icon-img {
  width: 24px !important;
  height: 24px !important;
  max-width: 24px !important;
  max-height: 24px !important;
  object-fit: contain !important;
  display: block !important;
  transition: transform 0.2s ease;
}

/* Scaling Lv.7, Lv.8, Lv.9 whose outer flare canvas makes hammer appear smaller */
.hammer-icon-img[alt="Lv.7"],
.hammer-icon-img[alt="Lv.8"],
.hammer-icon-img[alt="Lv.9"] {
  transform: scale(1.24) !important;
}

/* CLEAN FLAT BADGES (NO EMOJIS) */
.cell-action {
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
}

.badge-clean {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 6px;
  font-family: var(--font-subheading);
  font-size: 12px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  white-space: nowrap !important;
  flex-shrink: 0;
}

.badge-approved {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.badge-softban {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.badge-rejected {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.35);
}

/* TIME COLUMN WITH TOGGLE */
.cell-time {
  white-space: nowrap !important;
  vertical-align: middle;
}

.time-cell-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.time-primary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-main);
  white-space: nowrap;
}

.btn-time-toggle {
  background: transparent;
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  font-size: 9px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-time-toggle:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
}

.time-detail {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.time-detail.hidden {
  display: none !important;
}

/* UID CELL (FIXED, NO ELLIPSIS DOTS) */
.cell-uid {
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
}

.btn-uid-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 118px;
  padding: 5px 8px;
  box-sizing: border-box;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  transition: all 0.2s ease;
  position: relative;
}

.btn-uid-copy:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #38bdf8;
  transform: translateY(-1px);
}

.btn-uid-copy.copied {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--success);
  color: var(--success);
}

.btn-uid-copy svg {
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.btn-uid-copy:hover svg {
  opacity: 1;
}

/* ACTIONS CELL (GENEROUS PADDING, NEVER CROPPED) */
.cell-actions,
.data-table td:last-child {
  overflow: visible !important;
  padding-right: 22px !important;
}

/* MAP DESCRIPTION BOX */
.map-desc-box {
  margin-top: 6px;
  padding: 6px 10px;
  background: rgba(15, 23, 42, 0.4);
  border-left: 3px solid #38bdf8;
  border-radius: 4px;
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.45;
  word-break: break-word;
  white-space: pre-wrap;
}

[data-theme="light"] .map-desc-box {
  background: rgba(241, 245, 249, 0.9);
  color: #334155;
  border-left-color: #0284c7;
}

/* RUN PROJECT DROPDOWN BUTTON (SMART DROPUP/DROPDOWN & STACKING ISOLATION) */
.data-table tbody tr.dropdown-open,
.data-table tbody tr:has(.run-menu:not(.hidden)) {
  position: relative !important;
  z-index: 999999 !important;
}

.run-project-dropdown {
  position: relative;
  display: inline-block;
  z-index: 10;
}

.run-project-dropdown:has(.run-menu:not(.hidden)),
.run-project-dropdown.active {
  z-index: 999999 !important;
}

.btn-run-project {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 6px;
  font-family: var(--font-subheading);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  background: #0284c7;
  color: #ffffff;
  border: 1px solid #0369a1;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-run-project:hover {
  background: #0369a1;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.5);
  transform: translateY(-1px);
}

.run-menu {
  position: absolute;
  min-width: 140px;
  background: #0f172a;
  border: 1px solid #38bdf8;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 2px 8px rgba(0, 0, 0, 0.4);
  z-index: 999999 !important;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.run-menu:not(.dropup) {
  top: calc(100% + 4px);
  bottom: auto;
  left: 0;
}

.run-menu.dropup {
  bottom: calc(100% + 4px) !important;
  top: auto !important;
  left: 0;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.8), 0 -2px 8px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="light"] .run-menu {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.run-menu.hidden {
  display: none !important;
}

.run-menu-item {
  width: 100%;
  padding: 8px 14px;
  text-align: left;
  background: transparent;
  border: none;
  color: #f1f5f9;
  font-family: var(--font-subheading);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

[data-theme="light"] .run-menu-item {
  color: #1e293b;
}

.run-menu-item:hover {
  background: #0284c7;
  color: #ffffff;
}

/* KPI DATE FILTER */
.kpi-date-filter-box {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.kpi-custom-dates {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.kpi-custom-dates.hidden {
  display: none !important;
}

.table-date-input {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 5px 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-main);
  color-scheme: dark;
}

[data-theme="light"] .table-date-input {
  color-scheme: light;
  background: #ffffff;
}

/* BUTTONS IN TABLE */
.btn-table-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 6px;
  font-family: var(--font-subheading);
  font-size: 12px;
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-table-action:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

/* VIOLATION DETAILS & COMMENTS (COLLAPSIBLE ROW WITH UNIFORM HEIGHT) */
.violation-details-cell {
  position: relative;
  min-width: 180px;
  max-width: 290px;
}

.details-compact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.details-compact-preview {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.badge-count-more {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.btn-toggle-details {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 22px;
  height: 22px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-toggle-details:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  transform: scale(1.1);
}

.violation-details-cell.collapsed .details-expanded-body {
  display: none !important;
}

.violation-details-cell.expanded .details-expanded-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-color);
}

.violation-types-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.badge-vtype {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--font-subheading);
  font-size: 11px;
  font-weight: 700;
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
  white-space: nowrap;
}

.badge-vtype.image-viol {
  background: rgba(236, 72, 153, 0.15);
  color: #f472b6;
  border-color: rgba(236, 72, 153, 0.35);
}

.badge-vtype.text-viol {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.35);
}

.badge-vreason {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--font-subheading);
  font-size: 11px;
  font-weight: 600;
  background: rgba(249, 115, 22, 0.15);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.35);
  white-space: nowrap;
}

.violation-comment-box {
  background: rgba(56, 189, 248, 0.08);
  border-left: 3px solid #38bdf8;
  padding: 5px 9px;
  border-radius: 0 6px 6px 0;
  font-size: 11.5px;
  color: var(--text-main);
  line-height: 1.45;
  word-break: break-word;
}

[data-theme="light"] .violation-comment-box {
  background: #f1f5f9;
  color: #0f172a !important;
  border-left-color: #0284c7;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  font-weight: 500;
}

/* ==========================================================
   TIER BADGES & ROLE ICONS (KHÔNG HIỆN CHỮ QUYỀN ĐỂ TRÁNH GANH TỊ)
   ========================================================== */
.tier-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 6px;
  font-family: var(--font-subheading);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.tier-master-pill {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.tier-1-pill {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.tier-2-pill {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.tier-3-pill {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

/* BẢNG GHI CHÚ PHÂN CẤP (CHỈ MASTER ADMIN THẤY) */
.role-guide-card {
  background: var(--bg-surface);
  border: 1.5px solid rgba(245, 158, 11, 0.35);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 22px;
}

.role-guide-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 13.5px;
  color: #f59e0b;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.role-guide-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 1200px) {
  .role-guide-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .role-guide-grid {
    grid-template-columns: 1fr;
  }
}

.role-guide-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg-surface-elevated);
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  border: 1px solid var(--border-color);
}

.role-guide-item b {
  color: var(--text-main);
}

/* ==========================================================
   IMAGE VIEWER LIGHTBOX MODAL WITH ZOOM & DRAG & SCREENSHOTS
   ========================================================== */
.viewer-modal-card {
  width: 95%;
  max-width: 1050px;
  max-height: 92vh;
  background: #090d16;
  border: 1px solid #1e293b;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.85);
  overflow: hidden;
}

.viewer-header {
  padding: 16px 22px;
  background: rgba(15, 23, 42, 0.8);
  border-bottom: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

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

.viewer-badge {
  font-family: var(--font-subheading);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 3px 8px;
  border-radius: 6px;
}

.viewer-title-info h3 {
  font-family: var(--font-mono);
  font-size: 16px;
  color: #ffffff;
  margin: 0;
}

.viewer-meta {
  font-family: var(--font-subheading);
  font-size: 12px;
  color: var(--text-muted);
}

.viewer-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-viewer-ctrl {
  background: #1e293b;
  border: 1px solid #334155;
  color: #f1f5f9;
  border-radius: 6px;
  padding: 5px 12px;
  font-family: var(--font-subheading);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-viewer-ctrl:hover {
  background: #38bdf8;
  color: #0f172a;
  border-color: #38bdf8;
}

.viewer-zoom-val {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #38bdf8;
  min-width: 45px;
  text-align: center;
  font-weight: 700;
}

.viewer-stage {
  flex: 1;
  min-height: 320px;
  max-height: 48vh;
  position: relative;
  background: #020617;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.viewer-img-container {
  cursor: grab;
  transition: transform 0.08s ease-out;
  display: flex;
  align-items: center;
  justify-content: center;
}

.viewer-img-container.dragging {
  cursor: grabbing;
}

#viewerMainImg {
  max-width: 90vw;
  max-height: 52vh;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  border: 1px solid #1e293b;
  pointer-events: none;
}

.viewer-hint {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(6px);
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 11.5px;
  color: #94a3b8;
  pointer-events: none;
  white-space: nowrap;
}

.viewer-gallery-footer {
  padding: 12px 20px;
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid #1e293b;
}

.gallery-title {
  font-family: var(--font-subheading);
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.viewer-gallery-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.viewer-thumb-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  flex-shrink: 0;
}

.viewer-thumb {
  width: 72px;
  height: 50px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid transparent;
  background: #0f172a;
  transition: all 0.2s ease;
}

.viewer-thumb-item:hover .viewer-thumb {
  border-color: #64748b;
  transform: translateY(-2px);
}

.viewer-thumb-item.active .viewer-thumb {
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

.viewer-thumb-lbl {
  font-family: var(--font-subheading);
  font-size: 10.5px;
  color: #94a3b8;
  white-space: nowrap;
}

.viewer-thumb-item.active .viewer-thumb-lbl {
  color: #38bdf8;
  font-weight: 700;
}

/* Ảnh vi phạm - viền đỏ */
.viewer-thumb-item.thumb-violation .viewer-thumb {
  border-color: rgba(239, 68, 68, 0.5);
}
.viewer-thumb-item.thumb-violation:hover .viewer-thumb {
  border-color: #ef4444;
}
.viewer-thumb-item.thumb-violation .viewer-thumb-lbl {
  color: #f87171;
}
.viewer-thumb-item.thumb-violation.active .viewer-thumb {
  border-color: #ef4444;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.45);
}
.viewer-thumb-item.thumb-violation.active .viewer-thumb-lbl {
  color: #ef4444;
}

/* Screenshot - viền xám xanh nhạt */
.viewer-thumb-item.thumb-screenshot .viewer-thumb-lbl {
  color: #7dd3fc;
}

/* ==========================================
   VIEWER INFO PANEL (Description + Violation Texts + Image Violations)
   ========================================== */
.viewer-info-panel {
  background: rgba(10, 16, 30, 0.95);
  border-top: 1px solid rgba(239, 68, 68, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 18px;
  max-height: 180px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #334155 transparent;
}

.viewer-info-panel::-webkit-scrollbar {
  height: 4px;
  width: 4px;
}
.viewer-info-panel::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}

#viewerInfoContent {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  align-items: start;
}

.vinfo-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.vinfo-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-subheading);
  font-size: 10.5px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 4px;
}

.vinfo-card-count {
  font-family: var(--font-mono);
  font-size: 10px;
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border-radius: 999px;
  padding: 1px 6px;
  font-weight: 700;
}

.vinfo-desc-box {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  max-height: 75px;
  overflow-y: auto;
  word-break: break-word;
  white-space: pre-wrap;
}

.vinfo-empty {
  color: #64748b;
  font-style: italic;
}

.vinfo-word-list, .vinfo-pic-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 85px;
  overflow-y: auto;
}

.vinfo-word-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
}

.vinfo-word-text {
  font-family: var(--font-mono);
  font-weight: 700;
  color: #fca5a5;
}

.vinfo-tag-chip {
  font-family: var(--font-subheading);
  font-size: 9.5px;
  font-weight: 600;
  color: #f87171;
  background: rgba(239, 68, 68, 0.2);
  border-radius: 4px;
  padding: 1px 5px;
}

.vinfo-loc-chip {
  font-size: 9.5px;
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.15);
  border-radius: 4px;
  padding: 1px 5px;
}

.vinfo-pic-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.vinfo-pic-pill:hover {
  background: rgba(245, 158, 11, 0.25);
  border-color: #f59e0b;
  transform: translateY(-1px);
}

.vinfo-pic-name {
  font-weight: 700;
  color: #fbbf24;
}

.vinfo-mod-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
}

.vinfo-comment-bubble {
  background: rgba(30, 41, 59, 0.7);
  border-left: 3px solid #38bdf8;
  padding: 4px 8px;
  border-radius: 4px;
  color: #e2e8f0;
  font-size: 11.5px;
  line-height: 1.4;
  margin-top: 2px;
}

[data-theme="light"] .viewer-info-panel {
  background: rgba(241, 245, 249, 0.98);
  border-top-color: rgba(239, 68, 68, 0.25);
  border-bottom-color: rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .vinfo-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}
[data-theme="light"] .vinfo-card-header {
  color: #475569;
  border-bottom-color: #f1f5f9;
}
[data-theme="light"] .vinfo-desc-box {
  color: #334155;
}
[data-theme="light"] .vinfo-comment-bubble {
  background: #f8fafc;
  color: #1e293b;
}


/* ==========================================================
   IMAGE VIEWER LIGHTBOX - LIGHT THEME SUPPORT
   ========================================================== */
[data-theme="light"] .viewer-modal-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .viewer-header {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

[data-theme="light"] .viewer-title-info h3 {
  color: #0f172a;
}

[data-theme="light"] .viewer-meta {
  color: #64748b;
}

[data-theme="light"] .btn-viewer-ctrl {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #0f172a;
}

[data-theme="light"] .btn-viewer-ctrl:hover {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

[data-theme="light"] .viewer-stage {
  background: #f1f5f9;
}

[data-theme="light"] #viewerMainImg {
  border: 1px solid #cbd5e1;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .viewer-gallery-footer {
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

[data-theme="light"] .gallery-title {
  color: #475569;
}

[data-theme="light"] .viewer-thumb {
  background: #e2e8f0;
}

[data-theme="light"] .viewer-thumb-lbl {
  color: #64748b;
}

[data-theme="light"] .viewer-thumb-item.active .viewer-thumb-lbl {
  color: #0284c7;
}

[data-theme="light"] .viewer-modal-card .btn-close-modal {
  color: #64748b;
}

[data-theme="light"] .viewer-modal-card .btn-close-modal:hover {
  color: #0f172a;
}

/* ==========================================================
   TOAST NOTIFICATION
   ========================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast-msg {
  background: #0f172a;
  border: 1px solid #334155;
  border-left: 4px solid #10b981;
  color: #ffffff;
  padding: 11px 18px;
  border-radius: 8px;
  font-family: var(--font-subheading);
  font-size: 13px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  animation: slideToastIn 0.25s ease-out;
  display: flex;
  align-items: center;
  gap: 10px;
}

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

/* PROGRESS BAR FOR MONTHLY KPI */
.kpi-progress-container {
  width: 100%;
  max-width: 140px;
}

.kpi-progress-bar {
  width: 100%;
  height: 7px;
  background: var(--bg-surface-elevated);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 4px;
}

.kpi-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #10b981);
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* ==========================================================
   UID PROFILE MODAL (HISTORIC RECORD)
   ========================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 20px;
}

.profile-modal-card {
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.profile-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.2);
}

.profile-author-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-author-hammer {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.profile-author-text h3 {
  font-family: var(--font-heading);
  font-size: 20px;
  color: var(--text-main);
}

.profile-author-meta {
  font-family: var(--font-subheading);
  font-size: 13px;
  color: var(--text-secondary);
}

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

.btn-close-modal:hover {
  color: var(--text-main);
}

.profile-modal-body {
  padding: 24px 24px 70px 24px;
  overflow-y: auto;
  flex: 1;
}

.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.profile-stat-box {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 16px;
  text-align: center;
}

.profile-stat-val {
  font-family: var(--font-heading);
  font-size: 22px;
  color: var(--text-main);
}

.profile-stat-lbl {
  font-family: var(--font-subheading);
  font-size: 11.5px;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.profile-timeline-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.profile-map-item {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  gap: 16px;
}

.profile-map-cover {
  width: 140px;
  height: 95px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border-color);
}

.profile-map-info {
  flex: 1;
}

.profile-map-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.profile-map-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tag-badge {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 11px;
}

/* ==========================================================
   PERMISSIONS ADD MOD FORM
   ========================================================== */
.add-mod-box {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 18px 22px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.add-mod-box input[type="email"],
.add-mod-box input[type="number"] {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 13.5px;
  outline: none;
}

/* UTILITIES */
.hidden { display: none !important; }
.text-center { text-align: center; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ==========================================================
   MOBILE & RESPONSIVE TWEAKS (VERTICAL PHONE OPTIMIZATION)
   ========================================================== */
@media (max-width: 1024px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .sidebar-backdrop.active {
    display: block;
  }
  .mobile-topbar {
    display: flex;
  }
  .main-content {
    margin-left: 0;
    padding: 80px 16px 20px 16px;
  }
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .topbar-right {
    width: 100%;
  }
  .date-filter-wrap {
    flex: 1;
  }
  .profile-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .profile-map-item {
    flex-direction: column;
  }
  .profile-map-cover {
    width: 100%;
    height: 160px;
  }
}

/* ==========================================================
   SIDEBAR COLLAPSED MODE & 3D MICRO-ANIMATIONS
   ========================================================== */
.sidebar {
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s ease !important;
}

body.sidebar-collapsed .sidebar {
  width: 76px !important;
}

body.sidebar-collapsed .main-content {
  margin-left: 76px !important;
  width: calc(100vw - 76px) !important;
  max-width: calc(100vw - 76px) !important;
}

body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .nav-group-title,
body.sidebar-collapsed .nav-item span,
body.sidebar-collapsed .badge-pill,
body.sidebar-collapsed .lang-label,
body.sidebar-collapsed .lang-btn-group,
body.sidebar-collapsed .user-details {
  display: none !important;
}

body.sidebar-collapsed .sidebar-brand {
  justify-content: center;
  padding: 16px 8px;
  flex-direction: column;
  gap: 10px;
}

body.sidebar-collapsed .sidebar-brand-left {
  justify-content: center;
  flex: unset;
  width: 100%;
}

body.sidebar-collapsed .btn-sidebar-toggle {
  position: static;
  transform: none;
  width: 24px;
  height: 24px;
}

body.sidebar-collapsed .btn-sidebar-toggle svg {
  transform: rotate(180deg);
}

body.sidebar-collapsed .nav-item {
  justify-content: center;
  padding: 12px;
  position: relative;
}

body.sidebar-collapsed .nav-item svg {
  width: 20px;
  height: 20px;
}

body.sidebar-collapsed .lang-switch-box {
  background: transparent;
  border: none;
  padding: 0;
  margin-bottom: 12px;
  justify-content: center;
  box-shadow: none;
}

body.sidebar-collapsed .btn-lang-compact {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 32px;
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  color: #ffffff;
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 8px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

body.sidebar-collapsed .btn-lang-compact:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.5);
  filter: brightness(1.15);
}

body.sidebar-collapsed .user-profile.gaming-card {
  padding: 4px;
  justify-content: center;
  background: transparent;
  border: none;
  box-shadow: none;
}

body.sidebar-collapsed .user-profile.gaming-card::before {
  display: none;
}

body.sidebar-collapsed .sidebar-actions {
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* 3D MICRO-ANIMATIONS FOR ALL BUTTONS & ICONS */
.nav-item,
.btn-action,
.btn-run-project,
.btn-table-action,
.btn-uid-copy,
.btn-viewer-ctrl {
  transform-style: preserve-3d;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.22s ease, background-color 0.2s ease, border-color 0.2s ease !important;
}

.nav-item:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.nav-item.active {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--primary-glow), inset 0 1px 1px rgba(255, 255, 255, 0.3) !important;
}

.nav-item:hover svg {
  transform: scale(1.18) rotate(-4deg);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 2px 6px rgba(56, 189, 248, 0.6));
}

.btn-action:hover,
.btn-run-project:hover,
.btn-table-action:hover,
.btn-uid-copy:hover {
  transform: translateY(-2px) scale(1.025);
}

.btn-action:active,
.btn-run-project:active,
.btn-table-action:active,
.btn-uid-copy:active {
  transform: translateY(1px) scale(0.98);
}

/* MOD ONLINE / OFFLINE STATUS BADGE */
.mod-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 8px;
  vertical-align: middle;
}

.mod-status-badge.online {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.mod-status-badge.offline {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.status-dot-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: statusPulse 1.8s infinite ease-in-out;
}

@keyframes statusPulse {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.25); opacity: 1; box-shadow: 0 0 12px #10b981; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.status-dot-dim {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #64748b;
}

/* BẢNG VI PHẠM UID */
.badge-pill.warn {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.table-count-badge {
  font-family: var(--font-subheading);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.violator-rank-badge {
  font-family: var(--font-heading);
  font-size: 14.5px;
  color: #f87171;
  display: inline-flex;
  align-items: center;
  font-weight: 800;
}

.violator-rank-badge.top-violator {
  background: transparent;
  padding: 0;
  border-radius: 0;
  border: none;
}

.violator-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--font-subheading);
  font-size: 11.5px;
  white-space: nowrap;
  max-width: 145px;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
}

[data-theme="light"] .violator-tag-pill {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

/* MODAL OPEN BODY SCROLL LOCK & ENHANCED SCROLLBAR */
body.modal-open {
  overflow: hidden !important;
}

.modal-overlay {
  overscroll-behavior: contain;
}

.profile-modal-card {
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

.profile-modal-body {
  overflow-y: auto !important;
  max-height: calc(88vh - 75px);
  overscroll-behavior: contain !important;
  scrollbar-width: thin;
  scrollbar-color: #0284c7 rgba(15, 23, 42, 0.4);
  padding-right: 12px;
}

.profile-modal-body::-webkit-scrollbar {
  width: 8px;
}

.profile-modal-body::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.4);
  border-radius: 4px;
}

.profile-modal-body::-webkit-scrollbar-thumb {
  background: #0284c7;
  border-radius: 4px;
}

.profile-modal-body::-webkit-scrollbar-thumb:hover {
  background: #38bdf8;
}

[data-theme="light"] .profile-modal-body::-webkit-scrollbar-track {
  background: rgba(226, 232, 240, 0.8);
}

[data-theme="light"] .profile-modal-body::-webkit-scrollbar-thumb {
  background: #0284c7;
}

/* LIGHT MODE BACKDROP CHO MODAL */
[data-theme="light"] .modal-overlay {
  background: rgba(15, 23, 42, 0.45);
}

/* ĐẢM BẢO KHÔNG CÓ NÚT HÀNG DƯỚI ĐÈ LÊN DROPDOWN MENU */
.data-table tbody tr.dropdown-open > td,
.data-table tbody tr:has(.run-menu:not(.hidden)) > td,
.profile-modal-body tr.dropdown-open > td,
.profile-modal-body tr:has(.run-menu:not(.hidden)) > td {
  position: relative !important;
  z-index: 999999 !important;
}

/* ==========================================
   HAMMER TEXT ONLY (không icon)
   ========================================== */
.hammer-text-only {
  display: inline-block;
  font-family: var(--font-subheading);
  font-size: 13px;
  font-weight: 700;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 6px;
  padding: 3px 9px;
  white-space: nowrap;
  letter-spacing: 0.5px;
}

/* ==========================================
   VIOLATION DETAIL: IMAGES & TEXTS
   ========================================== */
.vio-section {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vio-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.vio-img-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vio-img-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.vio-img-thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid rgba(239, 68, 68, 0.4);
  transition: border-color 0.2s, transform 0.2s;
  background: var(--bg-surface-elevated);
}

.vio-img-thumb:hover {
  border-color: #ef4444;
  transform: scale(1.06);
}

.vio-word-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.vio-word-item {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.vio-word-text {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: 4px;
  padding: 2px 8px;
}

/* ==========================================================
   3D TIER ICONS & BADGES WITH ADVANCED ANIMATIONS
   ========================================================== */
@keyframes tierFloat3D {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-3px) rotate(1.2deg);
  }
}

@keyframes tierGoldShine {
  0% {
    filter: drop-shadow(0 2px 7px rgba(245, 158, 11, 0.45)) brightness(1);
  }
  50% {
    filter: drop-shadow(0 4px 14px rgba(245, 158, 11, 0.85)) brightness(1.25);
  }
  100% {
    filter: drop-shadow(0 2px 7px rgba(245, 158, 11, 0.45)) brightness(1);
  }
}

@keyframes tierCyanPulse {
  0%, 100% {
    filter: drop-shadow(0 2px 7px rgba(56, 189, 248, 0.45)) brightness(1);
  }
  50% {
    filter: drop-shadow(0 4px 14px rgba(56, 189, 248, 0.85)) brightness(1.22);
  }
}

@keyframes tierShieldGlow {
  0%, 100% {
    filter: drop-shadow(0 2px 7px rgba(99, 102, 241, 0.4)) brightness(1);
  }
  50% {
    filter: drop-shadow(0 4px 14px rgba(99, 102, 241, 0.8)) brightness(1.2);
  }
}

.tier-3d-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: 9px;
  font-family: var(--font-subheading);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.4px;
  white-space: nowrap;
  position: relative;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.tier-3d-badge:hover {
  transform: translateY(-2px) scale(1.04);
}

.tier-3d-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

/* TIER 1 - GOLDEN IMPERIAL CROWN 3D */
.tier-3d-gold {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.22) 0%, rgba(180, 83, 9, 0.32) 100%);
  border: 1.5px solid rgba(245, 158, 11, 0.6);
  color: #fbbf24;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.2);
}
.tier-3d-gold .tier-3d-icon-wrap {
  animation: tierFloat3D 3s ease-in-out infinite, tierGoldShine 2.5s ease-in-out infinite;
}

/* MASTER ADMIN BADGE 3D */
.tier-3d-master {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.25) 0%, rgba(245, 158, 11, 0.35) 100%);
  border: 1.5px solid rgba(251, 191, 36, 0.75);
  color: #fef08a;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.35), inset 0 1px 2px rgba(255, 255, 255, 0.3);
}
.tier-3d-master .tier-3d-icon-wrap {
  animation: tierFloat3D 2.6s ease-in-out infinite, tierGoldShine 2s ease-in-out infinite;
}

/* TIER 2 - CRYSTAL PRISM STAR 3D */
.tier-3d-cyan {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2) 0%, rgba(2, 132, 199, 0.3) 100%);
  border: 1.5px solid rgba(56, 189, 248, 0.6);
  color: #38bdf8;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.2);
}
.tier-3d-cyan .tier-3d-icon-wrap {
  animation: tierFloat3D 3.5s ease-in-out infinite, tierCyanPulse 2.8s ease-in-out infinite;
}

/* TIER 3 - TITANIUM AEGIS SHIELD 3D */
.tier-3d-titanium {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18) 0%, rgba(71, 85, 105, 0.32) 100%);
  border: 1.5px solid rgba(148, 163, 184, 0.5);
  color: #cbd5e1;
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.15);
}
.tier-3d-titanium .tier-3d-icon-wrap {
  animation: tierFloat3D 3.8s ease-in-out infinite, tierShieldGlow 3s ease-in-out infinite;
}

/* ==========================================================
   TIER BADGES LIGHT THEME (HIGH CONTRAST & CRYSTAL SHARP)
   ========================================================== */
[data-theme="light"] .tier-3d-badge {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .tier-3d-gold {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1.5px solid #d97706;
  color: #92400e;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.18);
}

[data-theme="light"] .tier-3d-master {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border: 1.5px solid #ea580c;
  color: #9a3412;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.2);
}

[data-theme="light"] .tier-3d-cyan {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1.5px solid #0284c7;
  color: #0369a1;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.18);
}

[data-theme="light"] .tier-3d-titanium {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1.5px solid #64748b;
  color: #1e293b;
  box-shadow: 0 2px 6px rgba(100, 116, 139, 0.18);
}

/* ==========================================================
   CUSTOM TIER DROPDOWN SELECT (ĐỒNG BỘ 100% 3D ICONS)
   ========================================================== */
.custom-tier-select {
  position: relative;
  display: inline-block;
}

.tier-select-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 3px 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tier-select-trigger:hover {
  border-color: var(--primary);
  background: var(--bg-surface);
}

.tier-chevron {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 2px;
  transition: transform 0.2s ease;
}

.custom-tier-select.open .tier-chevron {
  transform: rotate(180deg);
}

/* Permissions & System Logs Tables Custom Layout */
#tabPermissions .table-responsive,
#tabSystemLogs .table-responsive {
  overflow-x: auto !important;
  max-width: 100% !important;
}

#tabPermissions .table-responsive::-webkit-scrollbar,
#tabSystemLogs .table-responsive::-webkit-scrollbar {
  height: 6px !important;
}

#tabPermissions .table-responsive::-webkit-scrollbar-thumb,
#tabSystemLogs .table-responsive::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.4);
  border-radius: 4px;
}

#permissionsTable,
#loginLogsTable,
#actionLogsTable {
  min-width: 980px !important;
  width: 100% !important;
  table-layout: auto !important;
}

#permissionsTable th,
#permissionsTable td,
#loginLogsTable th,
#loginLogsTable td,
#actionLogsTable th,
#actionLogsTable td {
  overflow: visible !important;
  vertical-align: middle;
  padding: 10px 12px !important;
  white-space: nowrap !important;
}

.mod-email-cell-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  vertical-align: middle;
}

.mod-email-text {
  color: var(--text-main);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.custom-tier-select {
  position: relative;
  display: inline-block;
}

.tier-select-dropdown {
  position: fixed !important;
  z-index: 2147483647 !important;
  min-width: 180px;
  width: max-content;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85);
  padding: 8px 10px;
  display: none;
  box-sizing: border-box;
}

[data-theme="light"] .tier-select-dropdown {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.25);
}

.tier-select-option {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
  width: 100%;
  box-sizing: border-box;
}

.tier-select-option:hover {
  background: rgba(56, 189, 248, 0.12);
}

[data-theme="light"] .tier-select-option:hover {
  background: #f1f5f9;
}

/* ==========================================================
   EXPANDABLE VIOLATION TAGS (ĐỒNG BỘ CHIỀU CAO HÀNG, CÓ NÚT MỞ RỘNG)
   ========================================================== */
#uidViolationsTableBody tr td {
  vertical-align: middle;
  padding: 11px 14px;
}

.vio-tags-cell-wrapper {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.vio-tags-primary-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.vio-tags-expanded-row {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px dashed var(--border-color);
}

.vio-tags-cell-wrapper.expanded .vio-tags-expanded-row {
  display: flex;
}

.vio-tags-cell-wrapper.expanded .toggle-icon {
  transform: rotate(180deg);
}

.btn-toggle-row-tags {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: 5px;
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 10px;
  transition: all 0.2s ease;
  flex-shrink: 0 !important;
}

.btn-toggle-row-tags:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  transform: translateY(-1px);
}

.toggle-icon {
  display: inline-block;
  transition: transform 0.2s ease;
  line-height: 1;
}

/* ==========================================================
   LEADERBOARD REVIEWER CELL (SINGLE HORIZONTAL ROW, NO WRAP)
   ========================================================== */
.reviewer-cell-unified {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  vertical-align: middle;
}

.reviewer-tier-3d {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.reviewer-email-text {
  color: var(--text-main);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1;
}

.reviewer-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  flex-shrink: 0 !important;
  white-space: nowrap !important;
  user-select: none;
}

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

.reviewer-status-badge.offline {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

[data-theme="light"] .reviewer-status-badge.online {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

[data-theme="light"] .reviewer-status-badge.offline {
  background: rgba(100, 116, 139, 0.1);
  color: #475569;
  border: 1px solid rgba(100, 116, 139, 0.3);
}

.reviewer-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.reviewer-status-badge.online .reviewer-status-dot {
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.reviewer-status-badge.offline .reviewer-status-dot {
  background: #94a3b8;
}

[data-theme="light"] .reviewer-status-badge.online .reviewer-status-dot {
  background: #059669;
  box-shadow: 0 0 6px rgba(5, 150, 105, 0.6);
}

[data-theme="light"] .reviewer-status-badge.offline .reviewer-status-dot {
  background: #64748b;
}

/* ==========================================================
   NOTICE MODALS (ACCESS DENIED & PERMISSION REQUIRED)
   ========================================================== */
@keyframes pulseNotice {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.notice-modal-card {
  width: 90%;
  max-width: 480px;
  background: #0f172a;
  border-radius: 20px;
  padding: 34px 28px;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.notice-modal-card.alert-danger-card {
  border: 1.5px solid rgba(239, 68, 68, 0.5);
  background: radial-gradient(circle at 50% 0%, rgba(239, 68, 68, 0.18), rgba(15, 23, 42, 0.98));
}

.notice-modal-card.alert-warning-card {
  border: 1.5px solid rgba(245, 158, 11, 0.5);
  background: radial-gradient(circle at 50% 0%, rgba(245, 158, 11, 0.18), rgba(15, 23, 42, 0.98));
}

.notice-modal-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: pulseNotice 2.5s infinite ease-in-out;
}

.notice-modal-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  letter-spacing: 0.3px;
}

.notice-modal-desc {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}

.notice-modal-actions {
  width: 100%;
  margin-top: 10px;
}

/* ==========================================================
   SYSTEM LOGS SUBNAV & PANES
   ========================================================== */
.logs-subnav {
  display: flex;
  gap: 10px;
  padding: 14px 22px;
  background: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid var(--border-color);
}

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

.btn-subnav:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border-color: #64748b;
}

.btn-subnav.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #38bdf8;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.25);
}

.badge-subnav {
  font-family: var(--font-mono);
  font-size: 11px;
  background: rgba(255, 255, 255, 0.1);
  color: inherit;
  padding: 1px 7px;
  border-radius: 999px;
}

.subtab-pane {
  display: none;
  padding: 18px 22px;
}

.subtab-pane.active {
  display: block;
}

[data-theme="light"] .notice-modal-card {
  background: #ffffff;
}
[data-theme="light"] .notice-modal-card.alert-danger-card {
  background: radial-gradient(circle at 50% 0%, rgba(239, 68, 68, 0.1), #ffffff);
}
[data-theme="light"] .notice-modal-card.alert-warning-card {
  background: radial-gradient(circle at 50% 0%, rgba(245, 158, 11, 0.1), #ffffff);
}
[data-theme="light"] .notice-modal-title {
  color: #0f172a;
}
[data-theme="light"] .notice-modal-desc {
  color: #475569;
}
[data-theme="light"] .logs-subnav {
  background: #f8fafc;
}

/* ==========================================================
   AUTO-DETECTION & ENHANCED ADAPTATION FOR PORTRAIT / VERTICAL SCREENS
   (Màn hình phụ dạng dọc PC/Laptop & Thiết bị đứng)
   ========================================================== */
@media screen and (orientation: portrait), body.is-portrait-layout {
  /* Tối ưu không gian hiển thị trên màn hình dọc */
  .main-content {
    padding-left: clamp(12px, 2.5vw, 20px) !important;
    padding-right: clamp(12px, 2.5vw, 20px) !important;
    max-width: 100vw !important;
  }

  /* Header & Filter bar tự động co giãn không bị tràn */
  .topbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 14px !important;
    margin-bottom: 20px !important;
  }

  .topbar-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .topbar-left h2 {
    font-size: 21px !important;
    line-height: 1.3 !important;
    white-space: normal !important;
  }

  .topbar-right {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
    flex-wrap: wrap !important;
  }

  .date-filter-wrap {
    flex: 1 !important;
    min-width: 150px !important;
  }

  /* Thẻ KPI dạng 2 cột cân đối, hiển thị gọn đẹp */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }

  .kpi-card {
    padding: 14px 16px !important;
  }

  .kpi-value {
    font-size: 24px !important;
  }

  /* Biểu đồ trong màn hình dọc hiển thị 1 cột với chiều cao vừa phải */
  .charts-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .chart-wrapper {
    height: 270px !important;
    max-height: 270px !important;
  }

  /* Thẻ Add Mod trong Tab Phân Quyền: Cấu trúc Grid 2 cột vuông vức */
  .add-mod-box {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    padding: 16px 18px !important;
    border-radius: 12px !important;
  }

  .add-mod-box input[type="email"] {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .add-mod-box select {
    grid-column: 1 / 2 !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .add-mod-box input[type="number"] {
    grid-column: 2 / 3 !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .add-mod-box label {
    grid-column: 1 / 2 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 0 !important;
    font-size: 13px !important;
    cursor: pointer !important;
    user-select: none !important;
  }

  .add-mod-box button {
    grid-column: 2 / 3 !important;
    width: 100% !important;
    justify-content: center !important;
    padding: 9px 14px !important;
    font-weight: 700 !important;
  }

  /* Bảng phân quyền & bảng số liệu: Tối ưu độ rộng cột */
  #permissionsTable {
    min-width: 740px !important;
  }

  #permissionsTable th#thModEmail {
    width: 200px !important;
    min-width: 190px !important;
  }

  #permissionsTable th#thModRole {
    width: 120px !important;
    min-width: 110px !important;
  }

  #permissionsTable th#thModKpi {
    width: 90px !important;
    min-width: 85px !important;
  }

  #permissionsTable th#thHideKpi {
    width: 85px !important;
    min-width: 80px !important;
    text-align: center !important;
  }

  #permissionsTable th#thViewAll {
    width: 110px !important;
    min-width: 100px !important;
    text-align: center !important;
  }

  #permissionsTable th#thViewLogs {
    width: 95px !important;
    min-width: 85px !important;
    text-align: center !important;
  }

  #permissionsTable th#thActionsPerm {
    width: 70px !important;
    min-width: 65px !important;
    text-align: center !important;
  }

  .mod-email-cell-wrapper {
    max-width: 190px !important;
  }

  .mod-email-text {
    max-width: 130px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: inline-block !important;
    font-size: 13px !important;
  }

  .mod-kpi-input {
    width: 75px !important;
    padding: 5px 6px !important;
    text-align: center !important;
    font-size: 13px !important;
  }

  /* Cố định cột đầu tiên & cột thứ 2 (Sticky Columns) khi cuộn bảng ngang */
  #permissionsTable th:first-child,
  #permissionsTable td:first-child,
  #auditLogsTable th:first-child,
  #auditLogsTable td:first-child,
  #coverLogsTable th:first-child,
  #coverLogsTable td:first-child,
  #loginLogsTable th:first-child,
  #loginLogsTable td:first-child,
  #actionLogsTable th:first-child,
  #actionLogsTable td:first-child,
  #teamLeaderboardTable th:first-child,
  #teamLeaderboardTable td:first-child,
  #uidViolationsTable th:first-child,
  #uidViolationsTable td:first-child {
    position: sticky !important;
    left: 0 !important;
    z-index: 8 !important;
    background: #0b1120 !important;
  }

  /* Cố định cột thứ 2 (Mod / UID) với đổ bóng ngăn tràn dữ liệu */
  #teamLeaderboardTable th:nth-child(2),
  #teamLeaderboardTable td:nth-child(2) {
    position: sticky !important;
    left: 55px !important;
    z-index: 8 !important;
    background: #0b1120 !important;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.4) !important;
  }

  #uidViolationsTable th:nth-child(2),
  #uidViolationsTable td:nth-child(2) {
    position: sticky !important;
    left: 55px !important;
    z-index: 8 !important;
    background: #0b1120 !important;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.4) !important;
  }

  #permissionsTable th:first-child,
  #permissionsTable td:first-child {
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.4) !important;
  }

  #permissionsTable thead th:first-child,
  #auditLogsTable thead th:first-child,
  #coverLogsTable thead th:first-child,
  #loginLogsTable thead th:first-child,
  #actionLogsTable thead th:first-child,
  #teamLeaderboardTable thead th:first-child,
  #teamLeaderboardTable thead th:nth-child(2),
  #uidViolationsTable thead th:first-child,
  #uidViolationsTable thead th:nth-child(2) {
    z-index: 9 !important;
    background: #0f172a !important;
  }

  [data-theme="light"] #permissionsTable th:first-child,
  [data-theme="light"] #permissionsTable td:first-child,
  [data-theme="light"] #auditLogsTable th:first-child,
  [data-theme="light"] #auditLogsTable td:first-child,
  [data-theme="light"] #coverLogsTable th:first-child,
  [data-theme="light"] #coverLogsTable td:first-child,
  [data-theme="light"] #loginLogsTable th:first-child,
  [data-theme="light"] #loginLogsTable td:first-child,
  [data-theme="light"] #actionLogsTable th:first-child,
  [data-theme="light"] #actionLogsTable td:first-child,
  [data-theme="light"] #teamLeaderboardTable th:first-child,
  [data-theme="light"] #teamLeaderboardTable td:first-child,
  [data-theme="light"] #teamLeaderboardTable th:nth-child(2),
  [data-theme="light"] #teamLeaderboardTable td:nth-child(2),
  [data-theme="light"] #uidViolationsTable th:first-child,
  [data-theme="light"] #uidViolationsTable td:first-child,
  [data-theme="light"] #uidViolationsTable th:nth-child(2),
  [data-theme="light"] #uidViolationsTable td:nth-child(2) {
    background: #ffffff !important;
    box-shadow: 3px 0 8px rgba(0, 0, 0, 0.08) !important;
  }

  [data-theme="light"] #permissionsTable thead th:first-child,
  [data-theme="light"] #auditLogsTable thead th:first-child,
  [data-theme="light"] #coverLogsTable thead th:first-child,
  [data-theme="light"] #loginLogsTable thead th:first-child,
  [data-theme="light"] #actionLogsTable thead th:first-child,
  [data-theme="light"] #teamLeaderboardTable thead th:first-child,
  [data-theme="light"] #teamLeaderboardTable thead th:nth-child(2),
  [data-theme="light"] #uidViolationsTable thead th:first-child,
  [data-theme="light"] #uidViolationsTable thead th:nth-child(2) {
    background: #f8fafc !important;
  }

  /* Đảm bảo mép phải bảng có khoảng cách an toàn, không bị thanh cuộn đè lên */
  #uidViolationsTable th:last-child,
  #uidViolationsTable td:last-child,
  #teamLeaderboardTable th:last-child,
  #teamLeaderboardTable td:last-child,
  .data-table th:last-child,
  .data-table td:last-child {
    padding-right: 22px !important;
  }

  /* Padding và căn chỉnh các cột gọn gàng hơn */
  #permissionsTable th,
  #permissionsTable td,
  #loginLogsTable th,
  #loginLogsTable td,
  #actionLogsTable th,
  #actionLogsTable td,
  #teamLeaderboardTable th,
  #teamLeaderboardTable td,
  #uidViolationsTable th,
  #uidViolationsTable td {
    padding: 8px 10px !important;
  }

  /* Nâng các nút thanh bên tránh góc bo màn hình */
  .sidebar-footer {
    padding-bottom: max(28px, env(safe-area-inset-bottom, 28px)) !important;
  }
  .sidebar-actions {
    margin-bottom: 6px !important;
    gap: 14px !important;
  }
  .sidebar-actions .btn-icon {
    width: 42px !important;
    height: 42px !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border-radius: 10px !important;
  }
}

/* ==========================================================
   MOBILE PHONES RESPONSIVE SYSTEM (Smartphones <= 768px)
   (Tối ưu giao diện chuyên nghiệp, mượt mà cho điện thoại)
   ========================================================== */
@media screen and (max-width: 768px) {
  /* Khung nội dung chính trên điện thoại */
  .main-content {
    padding: 68px 10px 24px 10px !important;
    margin-left: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  /* Topbar di động cố định phía trên */
  .mobile-topbar {
    height: 54px !important;
    padding: 0 14px !important;
    background: rgba(11, 17, 32, 0.94) !important;
    backdrop-filter: blur(12px) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    z-index: 100 !important;
  }

  [data-theme="light"] .mobile-topbar {
    background: rgba(255, 255, 255, 0.94) !important;
    border-bottom-color: rgba(0, 0, 0, 0.08) !important;
  }

  /* Tiêu đề trang nhỏ gọn, không gãy chữ */
  .topbar-left h2 {
    font-size: 17px !important;
    letter-spacing: 0.2px !important;
  }

  .sync-status {
    font-size: 11.5px !important;
  }

  /* Bộ lọc đầu trang trên điện thoại: Tinh chỉnh icon và khoảng cách */
  .topbar-right {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    width: 100% !important;
  }

  .date-filter-wrap {
    flex: 1 !important;
    min-width: 0 !important;
    padding: 6px 10px !important;
    font-size: 12px !important;
  }

  .date-filter-wrap select {
    font-size: 12px !important;
    max-width: 100% !important;
  }

  #exportExcelBtn {
    padding: 6px 10px !important;
    font-size: 12px !important;
    flex-shrink: 0 !important;
  }

  #exportExcelBtn span {
    display: none !important; /* Ẩn chữ 'Xuất Excel', chỉ hiện icon trên mobile */
  }

  #manualRefreshBtn {
    padding: 6px 8px !important;
    flex-shrink: 0 !important;
  }

  /* Bộ lọc bảng (Table Controls) sắp xếp dạng lưới 2 cột ngay ngắn */
  .table-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding: 14px 14px !important;
  }

  .table-controls {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .table-controls select {
    width: 100% !important;
    padding: 6px 8px !important;
    font-size: 12px !important;
  }

  .search-input-wrap {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    padding: 6px 10px !important;
  }

  .search-input-wrap input {
    width: 100% !important;
    font-size: 12.5px !important;
  }

  /* Form thêm mod trên màn hình hẹp: 1 cột xếp chồng thoải mái bấm nút */
  .add-mod-box {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    padding: 14px 14px !important;
  }

  .add-mod-box select,
  .add-mod-box input[type="number"],
  .add-mod-box label,
  .add-mod-box button {
    grid-column: 1 / -1 !important;
    width: 100% !important;
  }

  .add-mod-box button {
    height: 40px !important;
    font-size: 13px !important;
  }

  /* Bảng thẻ thông tin (Table Card) có viền bo gọn gàng */
  .table-card {
    border-radius: 12px !important;
    margin-bottom: 16px !important;
  }

  /* Thẻ ghi chú phân cấp quyền: Giảm padding chữ dễ đọc */
  .role-guide-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .role-guide-item {
    padding: 10px 12px !important;
    font-size: 11.5px !important;
  }

  /* Thanh tab chuyển đổi lịch sử nhật ký (Subnav) */
  .logs-subnav {
    display: flex !important;
    gap: 6px !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 8px 12px !important;
  }

  .btn-subnav {
    padding: 6px 12px !important;
    font-size: 12px !important;
    white-space: nowrap !important;
  }

  /* Modal chi tiết (Viewer & Profile): Vừa vặn màn hình điện thoại */
  .viewer-modal-card {
    width: 95vw !important;
    max-width: 95vw !important;
    max-height: 92vh !important;
    border-radius: 14px !important;
  }

  .viewer-header {
    padding: 10px 14px !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }

  .viewer-controls {
    width: 100% !important;
    justify-content: space-between !important;
  }

  .profile-modal-card {
    width: 95vw !important;
    max-width: 95vw !important;
    max-height: 90vh !important;
    border-radius: 14px !important;
    padding: 16px !important;
  }

  .notice-modal-card {
    width: 92vw !important;
    max-width: 420px !important;
    padding: 20px 16px !important;
    border-radius: 14px !important;
  }

  /* Nút thao tác trong modal trên điện thoại */
  .modal-actions {
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .modal-actions button {
    width: 100% !important;
    height: 42px !important;
  }

  /* Nâng 4 nút thanh bên tránh góc bo màn hình điện thoại & thanh vuốt đáy */
  .sidebar-footer {
    padding-bottom: max(32px, env(safe-area-inset-bottom, 32px)) !important;
  }
  .sidebar-actions {
    margin-bottom: 8px !important;
    gap: 16px !important;
  }
  .sidebar-actions .btn-icon {
    width: 44px !important;
    height: 44px !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border-radius: 12px !important;
  }

  /* Kích hoạt vuốt cảm ứng đa chiều 4 hướng mượt mà cho bảng */
  .table-responsive {
    position: relative !important;
    overflow-x: auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-x pan-y !important;
  }
}

/* ==========================================================================
   THANH PHÂN TRANG BẢNG NHẬT KÝ (TABLE PAGINATION)
   ========================================================================== */
.table-pagination-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 18px;
  background: var(--bg-surface, #1e293b);
  border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}

.pagination-info {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted, #94a3b8);
  font-family: var(--font-subheading, inherit);
  font-weight: 500;
}

.pagination-size-select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pagination-size-select {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
  color: var(--text-main, #f8fafc);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
}

.pagination-size-select:hover,
.pagination-size-select:focus {
  border-color: #38bdf8;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  color: var(--text-main, #f8fafc);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.pagination-btn:hover:not(:disabled) {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #38bdf8;
}

.pagination-btn:active:not(:disabled) {
  transform: scale(0.96);
}

.pagination-btn.active {
  background: #0284c7 !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.45);
}

.pagination-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 32px;
  color: var(--text-muted, #94a3b8);
  font-weight: 700;
  font-size: 14px;
}

[data-theme="light"] .table-pagination-container {
  background: #f8fafc;
  border-top-color: #e2e8f0;
}

[data-theme="light"] .pagination-size-select {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #1e293b;
}

[data-theme="light"] .pagination-btn {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #334155;
}

[data-theme="light"] .pagination-btn.active {
  background: #0284c7 !important;
  border-color: #0284c7 !important;
  color: #ffffff !important;
}

/* NÚT NHỊP ĐỘ HOẠT ĐỘNG MOD (PROFESSIONAL VECTOR ICON & GLASSMORPHISM) */
.btn-rhythm-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: #3b82f6;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.btn-rhythm-action:hover {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(59, 130, 246, 0.35);
}

.btn-rhythm-action svg {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.btn-rhythm-action:hover svg {
  transform: scale(1.1);
}

[data-theme="light"] .btn-rhythm-action {
  background: rgba(2, 132, 199, 0.08);
  border-color: rgba(2, 132, 199, 0.3);
  color: #0284c7;
}

[data-theme="light"] .btn-rhythm-action:hover {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
}

/* POPOVER CHỌN KHOẢNG NGÀY TRƯỢT XUỐNG (SLIDE-DOWN POPOVER) */
.custom-date-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 320px;
  background: var(--bg-card, #1e293b);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
  border-radius: 14px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45), 0 4px 12px rgba(0, 0, 0, 0.25);
  padding: 14px 16px;
  z-index: 9999;
  transform-origin: top right;
  animation: popoverSlideDown 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(12px);
}

@keyframes popoverSlideDown {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

.popover-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main, #ffffff);
}

.popover-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted, #94a3b8);
  font-size: 16px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  transition: all 0.2s;
}

.popover-close-btn:hover {
  color: var(--text-main, #ffffff);
  background: rgba(255, 255, 255, 0.08);
}

.popover-body {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.popover-date-field {
  flex: 1;
}

.popover-date-field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted, #94a3b8);
  margin-bottom: 4px;
}

.popover-date-input {
  width: 100%;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.15));
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-main, #ffffff);
  font-size: 12px;
  outline: none;
  transition: border-color 0.2s;
}

.popover-date-input:focus {
  border-color: var(--primary, #3b82f6);
}

.popover-arrow-divider {
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
  margin-top: 14px;
}

.popover-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.popover-btn-secondary {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.15));
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted, #cbd5e1);
  cursor: pointer;
  transition: all 0.2s;
}

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

.popover-btn-primary {
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  background: var(--primary, #3b82f6);
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s;
}

.popover-btn-primary:hover {
  background: #2563eb;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

[data-theme="light"] .custom-date-popover {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .popover-date-input {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

/* ==========================================================
   FLOATING EMAIL TOOLTIP (HOVER XEM TRỌN VẸN GMAIL)
   ========================================================== */
.reviewer-cell-unified {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  width: 100% !important;
  white-space: nowrap;
}

.reviewer-email-text {
  max-width: 125px;
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

#teamLeaderboardTable td:nth-child(2),
#permissionsTable td:first-child {
  overflow: visible !important;
}

#teamLeaderboardTable tr:hover,
#permissionsTable tr:hover {
  position: relative;
  z-index: 100 !important;
}

#teamLeaderboardTable tr:hover td:nth-child(2),
#permissionsTable tr:hover td:first-child {
  z-index: 999999 !important;
  overflow: visible !important;
}

.email-tooltip-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  cursor: default;
}

.email-tooltip-wrap:hover {
  z-index: 999999 !important;
}

.email-tooltip-box {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  background: #090d16;
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 8px;
  padding: 6px 12px;
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  z-index: 99999;
}

.email-tooltip-box::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 18px;
  border-width: 5px;
  border-style: solid;
  border-color: #090d16 transparent transparent transparent;
}

.email-tooltip-wrap:hover .email-tooltip-box {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

[data-theme="light"] .email-tooltip-box {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid rgba(0, 0, 0, 0.15);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .email-tooltip-box::after {
  border-color: #ffffff transparent transparent transparent;
}

/* ==========================================================
   SMART HORIZONTAL SCROLL HINT (CHỈ BÁO CUỘN NGANG)
   ========================================================== */
.table-scroll-wrapper {
  position: relative;
  width: 100%;
}

.scroll-hint-pill {
  position: absolute;
  top: 10px;
  right: 18px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(59, 130, 246, 0.45);
  border-radius: 20px;
  color: #93c5fd;
  font-size: 11.5px;
  font-weight: 700;
  pointer-events: none;
  user-select: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

[data-theme="light"] .scroll-hint-pill {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #1d4ed8;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .scroll-hint-arrow {
  color: #2563eb;
}

@keyframes scrollHintPulseArrow {
  0%, 100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(5px);
  }
}

.scroll-hint-arrow {
  animation: scrollHintPulseArrow 1.2s infinite ease-in-out;
  color: #38bdf8;
}

.scroll-hint-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translateY(-6px);
}

/* KPI Target Badge Button (Click to Open Edit Modal) */
.btn-kpi-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-kpi-badge:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: #38bdf8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.2);
}

[data-theme="light"] .btn-kpi-badge {
  background: #f0f9ff;
  border-color: #bae6fd;
}

[data-theme="light"] .btn-kpi-badge:hover {
  background: #e0f2fe;
  border-color: #38bdf8;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.15);
}



/* ==========================================
   NÂNG CẤP UI TỐI ƯU QUOTA & QUẢN TRỊ (2026)
   ========================================== */
.search-with-cloud-btn {
  padding-right: 4px !important;
}
.btn-cloud-search {
  background: rgba(56, 189, 248, 0.14);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 6px;
  padding: 4px 9px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  margin-left: 4px;
}
.btn-cloud-search:hover:not(:disabled) {
  background: rgba(56, 189, 248, 0.26);
  transform: translateY(-1px);
}
.btn-cloud-search:disabled {
  opacity: 0.6;
  cursor: wait;
}

.pagination-right-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.btn-load-more {
  background: rgba(59, 130, 246, 0.14);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-load-more:hover:not(:disabled) {
  background: rgba(59, 130, 246, 0.25);
}
.btn-load-more:disabled {
  opacity: 0.55;
  cursor: wait;
}

.fs-read-monitor-pill {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 6px 10px;
  margin-bottom: 8px;
  border-radius: 8px;
  border: 1px solid rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
  font-size: 11.5px;
  font-family: var(--font-mono);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.fs-read-monitor-pill:hover {
  background: rgba(16, 185, 129, 0.2);
}
.fs-read-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  flex-shrink: 0;
}
body.sidebar-collapsed .fs-read-monitor-pill {
  padding: 6px 4px;
  font-size: 10px;
}

.btn-resume-sync {
  margin-left: 8px;
  padding: 2px 9px;
  border-radius: 6px;
  border: 1px solid rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}
.btn-resume-sync:hover {
  background: rgba(245, 158, 11, 0.28);
}

.read-breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.08);
}

/* ==========================================================================
   MASTER UPGRADE V2026.12 — EXECUTIVE LOGIN, SIDEBAR, READ MONITOR,
   HIDDEN SCROLLBARS, DRAG-SCROLL, LIGHT/DARK POLISH & CLICKABLE DETAILS
   ========================================================================== */

/* 1. EXECUTIVE LOGIN SCREEN V6 (STYLE A: MIDNIGHT NAVY & BRUSHED GOLD) */
:root,
[data-theme="dark"] {
  --auth-bg: #090f1e;
  --auth-card: #111c33;
  --auth-card-border: rgba(148, 163, 184, 0.16);
  --auth-shadow: 0 20px 52px rgba(0, 0, 0, 0.52), 0 4px 16px rgba(0, 0, 0, 0.3);
  --auth-text: #f8fafc;
  --auth-muted: #94a3b8;
  --auth-btn-bg: #ffffff;
  --auth-btn-hover: #f1f5f9;
  --auth-btn-text: #0f172a;
  --auth-btn-border: rgba(255, 255, 255, 0.92);
  --auth-watermark: rgba(56, 189, 248, 0.036);
  --auth-alert-bg: rgba(239, 68, 68, 0.12);
  --auth-alert-border: rgba(239, 68, 68, 0.35);
  --auth-alert-text: #fca5a5;
}

[data-theme="light"] {
  --auth-bg: #f8fafc;
  --auth-card: #ffffff;
  --auth-card-border: #e5e7eb;
  --auth-shadow: 0 14px 40px rgba(15, 23, 42, 0.07), 0 2px 10px rgba(15, 23, 42, 0.03);
  --auth-text: #0f172a;
  --auth-muted: #64748b;
  --auth-btn-bg: #24292f;
  --auth-btn-hover: #0f172a;
  --auth-btn-text: #ffffff;
  --auth-btn-border: #24292f;
  --auth-watermark: rgba(15, 23, 42, 0.025);
  --auth-alert-bg: #fef2f2;
  --auth-alert-border: #fecaca;
  --auth-alert-text: #b91c1c;
}

.auth-wrapper.auth-exec-shell,
[data-theme="light"] .auth-wrapper.auth-exec-shell {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  padding: 0;
  background: var(--auth-bg) !important;
  color: var(--auth-text);
  overflow-y: auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  transition: background 0.25s ease, color 0.25s ease;
}

.auth-exec-watermark {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.auth-exec-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  padding: 20px 36px;
}

.auth-exec-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.auth-exec-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: contain;
  display: block;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.14);
}

.auth-exec-brand-name {
  font-family: var(--font-heading), -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--auth-text);
}

.auth-exec-main {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 36px 24px;
}

.auth-exec-grid {
  width: 100%;
  max-width: 880px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: stretch;
}

.auth-exec-hero {
  position: relative;
  border-radius: 8px;
  padding: 36px 32px;
  min-height: 390px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  background:
    radial-gradient(110% 90% at 88% 12%, rgba(245, 158, 11, 0.24) 0%, transparent 52%),
    radial-gradient(90% 80% at 10% 92%, rgba(56, 189, 248, 0.22) 0%, transparent 55%),
    linear-gradient(140deg, #0b1224 0%, #132247 52%, #1a3366 100%);
  box-shadow: 0 18px 44px rgba(11, 18, 36, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.auth-exec-hero-sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(125deg, rgba(255, 255, 255, 0.085) 0%, rgba(255, 255, 255, 0.015) 38%, transparent 56%);
}

.auth-motif-layer {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.auth-motif-layer.active {
  display: block;
}

.auth-hero-corner {
  position: absolute;
  width: 20px;
  height: 20px;
  pointer-events: none;
  border-color: rgba(255, 255, 255, 0.22);
}

.auth-hero-corner-tl {
  top: 16px;
  left: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  border-left: 1px solid rgba(255, 255, 255, 0.22);
}

.auth-hero-corner-br {
  bottom: 16px;
  right: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
  border-right: 1px solid rgba(255, 255, 255, 0.22);
}

.auth-typo-sculpture {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  user-select: none;
  letter-spacing: -0.035em;
  filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.25));
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.auth-typo-row {
  display: flex;
  align-items: baseline;
  line-height: 0.9;
}

.auth-typo-r1 { padding-left: 44px; }
.auth-typo-r2 { margin-top: -6px; padding-left: 0; }
.auth-typo-r3 { margin-top: -5px; padding-left: 10px; }
.auth-typo-r4 { margin-top: -6px; padding-left: 56px; align-items: center; }

.auth-typo-micro {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
}

.auth-typo-micro-live { margin-right: 8px; transform: translateY(-16px); }
.auth-typo-micro-kpi { margin: 0 5px; transform: translateY(-11px); }

.auth-typo-white { color: #ffffff; }
.auth-typo-soft { color: rgba(255, 255, 255, 0.9); }
.auth-typo-gold {
  background: linear-gradient(180deg, #fef08a 0%, #fbbf24 55%, #f59e0b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.auth-typo-track { font-size: 62px; font-weight: 900; }
.auth-typo-verify { font-size: 54px; font-weight: 900; }
.auth-typo-insight { font-size: 32px; font-weight: 600; margin-left: 7px; letter-spacing: -0.02em; }
.auth-typo-focus { font-size: 36px; font-weight: 700; }
.auth-typo-quality { font-size: 56px; font-weight: 900; }
.auth-typo-excellence { font-size: 48px; font-weight: 900; }

.auth-typo-bar {
  height: 2.5px;
  width: 138px;
  margin-left: 58px;
  margin-top: 12px;
  border-radius: 99px;
  opacity: 0.88;
  background: linear-gradient(90deg, #fbbf24, rgba(251, 191, 36, 0));
}

.auth-exec-card {
  border-radius: 8px;
  padding: 40px 36px;
  background: var(--auth-card);
  border: 1px solid var(--auth-card-border);
  box-shadow: var(--auth-shadow);
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.auth-exec-card-inner {
  max-width: 316px;
  width: 100%;
  margin: 0 auto;
  text-align: center;
}

.auth-exec-heading {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--auth-text);
}

.auth-exec-subtitle {
  margin: 12px 0 30px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--auth-muted);
}

.btn-google.auth-exec-cta {
  width: 100%;
  padding: 12px 18px;
  border-radius: 6px;
  background: var(--auth-btn-bg);
  color: var(--auth-btn-text);
  border: 1px solid var(--auth-btn-border);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  cursor: pointer;
  box-shadow: none;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.btn-google.auth-exec-cta:hover:not(:disabled) {
  background: var(--auth-btn-hover);
  border-color: var(--auth-btn-hover);
  color: var(--auth-btn-text);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
}

.auth-google-badge {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.auth-exec-shell .auth-alert {
  margin-top: 18px;
  padding: 11px 14px;
  border-radius: 6px;
  background: var(--auth-alert-bg);
  border: 1px solid var(--auth-alert-border);
  color: var(--auth-alert-text);
  font-size: 12.5px;
  line-height: 1.5;
  text-align: left;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.auth-exec-shell .auth-alert.hidden {
  display: none !important;
}

.auth-exec-footer {
  position: relative;
  z-index: 2;
  padding: 16px 24px;
  text-align: center;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--auth-muted);
}

@media screen and (max-width: 820px) {
  .auth-exec-header { padding: 16px 20px; }
  .auth-exec-main { padding: 8px 20px 20px; }
  .auth-exec-grid {
    grid-template-columns: 1fr;
    max-width: 440px;
    gap: 16px;
  }
  .auth-exec-hero {
    min-height: 230px;
    padding: 24px 20px;
  }
  .auth-typo-sculpture { transform: scale(0.76); transform-origin: center center; }
  .auth-exec-card { padding: 28px 22px; }
}

/* 2. SIDEBAR REDESIGN (NO < BUTTON, CLICKABLE BRAND, 2-ROW COMPACT FOOTER) */
.mobile-brand {
  cursor: pointer;
}

.sidebar-brand {
  cursor: pointer;
}

.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.14);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

[data-theme="light"] .sidebar-footer {
  background: rgba(241, 245, 249, 0.72);
  border-top-color: #e2e8f0;
}

.sidebar-footer-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-footer-controls .lang-btn-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

[data-theme="light"] .sidebar-footer-controls .lang-btn-group {
  background: #ffffff;
  border-color: #cbd5e1;
}

.sidebar-footer-controls .btn-lang {
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 6px;
}

.sidebar-footer-controls .sidebar-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  margin: 0;
}

.sidebar-footer-controls .sidebar-actions .btn-icon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

[data-theme="light"] .sidebar-footer-controls .sidebar-actions .btn-icon {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #475569;
}

.sidebar-footer-controls .sidebar-actions .btn-icon:hover {
  background: rgba(59, 130, 246, 0.14);
  border-color: rgba(59, 130, 246, 0.45);
  color: var(--primary);
  transform: translateY(-1px);
  box-shadow: none;
}

.sidebar-footer-controls .sidebar-actions .btn-icon.danger:hover {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.45);
  color: #ef4444;
}

.sidebar-footer .user-profile.gaming-card {
  margin-bottom: 0;
}

.sidebar-footer .fs-read-monitor-pill {
  margin-bottom: 0;
}

body.sidebar-collapsed .sidebar-footer {
  padding: 10px 8px;
  align-items: center;
}

body.sidebar-collapsed .sidebar-footer-controls {
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

body.sidebar-collapsed .sidebar-footer-controls .sidebar-actions {
  flex-direction: column;
  gap: 6px;
}

body.sidebar-collapsed .sidebar-footer-controls .sidebar-actions .btn-icon {
  width: 34px;
  height: 34px;
}

@media screen and (max-width: 1024px) {
  .sidebar-footer-controls .sidebar-actions {
    margin-bottom: 0 !important;
    gap: 6px !important;
  }
  .sidebar-footer-controls .sidebar-actions .btn-icon {
    width: 34px !important;
    height: 34px !important;
    border-radius: 8px !important;
    background: var(--bg-surface-elevated) !important;
  }
  [data-theme="light"] .sidebar-footer-controls .sidebar-actions .btn-icon {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
  }
}

/* 3. HIDE ALL NATIVE SCROLLBARS & ENABLE SMOOTH DRAG-TO-SCROLL */
.table-top-scrollbar-wrap {
  display: none !important;
}

.sidebar-nav,
.table-responsive,
#tabPermissions .table-responsive,
#tabSystemLogs .table-responsive,
.profile-modal-body,
.viewer-info-panel,
.viewer-gallery-strip,
.rm-list,
.rm-pane {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

.sidebar-nav::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar,
#tabPermissions .table-responsive::-webkit-scrollbar,
#tabSystemLogs .table-responsive::-webkit-scrollbar,
.profile-modal-body::-webkit-scrollbar,
.viewer-info-panel::-webkit-scrollbar,
.viewer-gallery-strip::-webkit-scrollbar,
.rm-list::-webkit-scrollbar,
.rm-pane::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.drag-scroll-ready {
  cursor: grab;
}

.drag-scroll-active {
  cursor: grabbing !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}

.drag-scroll-active * {
  cursor: grabbing !important;
  user-select: none !important;
}

/* 4. LIGHT MODE CONTRAST POLISH FOR QUOTA / CLOUD / SYNC / MODALS */
[data-theme="light"] .btn-cloud-search {
  background: rgba(2, 132, 199, 0.1);
  color: #0369a1;
  border-color: rgba(2, 132, 199, 0.35);
}

[data-theme="light"] .btn-cloud-search:hover:not(:disabled) {
  background: rgba(2, 132, 199, 0.2);
}

[data-theme="light"] .btn-load-more {
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.32);
}

[data-theme="light"] .btn-load-more:hover:not(:disabled) {
  background: rgba(37, 99, 235, 0.16);
}

[data-theme="light"] .fs-read-monitor-pill {
  background: rgba(5, 150, 105, 0.08);
  border-color: rgba(5, 150, 105, 0.32);
  color: #047857;
}

[data-theme="light"] .fs-read-monitor-pill:hover {
  background: rgba(5, 150, 105, 0.16);
}

[data-theme="light"] .btn-resume-sync {
  background: rgba(217, 119, 6, 0.1);
  border-color: rgba(217, 119, 6, 0.4);
  color: #b45309;
}

[data-theme="light"] .btn-resume-sync:hover {
  background: rgba(217, 119, 6, 0.18);
}

[data-theme="light"] #confirmPermDetailsList {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #334155 !important;
}

.rhythm-sample-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid var(--border-color);
  white-space: nowrap;
}

[data-theme="light"] .rhythm-sample-meta {
  background: #f1f5f9;
  color: #475569;
  border-color: #cbd5e1;
}

/* 5. ENTERPRISE READ MONITOR MODAL (FULL-WIDTH, LIGHT & DARK MODE) */
.read-monitor-card {
  width: 94%;
  max-width: 640px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  text-align: left;
  backdrop-filter: blur(18px);
}

[data-theme="light"] .read-monitor-card {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.16);
}

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

.rm-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.rm-header-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rm-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
}

.rm-subtitle {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.rm-close-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
  flex-shrink: 0;
}

.rm-close-btn:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: #ef4444;
}

.rm-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 22px 12px;
}

@media screen and (max-width: 540px) {
  .rm-summary-grid { grid-template-columns: 1fr; }
}

.rm-stat-card {
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
}

[data-theme="light"] .rm-stat-card {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.rm-stat-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.rm-stat-value {
  margin-top: 4px;
  font-size: 24px;
  font-weight: 800;
  font-family: var(--font-heading);
  color: #10b981;
}

.rm-stat-value.team-val {
  color: #38bdf8;
}

[data-theme="light"] .rm-stat-value.team-val {
  color: #0284c7;
}

.rm-stat-meta {
  display: block;
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.rm-tabs-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 22px 12px;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.rm-tabs-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rm-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
}

.rm-tab-btn:hover {
  border-color: var(--primary);
  color: var(--text-main);
}

.rm-tab-btn.active {
  background: rgba(59, 130, 246, 0.16);
  border-color: rgba(59, 130, 246, 0.45);
  color: #60a5fa;
}

[data-theme="light"] .rm-tab-btn.active {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.rm-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 11px;
  font-family: var(--font-mono);
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-main);
}

.rm-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-surface-elevated);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
}

.rm-refresh-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.rm-pane {
  display: none;
  padding: 14px 22px 20px;
}

.rm-pane.active {
  display: block;
}

.rm-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 330px;
  overflow-y: auto;
}

.rm-source-row {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid var(--border-subtle);
}

[data-theme="light"] .rm-source-row {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.rm-source-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.rm-source-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rm-source-val {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  color: #38bdf8;
  white-space: nowrap;
}

[data-theme="light"] .rm-source-val {
  color: #0284c7;
}

.rm-progress-track {
  height: 5px;
  border-radius: 99px;
  background: rgba(148, 163, 184, 0.18);
  overflow: hidden;
}

.rm-progress-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #3b82f6, #10b981);
}

.rm-account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid var(--border-subtle);
}

[data-theme="light"] .rm-account-row {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.rm-acc-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.rm-acc-rank {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: rgba(59, 130, 246, 0.14);
  color: #60a5fa;
  font-size: 11.5px;
  font-weight: 800;
  font-family: var(--font-mono);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

[data-theme="light"] .rm-acc-rank {
  background: #dbeafe;
  color: #1d4ed8;
}

.rm-acc-info {
  min-width: 0;
}

.rm-acc-email {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rm-acc-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #64748b;
  flex-shrink: 0;
}

.rm-acc-dot.online {
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.rm-acc-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rm-acc-reads {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
  color: #10b981;
  white-space: nowrap;
}

[data-theme="light"] .rm-acc-reads {
  color: #047857;
}

.rm-empty {
  text-align: center;
  padding: 28px 16px;
  font-size: 13px;
  color: var(--text-muted);
}

/* 6. CLICKABLE VIOLATION DETAILS ROW + ROTATING SVG CHEVRON + INLINE VECTOR SVGs */
.details-compact-row {
  cursor: pointer;
  padding: 4px 6px;
  margin: -4px -6px;
  border-radius: 7px;
  transition: background 0.16s ease;
}

.details-compact-row:hover {
  background: rgba(56, 189, 248, 0.1);
}

[data-theme="light"] .details-compact-row:hover {
  background: rgba(37, 99, 235, 0.08);
}

.details-compact-row:hover .btn-toggle-details {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.btn-toggle-details svg {
  width: 13px;
  height: 13px;
  transition: transform 0.2s ease;
}

.violation-details-cell.expanded .btn-toggle-details svg {
  transform: rotate(180deg);
}

.inline-vec-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: -2px;
}

.violation-comment-box {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.violation-comment-box .inline-vec-icon {
  margin-top: 2px;
  color: #38bdf8;
}

[data-theme="light"] .violation-comment-box .inline-vec-icon {
  color: #0284c7;
}

.vio-section-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.badge-vtype,
.badge-vreason {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.map-name-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 125px;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.map-name-row span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vinfo-comment-bubble {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.vinfo-comment-bubble .inline-vec-icon {
  margin-top: 2px;
  color: #38bdf8;
}
