/* ============================================================
   IP Tunnel Admin Dashboard — UI Redesign v2
   ============================================================
   Inspired by the license_server_php flat dark design.
   Loads AFTER inline <style> in index.html.
   Remove the <link> tag to revert instantly.
   ============================================================ */

/* ----------------------------------------------------------
   1. DESIGN TOKENS
   ---------------------------------------------------------- */
:root {
  /* --- Surfaces (solid, no transparency) --- */
  --bg: #0f1117;
  --surface: #1a1d2e;
  --surface-hover: #1e2433;
  --surface-raised: #232838;

  /* --- Borders --- */
  --border: #2d3748;
  --border-light: #374151;

  /* --- Text --- */
  --text: #e2e8f0;
  --text-secondary: #a0aec0;
  --text-muted: #718096;

  /* --- Accent colors --- */
  --blue: #63b3ed;
  --blue-bg: #1a2e4a;
  --purple: #b794f4;
  --purple-bg: #2d1f54;
  --green: #68d391;
  --green-bg: #1c4532;
  --red: #fc8181;
  --red-bg: #4a1c1c;
  --yellow: #f6e05e;
  --yellow-bg: #3d3519;

  /* --- Overrides for existing vars used by JS/inline styles --- */
  --primary-gradient: linear-gradient(135deg, #2b6cb0 0%, #3182ce 100%);
  --secondary-gradient: linear-gradient(135deg, #9b2c2c 0%, #c53030 100%);
  --success-gradient: linear-gradient(135deg, #276749 0%, #38a169 100%);
  --dark-bg: #0f1117;
  --card-bg: #1a1d2e;
  --glass-bg: #1a1d2e;
  --text-primary: #e2e8f0;
  --text-secondary: #a0aec0;
  --border-color: #2d3748;
  --focus-ring: rgba(99, 179, 237, 0.35);
  --surface-strong: #232838;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);

  /* --- Timing --- */
  --speed: 0.15s;
}


/* ----------------------------------------------------------
   2. BASE
   ---------------------------------------------------------- */
body {
  background: var(--bg);
  /* Remove radial gradient blobs — flat background */
  background-image: none;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgba(99, 179, 237, 0.3);
  color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}


/* ----------------------------------------------------------
   3. SCROLLBAR
   ---------------------------------------------------------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #374151; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #4a5568; }
* { scrollbar-width: thin; scrollbar-color: #374151 transparent; }


/* ----------------------------------------------------------
   4. SIDEBAR
   ---------------------------------------------------------- */
.sidebar {
  width: 250px;
  background: var(--surface);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-right: 1px solid var(--border);
  padding: 0;
  transition: transform 0.25s ease;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-header h3 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.3px;
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: var(--blue);
  background-clip: unset;
  color: var(--blue);
}

.sidebar-header h3 i {
  font-size: 20px;
}

.sidebar-header p,
.sidebar-header .text-secondary {
  font-size: 11px;
  color: var(--text-muted) !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.sidebar-menu {
  padding: 12px 10px;
}

/* Section labels */
.sidebar-menu > .text-secondary {
  font-size: 10px !important;
  font-weight: 600;
  letter-spacing: 1px !important;
  text-transform: uppercase !important;
  color: var(--text-muted) !important;
  padding: 14px 14px 4px !important;
}

.menu-item {
  padding: 8px 14px;
  color: var(--text-muted);
  text-decoration: none;
  transition: all var(--speed);
  border-left: 3px solid transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  margin: 1px 0;
  gap: 10px;
}

.menu-item i {
  width: 22px;
  font-size: 15px;
  text-align: center;
  flex-shrink: 0;
}

.menu-item:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-left-color: transparent;
}

.menu-item.active {
  background: var(--blue-bg);
  color: var(--blue);
  border-left-color: transparent;
}

.menu-item.active i {
  color: var(--blue);
}

.menu-item:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

/* Sidebar logout */
.sidebar > div:last-child {
  padding: 12px 20px 20px !important;
  border-top: 1px solid var(--border);
  margin-top: auto;
}


/* ----------------------------------------------------------
   5. MAIN CONTENT
   ---------------------------------------------------------- */
.main-content {
  margin-left: 250px;
  padding: 28px 32px;
  min-height: 100vh;
}


/* ----------------------------------------------------------
   6. TOP BAR
   ---------------------------------------------------------- */
.top-bar {
  margin-bottom: 24px;
  padding-bottom: 0;
  border-bottom: none;
}

.page-title h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: -0.3px;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 13px;
}

/* Admin avatar circle */
.top-bar .rounded-circle {
  width: 34px !important;
  height: 34px !important;
  font-size: 11px;
  background: var(--blue-bg) !important;
  color: var(--blue) !important;
  box-shadow: none;
  font-weight: 600;
}

#adminName {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}


/* ----------------------------------------------------------
   7. GLASS CARDS → FLAT CARDS
   ---------------------------------------------------------- */
.glass-card {
  background: var(--surface);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: none;
  padding: 20px;
  margin-bottom: 20px;
  transition: none;
}

.glass-card:hover {
  border-color: var(--border);
}

.glass-card h4,
.glass-card h5 {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.glass-card h4 i,
.glass-card h5 i {
  color: var(--blue);
  opacity: 1;
}


/* ----------------------------------------------------------
   8. STAT CARDS
   ---------------------------------------------------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--border);
  min-height: auto;
  position: relative;
  overflow: hidden;
  transition: none;
  box-shadow: none;
}

.stat-card:hover {
  transform: none;
  box-shadow: none;
}

.stat-card::before {
  display: none;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
  color: var(--text);
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Per-card accent colors (6-card grid: 3×2) */
.stat-card:nth-child(1) .stat-value { color: var(--blue); }
.stat-card:nth-child(2) .stat-value { color: var(--green); }
.stat-card:nth-child(3) .stat-value { color: var(--purple); }
.stat-card:nth-child(4) .stat-value { color: var(--yellow); }
.stat-card:nth-child(5) .stat-value { color: #fc8181; }   /* red — banned */
.stat-card:nth-child(6) .stat-value { color: #f6ad55; }   /* orange — tickets */


/* ----------------------------------------------------------
   9. BUTTONS
   ---------------------------------------------------------- */
.btn-gradient {
  background: #2b6cb0;
  border: none;
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  transition: opacity var(--speed);
  box-shadow: none;
  letter-spacing: 0;
  white-space: nowrap;
}

.btn-gradient:hover {
  transform: none;
  box-shadow: none;
  color: #fff;
  opacity: 0.85;
  filter: none;
}

.btn-gradient:active {
  transform: none;
  opacity: 0.75;
}

.btn-gradient:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.btn-gradient:disabled,
.btn-gradient.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-gradient.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 6px;
}

/* Danger */
.btn-danger {
  background: var(--red-bg);
  color: var(--red);
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 16px;
  transition: opacity var(--speed);
}

.btn-danger:hover {
  transform: none;
  opacity: 0.85;
  background: var(--red-bg);
  color: var(--red);
}

.btn-danger:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

/* Success */
.btn-success {
  background: var(--green-bg);
  color: var(--green);
  border: none;
  border-radius: 8px;
}

.btn-success:hover {
  opacity: 0.85;
  background: var(--green-bg);
  color: var(--green);
}

/* Outline / Ghost */
.btn-outline-light {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 16px;
  transition: all var(--speed);
}

.btn-outline-light:hover {
  background: var(--surface-hover);
  border-color: var(--border-light);
  color: var(--text);
}

/* Secondary */
.btn-secondary {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
}

.btn-secondary:hover {
  background: var(--surface-raised);
  color: var(--text);
}


/* ----------------------------------------------------------
   10. FORM CONTROLS
   ---------------------------------------------------------- */
.form-control,
.form-select {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 9px 13px;
  font-size: 14px;
  transition: border-color var(--speed);
}

.form-control::placeholder {
  color: var(--text-muted);
}

.form-control:focus,
.form-select:focus {
  background: var(--bg);
  color: var(--text);
  border-color: var(--blue);
  box-shadow: none;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 5px;
  text-transform: none;
  letter-spacing: normal;
}

.form-select option {
  background: var(--surface);
  color: var(--text);
}

.form-check-input {
  border-color: var(--border-light);
  background-color: var(--bg);
}

.form-check-input:checked {
  background-color: #2b6cb0;
  border-color: #2b6cb0;
}

.form-check-input:focus {
  border-color: var(--blue);
  box-shadow: none;
}

.form-check-label {
  font-size: 13px;
  color: var(--text);
}

textarea.form-control {
  resize: vertical;
}


/* ----------------------------------------------------------
   11. DATA TABLES
   ---------------------------------------------------------- */
.data-table {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-radius: 0;
  overflow: hidden;
  border: none;
}

.table {
  color: var(--text);
  margin-bottom: 0;
  font-size: 13px;
  /* Override Bootstrap's white table background */
  --bs-table-bg: transparent;
  --bs-table-color: var(--text);
  --bs-table-border-color: var(--border);
  --bs-table-striped-bg: rgba(255, 255, 255, 0.02);
  --bs-table-hover-bg: var(--surface-hover);
  --bs-table-active-bg: var(--surface-hover);
  background-color: transparent;
}

.table thead {
  background: transparent;
}

.table th {
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

.table td {
  border-bottom: 1px solid var(--surface-hover);
  padding: 12px 16px;
  vertical-align: middle;
  color: var(--text);
  background-color: transparent;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr:hover td {
  background-color: var(--surface-hover);
}

/* Sticky header */
.management-table-card .table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
}

/* Sortable header */
#coinBalanceHeader {
  cursor: pointer;
  user-select: none;
  transition: color var(--speed);
}

#coinBalanceHeader:hover {
  color: var(--blue);
}

/* Table small buttons */
.table .btn-sm {
  border-radius: 6px;
  font-size: 12px;
}

/* Reorder buttons */
.reorder-btn {
  min-width: 30px !important;
  font-weight: 700;
  border: 1px solid var(--border) !important;
  background: var(--bg) !important;
  color: var(--text-secondary) !important;
  border-radius: 6px !important;
  transition: all var(--speed);
}

.reorder-btn:hover {
  border-color: var(--blue) !important;
  color: var(--blue) !important;
  background: var(--blue-bg) !important;
}


/* ----------------------------------------------------------
   12. BADGES
   ---------------------------------------------------------- */
.badge {
  font-weight: 600;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 999px;
  border: none;
}

.badge.bg-primary {
  background: var(--blue-bg) !important;
  color: var(--blue) !important;
}

.badge.bg-success {
  background: var(--green-bg) !important;
  color: var(--green) !important;
}

.badge.bg-danger {
  background: var(--red-bg) !important;
  color: var(--red) !important;
}

.badge.bg-warning {
  background: var(--yellow-bg) !important;
  color: var(--yellow) !important;
}

.badge.bg-info {
  background: var(--blue-bg) !important;
  color: var(--blue) !important;
}

.badge.bg-secondary {
  background: var(--surface-hover) !important;
  color: var(--text-muted) !important;
}

.badge.text-dark {
  color: var(--yellow) !important;
}


/* ----------------------------------------------------------
   13. ALERTS
   ---------------------------------------------------------- */
.alert {
  border-radius: 8px;
  font-size: 13px;
}

.alert-warning {
  background: var(--yellow-bg);
  border: 1px solid #3d3519;
  color: var(--yellow);
}

.alert-info {
  background: var(--blue-bg);
  border: 1px solid #1a3a5c;
  color: var(--blue);
}

.alert-danger {
  background: var(--red-bg);
  border: 1px solid #742a2a;
  color: var(--red);
}

.alert-success {
  background: var(--green-bg);
  border: 1px solid #276749;
  color: var(--green);
}


/* ----------------------------------------------------------
   14. MODALS
   ---------------------------------------------------------- */
.admin-modal .modal-content {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

.admin-modal .modal-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: 14px 20px;
}

.admin-modal .modal-header .modal-title {
  font-weight: 600;
  font-size: 14px;
}

.admin-modal .modal-body {
  padding: 20px;
  background: var(--bg);
}

.admin-modal .modal-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 12px 20px;
  gap: 8px;
}

.admin-modal .modal-form-shell {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.admin-modal .modal-form-section {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 16px;
}

.admin-modal .modal-form-section h6 {
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.admin-modal .modal-form-section h6 i {
  color: var(--blue);
}

.admin-modal .modal-form-section .form-label {
  font-size: 12px;
  color: var(--text-muted);
}

/* Close button */
.admin-modal .btn-close {
  filter: invert(1);
  opacity: 0.4;
}

.admin-modal .btn-close:hover {
  opacity: 0.8;
}

/* Flag list in modals */
.admin-modal .modal-flag-list li {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  padding: 8px 12px;
}

/* Tweak modal toggles */
#tweakModal .modal-toggles .form-check {
  padding: 8px 12px 8px 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  min-height: 40px;
}


/* ----------------------------------------------------------
   15. LOGIN — Vertically centered, matching license server
   ---------------------------------------------------------- */

/* Center login vertically.
   JS sets style.display='block' inline on #loginSection.
   The inline <style> also sets .login-container { margin:90px auto }
   and a @media block overrides it to 72px auto on mobile.
   We need !important on layout props because:
   1. inline style.display='block' beats any non-!important display
   2. Same-specificity @media rules in inline <style> can interfere
   We do NOT use !important on display — the existing hide mechanism
   (#adminPanel[style*="display:block"] ~ #loginSection { display:none!important })
   already handles hiding. */
.login-container#loginSection {
  max-width: 100% !important;
  width: 100% !important;
  min-height: 100vh !important;
  margin: 0 !important;
  padding: 20px !important;
  position: relative;
  z-index: 2;
}

.login-container#loginSection > .login-card {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  /* Vertical centering: push card down ~40% of viewport */
  margin-top: calc(50vh - 230px);
}

.login-card {
  background: var(--surface);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 40px 36px;
  box-shadow: none;
  text-align: center;
}

.login-header {
  text-align: center;
  margin-bottom: 24px;
}

.login-header i {
  font-size: 40px;
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: var(--blue);
  background-clip: unset;
  color: var(--blue);
  margin-bottom: 12px;
  display: inline-block;
}

.login-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.login-header p {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 0;
}

#loginForm {
  text-align: left;
}

#loginForm .mb-4 {
  margin-bottom: 14px !important;
}

#loginForm .form-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  margin-bottom: 5px;
}

#loginForm .form-control {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 13px;
  font-size: 14px;
  color: var(--text);
}

#loginForm .form-control:focus {
  border-color: var(--blue);
  box-shadow: none;
}

#loginForm .btn-gradient {
  width: 100%;
  padding: 10px;
  font-size: 14px;
  border-radius: 8px;
  margin-top: 8px;
  background: #2b6cb0;
  box-shadow: none;
}


/* ----------------------------------------------------------
   16. JSON EDITOR
   ---------------------------------------------------------- */
.json-editor {
  background: var(--bg);
  border-radius: 8px;
  padding: 16px;
  font-family: "SF Mono", "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  color: var(--green);
  max-height: 500px;
  overflow-y: auto;
  border: 1px solid var(--border);
  white-space: pre-wrap;
  line-height: 1.6;
}


/* ----------------------------------------------------------
   17. SPINNER
   ---------------------------------------------------------- */
.spinner-overlay {
  background: rgba(15, 17, 23, 0.9);
  backdrop-filter: none;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
}


/* ----------------------------------------------------------
   18. MOBILE MENU & BACKDROP
   ---------------------------------------------------------- */
.mobile-menu-toggle {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  font-size: 16px;
}

.mobile-menu-toggle:hover {
  background: var(--surface-hover);
}

.sidebar-backdrop {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: none;
}


/* ----------------------------------------------------------
   19. DASHBOARD QUICK ACTIONS
   ---------------------------------------------------------- */
.dashboard-quick-actions {
  background: var(--surface);
  border: 1px solid var(--border);
}

.dashboard-quick-actions h4 i {
  color: var(--yellow);
}

.dashboard-quick-actions .btn-gradient {
  min-height: 40px;
}


/* ----------------------------------------------------------
   20. MANAGEMENT PAGES (Servers, Tweaks)
   ---------------------------------------------------------- */
.management-intro {
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr);
  gap: 16px;
  margin-bottom: 20px;
}

.management-badge {
  font-size: 11px;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  background: var(--bg);
  gap: 5px;
}

.management-badge i {
  color: var(--blue);
  font-size: 10px;
}

.management-checklist {
  color: var(--text-muted);
  font-size: 13px;
}

.management-checklist li::marker {
  color: var(--blue);
}

.flag-preview {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 999px;
  font-size: 12px;
  padding: 3px 8px;
}


/* ----------------------------------------------------------
   21. SETTINGS PAGE
   ---------------------------------------------------------- */
.settings-quick-actions {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  margin-bottom: 18px;
}

.settings-nav-link {
  min-height: 34px;
  padding: 6px 14px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  border: none;
  background: transparent;
  transition: all var(--speed);
  text-transform: none;
  letter-spacing: normal;
}

.settings-nav-link:hover {
  color: var(--text);
  border: none;
  background: var(--surface-hover);
}

.settings-section {
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.settings-section-priority {
  border-color: var(--border);
  background: var(--surface);
}

.settings-section-title {
  margin-bottom: 8px;
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}

.settings-section-title i {
  color: var(--blue);
}

.settings-section-note {
  color: var(--text-muted);
  font-size: 13px;
}

#settingsPage .settings-secondary-card {
  border: 1px dashed var(--border);
  background: var(--bg);
}

#settingsPage .settings-section-priority .form-check {
  padding: 8px 12px 8px 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  margin-bottom: 8px;
}

/* Override accent-color for settings checkboxes */
#settingsPage input[type="checkbox"] {
  accent-color: #2b6cb0;
}

/* Override settings input backgrounds */
#settingsPage #setApiEndpoint,
#settingsPage #setMinAppVersionCode,
#settingsPage #setMinAppVersionName,
#settingsPage #setPlayStoreUrl,
#settingsPage #setMaxLegacyRedeemCoins,
#settingsPage #setCoinSyncRateWindowSeconds,
#settingsPage #setCoinSyncRateDeviceMax,
#settingsPage #setCoinSyncMaxIncrease,
#settingsPage #setCoinSyncMaxDecrease {
  background: var(--bg);
  border-color: var(--border);
}


/* ----------------------------------------------------------
   22. COIN COLOR LEGEND (Users page bottom)
   ---------------------------------------------------------- */
.glass-card .badge + .badge {
  margin-left: 4px;
}


/* ----------------------------------------------------------
   23. RESPONSIVE — TABLET (769–1024px)
   ---------------------------------------------------------- */
@media (min-width: 769px) and (max-width: 1024px) {
  .sidebar { width: 220px; }
  .main-content { margin-left: 220px; padding: 24px 20px; }
  .page-title h1 { font-size: 20px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-value { font-size: 26px; }
  .management-intro { grid-template-columns: 1fr; }
  .admin-modal .modal-dialog { max-width: 90vw; }
}


/* ----------------------------------------------------------
   24. RESPONSIVE — MOBILE (<=768px)
   ---------------------------------------------------------- */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    width: 260px;
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    padding: 16px;
  }

  .top-bar {
    margin-bottom: 16px;
    padding-left: 48px;
    gap: 12px;
  }

  .page-title h1 { font-size: 18px; }

  .glass-card {
    padding: 16px;
    border-radius: 10px;
  }

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

  .stat-card { padding: 14px; }
  .stat-value { font-size: 24px; }
  .stat-label { font-size: 11px; }

  .data-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table { min-width: 700px; }
  .table th, .table td { padding: 8px 10px; font-size: 12px; }

  .btn-gradient { padding: 8px 14px; }

  .management-intro { grid-template-columns: 1fr; }
  .management-actions { width: 100%; }
  .management-actions .btn-gradient,
  .management-actions .btn-danger { flex: 1; min-width: 0; }

  .admin-modal .modal-form-shell { grid-template-columns: 1fr; }
  .admin-modal .modal-body { padding: 14px; }
  .admin-modal .modal-form-section { padding: 12px; }
  .admin-modal .modal-footer {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .admin-modal .modal-footer .btn { width: 100%; }

  .settings-quick-actions { padding: 12px; }
  .settings-quick-grid { grid-template-columns: repeat(2, 1fr); }
  .settings-section { padding: 14px; }
  #settingsPage .settings-firebase-actions .btn-gradient { width: 100%; min-width: 0; }

  .login-container#loginSection { padding: 16px !important; }
  .login-container#loginSection > .login-card {
    margin-top: calc(50vh - 210px);
    padding: 28px 24px;
    border-radius: 12px;
  }
  .login-header i { font-size: 32px; }
  .login-header h2 { font-size: 18px; }
}

/* Extra small */
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .top-bar .d-flex.align-items-center.gap-2:has(#adminInitials) { display: none !important; }
}


/* ----------------------------------------------------------
   25. TOAST NOTIFICATIONS
   ---------------------------------------------------------- */

.toast-stack {
  position: fixed;
  top: 72px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast-notification {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 300px;
  max-width: 400px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 13px;
  pointer-events: all;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  /* enter state: off-screen right */
  opacity: 0;
  transform: translateX(24px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast-notification.toast-visible {
  opacity: 1;
  transform: translateX(0);
}

.toast-icon { margin-top: 1px; flex-shrink: 0; }

.toast-success .toast-icon { color: var(--green); }
.toast-danger  .toast-icon { color: #fc8181; }
.toast-warning .toast-icon { color: #f6ad55; }
.toast-info    .toast-icon { color: var(--blue); }

/* Left accent bar */
.toast-success { border-left: 3px solid var(--green); }
.toast-danger  { border-left: 3px solid #fc8181; }
.toast-warning { border-left: 3px solid #f6ad55; }
.toast-info    { border-left: 3px solid var(--blue); }

.toast-body { flex: 1; line-height: 1.4; color: var(--text); }

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  margin-top: -1px;
}
.toast-close:hover { color: var(--text); }

/* ----------------------------------------------------------
   26. DASHBOARD WIDGETS
   ---------------------------------------------------------- */

/* Two-column widget row below quick actions */
.dashboard-widgets-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.widget-heading {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}

.widget-heading i { color: var(--text-muted); }

.widget-footer {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  text-align: right;
}

.btn-link-muted {
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.btn-link-muted:hover { color: var(--blue); }

/* Activity feed */
.activity-feed { display: flex; flex-direction: column; gap: 10px; }

.activity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 13px;
}

.activity-left  { display: flex; flex-direction: column; gap: 2px; }
.activity-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }

.activity-label  { color: var(--text); font-weight: 500; }
.activity-device { color: var(--text-muted); font-size: 11px; font-family: monospace; }

.activity-coins  { font-weight: 600; font-size: 12px; }
.activity-pos    { color: var(--green); }
.activity-neg    { color: #fc8181; }

.activity-time   { color: var(--text-muted); font-size: 11px; }

/* Coin economy rows */
.coin-summary { display: flex; flex-direction: column; gap: 8px; }

.coin-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 10px;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 13px;
}

.coin-stat-label { color: var(--text-muted); }
.coin-stat-value { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Responsive: stack to 1 column on smaller screens */
@media (max-width: 900px) {
  .dashboard-widgets-row { grid-template-columns: 1fr; }
}

.dashboard-analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.analytics-card { min-height: 100%; }
.analytics-card-wide { grid-column: 1 / -1; }

.analytics-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.analytics-card-note {
  font-size: 12px;
  color: var(--text-muted);
}

.analytics-empty-state {
  padding: 18px 14px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
  color: var(--text-muted);
  font-size: 13px;
}

.uptime-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.uptime-server-row {
  display: grid;
  grid-template-columns: minmax(140px, 180px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.uptime-server-meta {
  min-width: 0;
}

.uptime-server-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.uptime-server-summary {
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-muted);
}

.uptime-cells {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.uptime-square {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
  border: 1px solid rgba(255,255,255,0.06);
}

.uptime-square.is-great    { background: #16a34a; }
.uptime-square.is-good     { background: #22c55e; }
.uptime-square.is-ok       { background: #84cc16; }
.uptime-square.is-degraded { background: #f59e0b; }
.uptime-square.is-down     { background: #ef4444; }
.uptime-square.is-unknown  { background: #374151; }

.uptime-section-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 4px;
}
.uptime-section-divider::before,
.uptime-section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
  opacity: 0.5;
}
.uptime-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Protocol rows get a subtle left accent so they stand apart */
.uptime-proto-row .uptime-server-name { color: var(--text-muted); font-weight: 500; }

.uptime-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.uptime-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.traffic-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.traffic-select-label {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}

.traffic-select {
  max-width: 220px;
}

.traffic-chart-host {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.traffic-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(80px, 1fr));
  gap: 10px;
}

.traffic-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
}

.traffic-stat-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.traffic-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.traffic-chart-frame {
  padding: 14px 14px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}

.traffic-chart-svg {
  width: 100%;
  height: 220px;
  display: block;
}

.traffic-grid-line {
  stroke: rgba(255,255,255,0.08);
  stroke-width: 1;
}

.traffic-area-path {
  fill: rgba(99, 179, 237, 0.16);
}

.traffic-line-path {
  fill: none;
  stroke: #63b3ed;
  stroke-width: 3;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.traffic-point {
  fill: #90cdf4;
  stroke: #0f172a;
  stroke-width: 1.5;
}

.traffic-axis {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.traffic-axis-label,
.traffic-note {
  font-size: 11px;
  color: var(--text-muted);
}

.app-version-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.app-version-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.app-version-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.app-version-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.app-version-stats {
  font-size: 12px;
  color: var(--text-muted);
}

.app-version-track {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
}

.app-version-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #38bdf8 0%, #34d399 100%);
}

.app-version-unknown { color: var(--text-muted); font-style: italic; }
.app-version-fill-unknown { background: #374151; }

@media (max-width: 900px) {
  .dashboard-analytics-grid { grid-template-columns: 1fr; }
  .analytics-card-wide { grid-column: auto; }
  .uptime-server-row { grid-template-columns: 1fr; }
}

/* ----------------------------------------------------------
   26. SERVER HEALTH INDICATORS
   ---------------------------------------------------------- */

/* Colored status dot in the servers table Status column */
.health-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  vertical-align: middle;
  flex-shrink: 0;
}

.health-online  { background: #68d391; box-shadow: 0 0 6px rgba(104, 211, 145, 0.5); }
.health-offline { background: #fc8181; box-shadow: 0 0 6px rgba(252, 129, 129, 0.4); }
.health-unknown { background: #4a5568; }

/* Pulse animation for online dots */
@keyframes healthPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}
.health-online { animation: healthPulse 2s ease-in-out infinite; }

/* "3 online" sub-label inside the Servers stat card */
.stat-sub {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-muted, #a0aec0);
  letter-spacing: 0.02em;
  margin-top: 2px;
}

/* ----------------------------------------------------------
   26. BULK ACTION BAR
   ---------------------------------------------------------- */

.bulk-action-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--blue-bg);
  border: 1px solid var(--blue);
  border-radius: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.bulk-sel-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  flex: 1;
}

/* ----------------------------------------------------------
   27. LIVE SERVER BADGE (sidebar)
   ---------------------------------------------------------- */

.live-server-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

/* ----------------------------------------------------------
   28. CONFIG HISTORY & DIFF VIEWER
   ---------------------------------------------------------- */

.history-snap-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  gap: 12px;
  flex-wrap: wrap;
}

.history-snap-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.history-snap-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.history-snap-meta {
  font-size: 11px;
  color: var(--text-muted);
}

/* Diff viewer */
.diff-section {
  margin-bottom: 16px;
}

.diff-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.diff-row {
  font-size: 13px;
  font-family: monospace;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 3px;
}

.diff-added   { background: #1c4532; color: #68d391; }
.diff-removed { background: #4a1010; color: #fc8181; }
.diff-same, .diff-unchanged { font-size: 12px; color: var(--text-muted); padding: 3px 0; }

/* ----------------------------------------------------------
   29. PRINT
   ---------------------------------------------------------- */
@media print {
  .sidebar, .mobile-menu-toggle, .sidebar-backdrop,
  .btn-gradient, .btn-danger, .spinner-overlay {
    display: none !important;
  }
  .main-content { margin-left: 0 !important; }
  body { background: #fff; color: #000; }
  .glass-card, .stat-card, .data-table {
    border: 1px solid #ccc;
    background: #fff;
    box-shadow: none;
  }
}

/* ----------------------------------------------------------
   31. ACTIVE USERS PANEL
   ---------------------------------------------------------- */
.au-row          { margin-bottom: 14px; }
.au-row-top      { display:flex; justify-content:space-between; align-items:baseline; margin-bottom:5px; }
.au-label        { font-size:12px; color:var(--text-muted); text-transform:uppercase; letter-spacing:.5px; }
.au-value        { font-size:18px; font-weight:700; line-height:1; }
.au-sub          { font-size:11px; color:var(--text-muted); }
.au-bar-track    { height:4px; background:rgba(255,255,255,0.07); border-radius:4px; overflow:hidden; }
.au-bar-fill     { height:100%; border-radius:4px; transition:width .6s cubic-bezier(.4,0,.2,1); }

/* ----------------------------------------------------------
   32. GEO MAP WIDGET
   ---------------------------------------------------------- */
#geoMapLeaflet {
  height: 200px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.05);
}
/* Override Leaflet popup/attribution for dark theme */
#geoMapLeaflet .leaflet-control-attribution {
  background: rgba(15,17,23,0.8) !important;
  color: #4a5568 !important;
  font-size: 10px;
}
#geoMapLeaflet .leaflet-control-attribution a { color: #4a5568 !important; }
#geoMapLeaflet .leaflet-popup-content-wrapper {
  background: #1a1d2e;
  color: #e2e8f0;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
#geoMapLeaflet .leaflet-popup-tip { background: #1a1d2e; }

/* ----------------------------------------------------------
   33. SCHEDULED PUBLISH
   ---------------------------------------------------------- */
.sched-publish-card { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-top:12px; }
#schedCountdown { font-size:13px; color:#63b3ed; font-variant-numeric:tabular-nums; min-width:80px; }

/* ----------------------------------------------------------
   34. CONFIG VALIDATOR
   ---------------------------------------------------------- */
#validationPanel { margin-top:16px; }
#validationSummary { font-size:13px; font-weight:600; margin-bottom:12px; }
.val-server-card { background:rgba(255,255,255,0.04); border:1px solid rgba(255,255,255,0.07); border-radius:8px; padding:10px 14px; margin-bottom:8px; }
.val-server-header { display:flex; align-items:center; gap:10px; margin-bottom:8px; }
.val-server-name { font-weight:600; font-size:14px; color:var(--text); }
.val-server-host { font-size:12px; color:var(--text-muted); margin-left:auto; font-family:monospace; }
.val-checks { display:flex; gap:8px; flex-wrap:wrap; }
.val-chip { font-size:11px; padding:3px 9px; border-radius:20px; font-family:monospace; font-weight:600; }
.val-chip-ok   { background:rgba(104,211,145,0.15); color:#68d391; border:1px solid rgba(104,211,145,0.3); }
.val-chip-fail { background:rgba(252,129,129,0.15); color:#fc8181; border:1px solid rgba(252,129,129,0.3); }

/* ----------------------------------------------------------
   35. BROADCAST LOG
   ---------------------------------------------------------- */
.bcast-log-row { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; padding:10px 0; border-bottom:1px solid rgba(255,255,255,0.06); }
.bcast-log-row:last-child { border-bottom:none; }
.bcast-log-left { display:flex; flex-direction:column; gap:3px; min-width:0; }
.bcast-log-title { font-size:13px; font-weight:600; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.bcast-log-body { font-size:12px; color:var(--text-muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:260px; }
.bcast-log-right { display:flex; flex-direction:column; align-items:flex-end; gap:3px; flex-shrink:0; }
.bcast-log-target { font-size:11px; color:#63b3ed; }
.bcast-log-time { font-size:11px; color:var(--text-muted); white-space:nowrap; }

/* ----------------------------------------------------------
   36. SERVER UPTIME CHART
   ---------------------------------------------------------- */
/* Legacy percentage-bar classes removed in favor of compact grid styles above. */

/* ----------------------------------------------------------
   37. ADMOB REVENUE WIDGET
   ---------------------------------------------------------- */
.admob-kpi-grid   { display:grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap:10px; margin-bottom:14px; }
.admob-kpi-card   { border:1px solid rgba(255,255,255,0.07); border-radius:10px; padding:12px; background:rgba(255,255,255,0.02); min-height:88px; display:flex; flex-direction:column; justify-content:space-between; }
.admob-kpi-card.is-primary { background:rgba(104,211,145,0.08); border-color:rgba(104,211,145,0.18); }
.admob-kpi-value  { font-size:22px; font-weight:800; color:var(--text); line-height:1.1; }
.admob-kpi-card.is-primary .admob-kpi-value { color:#68d391; }
.admob-kpi-label  { font-size:11px; color:var(--text-muted); text-transform:uppercase; letter-spacing:.04em; margin-bottom:8px; }
.admob-heatmap-wrap { border:1px solid rgba(255,255,255,0.07); border-radius:10px; padding:12px; background:rgba(255,255,255,0.02); margin-bottom:12px; }
.admob-heatmap-header { display:flex; justify-content:space-between; align-items:flex-end; gap:10px; margin-bottom:10px; flex-wrap:wrap; }
.admob-heatmap-title { font-size:13px; font-weight:700; color:var(--text); }
.admob-heatmap-note { font-size:11px; color:var(--text-muted); }
.admob-heatmap-grid { display:flex; flex-wrap:wrap; gap:6px; }
.admob-heatmap-cell { width:18px; height:18px; border-radius:4px; border:1px solid rgba(255,255,255,0.08); background:rgba(148,163,184,0.2); display:inline-block; }
.admob-heatmap-cell.level-0 { background:rgba(100,116,139,0.24); }
.admob-heatmap-cell.level-1 { background:rgba(56,189,248,0.28); }
.admob-heatmap-cell.level-2 { background:rgba(56,189,248,0.46); }
.admob-heatmap-cell.level-3 { background:rgba(52,211,153,0.62); }
.admob-heatmap-cell.level-4 { background:rgba(34,197,94,0.9); }
.admob-heatmap-labels { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.admob-heatmap-day { width:18px; text-align:center; font-size:10px; color:var(--text-muted); }
.admob-stats-row  { display:flex; gap:0; border:1px solid rgba(255,255,255,0.07); border-radius:8px; overflow:hidden; margin-top:4px; }
.admob-stat       { flex:1; display:flex; flex-direction:column; align-items:center; padding:8px 4px; border-right:1px solid rgba(255,255,255,0.07); }
.admob-stat:last-child { border-right:none; }
.admob-stat-val   { font-size:14px; font-weight:700; color:var(--text); }
.admob-stat-lbl   { font-size:10px; color:var(--text-muted); margin-top:2px; }

@media (max-width: 900px) {
  .admob-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admob-heatmap-cell, .admob-heatmap-day { width:16px; }
  .admob-heatmap-cell { height:16px; }
}

/* ----------------------------------------------------------
   38. TRAFFIC BAR CHART
   ---------------------------------------------------------- */
.tg-chart  { display:flex; align-items:flex-end; gap:2px; height:72px; margin:14px 0 4px; }
.tg-col    { flex:1; display:flex; flex-direction:column; justify-content:flex-end; cursor:default; }
.tg-bar    { width:100%; min-height:2px; border-radius:2px 2px 0 0;
             background:linear-gradient(to top,#2b6cb0,#63b3ed); transition:height .4s; }
.tg-xaxis  { display:flex; gap:2px; margin-bottom:4px; }
.tg-xlabel { flex:1; font-size:10px; color:var(--text-muted); text-align:center; }

/* ----------------------------------------------------------
   39. ANALYTICS EMPTY STATE
   ---------------------------------------------------------- */
.analytics-empty-state { font-size:13px; color:var(--text-muted); padding:12px 0; }
