/* ============================================================================
   TaskTrafficNgon — Unified Fintech / MMO Design System (v2026.11.24-pro2)
   Self-hosted Be Vietnam Pro + JetBrains Mono typography, disciplined palette,
   centered link-creation modal, Chart.js containers, and responsive precision.
   ========================================================================== */

:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --navy: #0b1324;
  --navy-2: #162238;
  --ink: #0f172a;
  --text: #334155;
  --muted: #475569;
  --subtle: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff6ff;
  --primary-border: #bfdbfe;
  --green: #059669;
  --green-hover: #047857;
  --green-soft: #ecfdf5;
  --green-border: #a7f3d0;
  --amber: #d97706;
  --amber-soft: #fffbeb;
  --amber-border: #fde68a;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --danger-border: #fecaca;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, .05), 0 4px 12px rgba(15, 23, 42, .03);
  --shadow-md: 0 12px 28px -6px rgba(15, 23, 42, .10), 0 4px 10px -4px rgba(15, 23, 42, .05);
  --shadow-modal: 0 24px 60px -12px rgba(11, 19, 36, .35), 0 8px 20px -6px rgba(11, 19, 36, .18);
  --header-h: 60px;
  --font-sans: 'Be Vietnam Pro', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.58;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

h1, h2, h3, h4 {
  margin: 0;
  color: var(--ink);
  letter-spacing: -.02em;
  line-height: 1.26;
}
p { margin: 0; }

code, .mono {
  font-family: var(--font-mono);
  font-size: .9em;
}

.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11.5px; }
.centered { display: block; text-align: center; margin-top: 14px; }
.link-blue { color: var(--primary); font-weight: 600; }
.link-blue:hover { text-decoration: underline; }
.money-pos { color: var(--green); font-weight: 700; font-variant-numeric: tabular-nums; }
.money-neg { color: var(--danger); font-weight: 700; font-variant-numeric: tabular-nums; }

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 9999;
  background: var(--surface);
  color: var(--primary);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--primary);
  font-weight: 700;
}
.skip-link:focus { top: 12px; }

/* ============================================================================
   1. TOP HEADER BAR & 3-BAR HAMBURGER TRIGGER
   ========================================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 120;
  height: var(--header-h);
  padding: 0 20px;
  background: var(--navy);
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 2px 12px rgba(11, 19, 36, .16);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.nav-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .07);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s ease, border-color .15s ease;
}
.nav-trigger:hover {
  background: rgba(255, 255, 255, .14);
  border-color: rgba(255, 255, 255, .28);
}

.bars-icon {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 18px;
  height: 18px;
}
.bars-icon i {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: #38bdf8;
  transition: transform .2s ease, opacity .15s ease;
}
body.nav-open .bars-icon i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
body.nav-open .bars-icon i:nth-child(2) { opacity: 0; }
body.nav-open .bars-icon i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  white-space: nowrap;
}
.brand-mark {
  width: 32px;
  height: 26px;
  flex: 0 0 32px;
  padding: 2px;
  border-radius: 6px;
  background: #ffffff;
  object-fit: contain;
}
.brand-name {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.025em;
}
.brand-task { color: #38bdf8; }
.brand-traffic { color: #ffffff; }

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.user-profile-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-balance-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  background: rgba(5, 150, 105, .22);
  border: 1px solid rgba(52, 211, 153, .38);
  color: #6ee7b7;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transition: background .15s ease;
}
.user-balance-chip svg { width: 15px; height: 15px; }
.user-balance-chip:hover { background: rgba(5, 150, 105, .32); }

.user-display-name {
  color: #e2e8f0;
  font-size: 13.5px;
  font-weight: 600;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar-dropdown { position: relative; }
.avatar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid rgba(56, 189, 248, .55);
  background: var(--navy-2);
  color: #e2e8f0;
  cursor: pointer;
  list-style: none;
  overflow: hidden;
}
.avatar-btn::-webkit-details-marker { display: none; }
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; }
.avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.avatar-fallback svg { width: 18px; height: 18px; }

.dropdown-content {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 215px;
  padding: 6px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-md);
  z-index: 250;
}
.dropdown-user-meta {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.dropdown-user-meta b { display: block; font-size: 13.5px; color: var(--ink); }
.dropdown-user-meta small { display: block; font-size: 12px; color: var(--subtle); }
.dropdown-item-btn,
.dropdown-logout-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}
.dropdown-item-btn svg,
.dropdown-logout-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.dropdown-item-btn:hover { background: var(--surface-3); color: var(--primary); }
.dropdown-item-btn.is-admin { color: var(--primary); }
.dropdown-logout-btn { color: var(--danger); }
.dropdown-logout-btn:hover { background: var(--danger-soft); }

/* ============================================================================
   2. LEFT DRAWER MENU & WORKSPACE TABS
   ========================================================================== */
.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 190;
  background: rgba(11, 19, 36, .52);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
body.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }

.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(304px, 86vw);
  height: 100dvh;
  z-index: 200;
  background: var(--surface);
  border-right: 1px solid var(--border);
  box-shadow: 14px 0 36px rgba(11, 19, 36, .2);
  padding: 16px 14px calc(20px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  transform: translateX(-104%);
  transition: transform .22s cubic-bezier(.22, 1, .36, 1);
}
body.nav-open .sidebar { transform: translateX(0); }

.drawer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.drawer-brand { display: flex; align-items: center; gap: 10px; }
.drawer-brand img { width: 30px; height: 24px; object-fit: contain; }
.drawer-brand b { display: block; font-size: 15px; color: var(--ink); line-height: 1.2; }
.drawer-brand small { display: block; font-size: 11.5px; color: var(--subtle); }
.drawer-close {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.drawer-close svg { width: 17px; height: 17px; }
.drawer-close:hover { background: var(--surface-3); color: var(--ink); }

.drawer-wallet {
  margin-top: 14px;
  padding: 14px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, .08);
}
.drawer-wallet .dw-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: #94a3b8;
}
.drawer-wallet .dw-badge {
  background: rgba(5, 150, 105, .24);
  color: #6ee7b7;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 700;
}
.drawer-wallet strong {
  display: block;
  margin: 6px 0 12px;
  font-size: 21px;
  font-weight: 800;
  color: #6ee7b7;
  font-variant-numeric: tabular-nums;
}
.drawer-wallet strong small { font-size: 12.5px; color: #a7f3d0; }
.drawer-wallet .dw-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.drawer-section-label {
  margin: 16px 8px 6px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--subtle);
}

.drawer-links { display: flex; flex-direction: column; gap: 3px; }
.drawer-links a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  transition: background .14s ease, color .14s ease;
}
.drawer-links a svg { width: 18px; height: 18px; flex: 0 0 18px; color: var(--subtle); }
.drawer-links a:hover { background: var(--surface-3); color: var(--ink); }
.drawer-links a.is-active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.drawer-links a.is-active svg { color: var(--primary); }

.nav-pill-hot {
  margin-left: auto;
  font-style: normal;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--amber-soft);
  color: var(--amber);
  border: 1px solid var(--amber-border);
}

.drawer-foot { margin-top: auto; padding-top: 16px; display: grid; gap: 10px; }
.drawer-support-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.drawer-support-card svg { width: 18px; height: 18px; color: #0284c7; flex-shrink: 0; }
.drawer-support-card b { display: block; font-size: 13px; color: var(--ink); }
.drawer-support-card small { display: block; font-size: 11.5px; color: var(--subtle); }

.shell {
  width: 100%;
  min-height: calc(100dvh - var(--header-h) - 64px);
}
.main-content {
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 20px 18px 44px;
}
.main-narrow {
  width: min(100%, 540px);
  margin: 0 auto;
  padding: 28px 16px 44px;
}
.dashboard-container { width: 100%; }

.workspace-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 6px;
  margin-bottom: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  scrollbar-width: none;
}
.workspace-tabs::-webkit-scrollbar { display: none; }
.workspace-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.workspace-tabs a svg { width: 16px; height: 16px; color: var(--subtle); }
.workspace-tabs a:hover { background: var(--surface-3); color: var(--ink); }
.workspace-tabs a.is-active { background: var(--primary); color: #ffffff; font-weight: 700; }
.workspace-tabs a.is-active svg { color: #ffffff; }

/* ============================================================================
   3. PAGE HEADINGS, CARDS, PANELS & BADGES
   ========================================================================== */
.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 18px;
}
.page-heading h1 {
  font-size: clamp(20px, 2.6vw, 25px);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 4px;
}
.page-heading h1 svg { width: 22px; height: 22px; color: var(--primary); flex-shrink: 0; }
.page-heading .muted { font-size: 13.5px; max-width: 68ch; }

.eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 3px;
}

.status-pill, .tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  background: var(--surface-3);
  color: var(--text);
  border: 1px solid var(--border);
}
.status-pill { background: var(--surface); padding: 6px 12px; font-size: 12.5px; box-shadow: var(--shadow-xs); }
.status-pill svg, .tag svg { width: 14px; height: 14px; }
.tag-ok, .tag-on, .tag-success { background: var(--green-soft); color: var(--green); border-color: var(--green-border); }
.tag-warn, .tag-info { background: var(--amber-soft); color: var(--amber); border-color: var(--amber-border); }
.tag-danger, .tag-off { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-border); }
.tag-soft { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-border); }

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, .2);
}

.panel, .content-panel, .stat-card, .task-card, .auth-card, .chart-card, .wd-card, .card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.panel, .content-panel, .wd-card, .card {
  padding: 18px 20px;
  margin-bottom: 16px;
}
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}
.panel-head h2, .panel h2, .content-panel h2, .wd-card-title {
  font-size: 16.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.panel-head h2 svg, .panel h2 svg, .content-panel h2 svg, .wd-card-title svg {
  width: 18px;
  height: 18px;
  color: var(--primary);
  flex-shrink: 0;
}
.panel-head p.muted { margin-top: 3px; font-size: 13px; }

/* ============================================================================
   4. BUTTONS, COPY CHIPS & FORM CONTROLS
   ========================================================================== */
.btn, button.btn, a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.btn:hover { background: var(--surface-2); border-color: #94a3b8; color: var(--ink); }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-primary, a.btn-primary, button.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #ffffff; }

.btn-success, a.btn-success, button.btn-success {
  background: var(--green);
  border-color: var(--green);
  color: #ffffff;
}
.btn-success:hover { background: var(--green-hover); border-color: var(--green-hover); color: #ffffff; }

.btn-ghost, a.btn-ghost, button.btn-ghost {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-telegram, a.btn-telegram, button.btn-telegram {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
}
.btn-telegram:hover { background: #0369a1; border-color: #0369a1; color: #ffffff; }

.btn-danger-soft, a.btn-danger-soft, button.btn-danger-soft {
  background: #fef2f2;
  border-color: var(--danger-border);
  color: var(--danger);
}
.btn-danger-soft:hover { background: var(--danger-soft); border-color: #fca5a5; color: #991b1b; }

.btn-small, a.btn-small, button.btn-small { min-height: 34px; padding: 5px 11px; font-size: 12.5px; }
.btn-wide, a.btn-wide, button.btn-wide,
.btn-wd, button.btn-wd { width: 100%; min-height: 44px; padding: 10px 16px; font-size: 14px; }
.btn:disabled, [aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.copy-btn svg { width: 13px; height: 13px; }
.copy-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

.form-stack { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.form-stack label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--text); }
.form-stack input:not([type=checkbox]),
.form-stack select,
.form-stack textarea,
.wd-field input,
.task-action textarea {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 14.5px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-stack textarea,
.task-action textarea { height: auto; min-height: 84px; padding: 10px 13px; resize: vertical; }
.form-stack input:focus,
.form-stack select:focus,
.form-stack textarea:focus,
.wd-field input:focus,
.task-action textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.form-stack small { font-size: 12px; font-weight: 500; color: var(--subtle); }
.form-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.check-line {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start;
  gap: 9px !important;
  font-size: 13px;
  font-weight: 500 !important;
  color: var(--muted);
  line-height: 1.5;
}
.check-line input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--primary); flex-shrink: 0; }

.flash-stack { display: grid; gap: 10px; margin-bottom: 16px; }
.flash {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-left-width: 4px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.flash.error { color: #991b1b; background: #fef2f2; border-color: #fecaca; border-left-color: #dc2626; }
.flash.success { color: #065f46; background: #ecfdf5; border-color: #a7f3d0; border-left-color: #059669; }
.flash.info { color: #1e40af; background: #eff6ff; border-color: #bfdbfe; border-left-color: #2563eb; }

.notice {
  margin: 14px 0;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  color: var(--text);
  font-size: 13.5px;
}

.empty-state, .empty-large {
  padding: 24px 18px;
  border-radius: var(--radius);
  border: 1px dashed var(--border-strong);
  background: var(--surface-2);
  text-align: center;
  color: var(--subtle);
  font-size: 13.5px;
}
.empty-large {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.empty-icon svg { width: 38px; height: 38px; color: var(--subtle); }

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--surface);
}
th, td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
th {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--subtle);
  background: var(--surface-2);
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }

/* ============================================================================
   5. DASHBOARD (WALLET HERO, LIVE PARTNERS, CONNECTION, CHARTS)
   ========================================================================== */
.overview-hero, .wd-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  padding: 22px 24px;
  margin-bottom: 16px;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at 92% 15%, rgba(37, 99, 235, .28), transparent 45%),
              linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #ffffff;
  box-shadow: var(--shadow-md);
}
.overview-hero .eyebrow, .wd-hero-left small {
  display: block;
  color: #93c5fd;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.overview-hero strong, .wd-hero-left strong {
  display: block;
  font-size: clamp(26px, 4.5vw, 36px);
  font-weight: 800;
  color: #6ee7b7;
  letter-spacing: -.02em;
  margin: 4px 0;
  font-variant-numeric: tabular-nums;
}
.overview-hero strong small, .wd-cur { font-size: 16px; color: #a7f3d0; font-weight: 700; }
.overview-hero p, .wd-hero-left span { color: #cbd5e1; font-size: 13.5px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.overview-hero .btn-ghost {
  background: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .24);
  color: #ffffff;
}
.overview-hero .btn-ghost:hover { background: rgba(255, 255, 255, .18); }
.wd-hero-right { display: flex; flex-wrap: wrap; gap: 8px; }
.wd-hero-right span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .16);
  color: #e2e8f0;
  font-size: 12.5px;
  font-weight: 600;
}
.wd-hero-right svg { width: 15px; height: 15px; color: #38bdf8; }

.live-partners-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.live-partner-card { margin-bottom: 0; }
.lpc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.lpc-head img { height: 30px; width: auto; max-width: 124px; object-fit: contain; }
#gtraffic-live h2, #trafficso1-live h2 { font-size: 17px; line-height: 1.4; margin-bottom: 4px; }
#gtraffic-views, #trafficso1-views { color: var(--primary); font-weight: 800; font-variant-numeric: tabular-nums; }

.conn-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.conn-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.conn-icon {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.conn-icon svg { width: 18px; height: 18px; }
.conn-item small {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--subtle);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.conn-item b { display: block; font-size: 14.5px; color: var(--ink); margin-top: 2px; word-break: break-word; }
.conn-ip-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.speed-bar { height: 6px; margin: 7px 0 5px; border-radius: 99px; background: #e2e8f0; overflow: hidden; }
.speed-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #059669, #0ea5e9); }

.live-ping {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 800;
  background: var(--surface-3);
  color: var(--muted);
  border: 1px solid var(--border);
}
.live-ping svg { width: 14px; height: 14px; }
.live-ping[data-level="fast"] { background: var(--green-soft); color: var(--green); border-color: var(--green-border); }
.live-ping[data-level="mid"]  { background: var(--amber-soft); color: var(--amber); border-color: var(--amber-border); }
.live-ping[data-level="slow"] { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-border); }

.info-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.info-cell {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.info-cell small {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--subtle);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.info-cell b { display: block; margin-top: 4px; font-size: 14.5px; color: var(--ink); }
.state-paid { color: var(--green) !important; }
.state-wait { color: var(--amber) !important; }
.state-bad  { color: var(--danger) !important; }

.chart-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.chart-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 15px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.chart-card header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.chart-card h3 { font-size: 14px; font-weight: 800; }
.chart-canvas-wrap { position: relative; height: 150px; width: 100%; }
.chart-canvas-wrap.is-donut { height: 132px; width: 132px; flex: 0 0 132px; }

.gauge-wrap { position: relative; display: grid; place-items: center; padding-top: 4px; }
.gauge { width: min(100%, 230px); height: auto; overflow: visible; }
.gauge-center { position: absolute; bottom: 4px; text-align: center; line-height: 1.1; }
.gauge-center strong { display: block; font-size: 21px; font-weight: 800; }
.gauge-center small { font-size: 11px; color: var(--subtle); font-weight: 700; }
.fan-labels {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}
.fan-labels li { display: grid; justify-items: center; gap: 3px; font-size: 10.5px; font-weight: 700; color: var(--subtle); }
.fan-labels li i { width: 100%; height: 4px; border-radius: 99px; opacity: .45; }
.fan-labels li.on { color: var(--ink); }
.fan-labels li.on i { opacity: 1; }

.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; height: 136px; padding-top: 16px; }
.bar-col { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 4px; }
.bar-fill { width: 100%; max-width: 24px; min-height: 6px; border-radius: 6px 6px 3px 3px; background: var(--primary); }
.bar-col:nth-child(even) .bar-fill { background: var(--green); }
.bar-value { position: absolute; top: -2px; font-size: 10.5px; font-weight: 800; color: var(--text); }
.bar-label { font-size: 10.5px; font-weight: 700; color: var(--subtle); }

.donut-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.donut { position: relative; flex: 0 0 112px; width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center; }
.donut-hole { width: 68%; height: 68%; border-radius: 50%; background: var(--surface); display: grid; place-content: center; text-align: center; line-height: 1.05; }
.donut-hole strong { font-size: 17px; font-weight: 800; }
.donut-hole small { font-size: 10px; color: var(--subtle); font-weight: 700; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; flex: 1 1 120px; }
.legend li { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--text); }
.legend li i { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 10px; }
.legend li b { margin-left: auto; font-weight: 800; }

/* ============================================================================
   6. TASKS PAGE, PROGRESS BARS, QUOTA DOTS & CENTERED LINK MODAL
   ========================================================================== */
.quota-banner {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-xs);
}
.qb-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
}
.qb-label { display: block; font-size: 12px; font-weight: 600; color: var(--subtle); }
.qb-item strong { display: block; margin-top: 2px; font-size: 15.5px; font-weight: 800; color: var(--green); }
.qb-item strong.is-empty { color: var(--danger); }
.qb-dots { display: inline-flex; gap: 5px; align-items: center; }
.qb-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-strong);
  display: block;
}
.qb-dots i.is-on { background: var(--green); box-shadow: 0 0 0 3px rgba(5, 150, 105, .15); }
.qb-note {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--muted);
}
.qb-note svg { width: 16px; height: 16px; color: var(--primary); flex-shrink: 0; }

.tasks-grid { display: grid; gap: 14px; margin-bottom: 16px; }
.task-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  align-items: center;
  gap: 18px;
  padding: 18px 20px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.task-card:hover { border-color: #cbd5e1; box-shadow: var(--shadow-md); }
.task-main { min-width: 0; }
.task-brand-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.partner-logo { width: 124px; height: 36px; object-fit: contain; object-position: left center; }
.task-rate-badge {
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid var(--green-border);
  padding: 4px 11px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.task-card h2 { font-size: 17px; font-weight: 800; margin: 2px 0 6px; }
.task-desc { font-size: 13.5px; margin-bottom: 10px; }
.tc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tc-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.tc-chip svg { width: 13px; height: 13px; }
.tc-chip.tc-reward { background: var(--green-soft); color: var(--green); border-color: var(--green-border); }
.tc-chip.tc-today { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-border); }

.task-progress {
  margin-top: 10px;
  height: 6px;
  border-radius: 99px;
  background: var(--surface-3);
  overflow: hidden;
}
.task-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--green));
  transition: width .3s ease;
}

.task-action { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.task-action .form-stack { margin-top: 0; }
.tc-hint { font-size: 12px; color: var(--subtle); text-align: center; }

.lk-list { display: grid; gap: 8px; }
.lk-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.lk-info { min-width: 0; flex: 1 1 240px; }
.lk-url-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lk-row b { font-size: 13.5px; color: var(--ink); word-break: break-all; font-family: var(--font-mono); }
.lk-row .muted { margin-top: 4px; font-size: 12px; }
.lk-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* --- CENTERED LINK CREATION MODAL (TaskTrafficNgon · Link Của Bạn) --- */
@keyframes ttnModalIn {
  from { opacity: 0; transform: translateY(12px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes ttnSpin {
  to { transform: rotate(360deg); }
}
@keyframes ttnShimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(220%); }
}

.ttn-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(11, 19, 36, .64);
  backdrop-filter: blur(5px);
}
.ttn-modal-backdrop[hidden] { display: none !important; }

.ttn-modal-card {
  position: relative;
  width: min(100%, 470px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-modal);
  overflow: hidden;
  animation: ttnModalIn .24s cubic-bezier(.22, 1, .36, 1) both;
}
.ttn-modal-card::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), #0ea5e9, var(--green));
}

.ttn-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  background: var(--navy);
  color: #ffffff;
}
.ttn-modal-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 15.5px;
}
.ttn-modal-brand img {
  width: 28px;
  height: 22px;
  padding: 2px;
  border-radius: 5px;
  background: #ffffff;
  object-fit: contain;
}
.ttn-modal-brand .brand-task { color: #38bdf8; }
.ttn-modal-brand .brand-traffic { color: #ffffff; }

.ttn-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .08);
  color: #e2e8f0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.ttn-modal-close:hover { background: rgba(255, 255, 255, .18); color: #ffffff; }
.ttn-modal-close svg { width: 16px; height: 16px; }

.ttn-modal-body {
  padding: 22px 20px 20px;
}

.ttn-modal-loading {
  text-align: center;
  padding: 14px 6px;
}
.ttn-spinner {
  width: 46px;
  height: 46px;
  margin: 0 auto 14px;
  border-radius: 50%;
  border: 3.5px solid var(--primary-soft);
  border-top-color: var(--primary);
  border-right-color: var(--green);
  animation: ttnSpin .75s linear infinite;
}
.ttn-modal-loading h3 { font-size: 17px; font-weight: 800; margin-bottom: 5px; }
.ttn-modal-loading p { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.ttn-progress-track {
  height: 6px;
  border-radius: 99px;
  background: var(--surface-3);
  overflow: hidden;
}
.ttn-progress-track i {
  display: block;
  width: 45%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--green));
  animation: ttnShimmer 1.2s ease-in-out infinite;
}

.ttn-modal-ready-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.ttn-modal-title {
  font-size: 21px;
  font-weight: 800;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.ttn-modal-title svg { width: 21px; height: 21px; color: var(--green); }

.ttn-modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.ttn-url-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--primary-border);
  background: var(--primary-soft);
  margin-bottom: 12px;
}
.ttn-url-box code {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-hover);
  word-break: break-all;
}

.ttn-modal-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 16px;
}
.ttn-modal-note svg { width: 16px; height: 16px; color: var(--primary); flex-shrink: 0; margin-top: 2px; }

.ttn-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.ttn-modal-actions .btn {
  width: 100%;
  min-height: 44px;
  font-size: 13.5px;
}

.ttn-modal-error {
  text-align: center;
  padding: 8px 4px;
}
.ttn-err-ico {
  width: 46px;
  height: 46px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--danger-soft);
  color: var(--danger);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ttn-err-ico svg { width: 22px; height: 22px; }
.ttn-modal-error h3 { font-size: 17px; font-weight: 800; margin-bottom: 6px; }
.ttn-modal-error p { font-size: 13.5px; color: var(--muted); margin-bottom: 16px; }

/* ============================================================================
   7. LEADERBOARD (TOP VƯỢT LINK)
   ========================================================================== */
.lb-page-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.lb-tabs {
  display: inline-flex;
  background: var(--surface-3);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  gap: 3px;
}
.lb-tab {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.lb-tab.is-active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-xs); }
.lb-list { display: grid; gap: 8px; }
.lb-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.lb-row.rank-1 { background: #fffbeb; border-color: #fde68a; }
.lb-row.rank-2 { background: #f8fafc; border-color: #cbd5e1; }
.lb-row.rank-3 { background: #fff7ed; border-color: #fed7aa; }
.lb-rank { min-width: 58px; font-weight: 800; font-size: 13px; color: var(--ink); }
.lb-user { flex: 1 1 auto; min-width: 0; }
.lb-user b { display: block; font-size: 14px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-user small { display: block; font-size: 12px; color: var(--subtle); }
.lb-stats { text-align: right; flex-shrink: 0; }
.lb-links { display: block; font-size: 12px; color: var(--muted); }
.lb-money { display: block; font-size: 14.5px; font-weight: 800; color: var(--green); font-variant-numeric: tabular-nums; }

/* ============================================================================
   8. WITHDRAW PAGE
   ========================================================================== */
.wd-grid-pro { display: grid; grid-template-columns: 1.35fr .85fr; gap: 16px; margin-bottom: 16px; align-items: start; }
.wd-bank-quick {
  margin-bottom: 14px;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.wbq-label { display: block; font-size: 12px; font-weight: 700; color: var(--subtle); margin-bottom: 8px; }
.wbq-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.wbq-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 5px 8px;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.wbq-item img { width: 20px; height: 20px; border-radius: 5px; object-fit: cover; }
.wbq-item:hover, .wbq-item.is-active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.wd-fields-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wd-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; font-size: 13px; font-weight: 700; color: var(--text); }
.wd-field small { font-size: 12px; font-weight: 500; color: var(--subtle); }
.wd-range-warn { color: var(--amber) !important; font-weight: 700 !important; }
.wd-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.wd-chip {
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.wd-chip:hover { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.wd-chip.wd-chip-all { background: var(--green-soft); border-color: var(--green-border); color: var(--green); }
.wd-note { display: flex; align-items: flex-start; gap: 7px; margin-bottom: 14px; font-size: 12.5px; color: var(--subtle); }
.wd-note svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 2px; }

.qr-dropzone {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 220px;
  aspect-ratio: 1;
  margin: 6px auto 12px;
  border: 2px dashed #94a3b8;
  border-radius: var(--radius);
  background: var(--surface-2);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.qr-dropzone:hover { border-color: var(--primary); background: var(--primary-soft); }
.qr-placeholder { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px; text-align: center; }
.qr-plus-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.qr-placeholder b { font-size: 13px; color: var(--ink); }
.qr-placeholder small { font-size: 11.5px; color: var(--subtle); }
#qr-preview { display: none; width: 100%; height: 100%; object-fit: contain; background: #ffffff; }
.wd-qr-hint { text-align: center; font-size: 12.5px; color: var(--subtle); margin-bottom: 12px; }
.wd-guide-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
.wd-guide-box h3 { display: flex; align-items: center; gap: 6px; font-size: 13.5px; margin-bottom: 8px; }
.wd-guide-box h3 svg { width: 16px; height: 16px; color: var(--green); }
.wd-guide-box ul { margin: 0; padding-left: 17px; font-size: 12.5px; color: var(--muted); display: grid; gap: 5px; }

/* ============================================================================
   9. AUTH PAGES (LOGIN / REGISTER / FORGOT / RESET / APPROVAL)
   ========================================================================== */
@keyframes ttnAuthCardIn {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes ttnAuthFieldIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes ttnPulseRing {
  0%   { box-shadow: 0 0 0 0 rgba(5, 150, 105, .55); }
  70%  { box-shadow: 0 0 0 7px rgba(5, 150, 105, 0); }
  100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); }
}

.auth-shell { width: 100%; max-width: 520px; margin: 0 auto; }
.auth-card { padding: 24px 22px; border-radius: var(--radius-lg); }
.auth-icon { display: none; }
.auth-card.auth-card-pro {
  position: relative;
  overflow: hidden;
  border: 1px solid #dbe4f0;
  box-shadow: var(--shadow-md);
  animation: ttnAuthCardIn .36s cubic-bezier(.22, 1, .36, 1) both;
}
.auth-card.auth-card-pro::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), #0ea5e9, var(--green));
}
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 18px;
}
.auth-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 12px;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--muted);
}
.auth-tab svg { width: 16px; height: 16px; }
.auth-tab.is-active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-xs); }
.auth-head { margin-bottom: 16px; }
.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: 99px;
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .05em;
  margin-bottom: 8px;
}
.auth-badge .live-dot { animation: ttnPulseRing 2s infinite; }
.auth-head h1 { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.auth-form .auth-field { animation: ttnAuthFieldIn .34s cubic-bezier(.22, 1, .36, 1) both; }
.auth-form .auth-field:nth-child(2) { animation-delay: 40ms; }
.auth-form .auth-field:nth-child(3) { animation-delay: 80ms; }
.auth-form .auth-field:nth-child(4) { animation-delay: 120ms; }
.auth-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.input-icon-wrap { position: relative; display: flex; align-items: center; }
.input-icon-wrap > svg {
  position: absolute;
  left: 12px;
  width: 17px;
  height: 17px;
  color: var(--subtle);
  pointer-events: none;
  transition: color .18s ease;
}
.input-icon-wrap input {
  width: 100%;
  height: 44px !important;
  padding: 0 62px 0 38px !important;
  border-radius: 9px !important;
  border: 1.5px solid var(--border-strong) !important;
  background: var(--surface-2) !important;
}
.input-icon-wrap input:focus {
  background: var(--surface) !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .12) !important;
}
.input-icon-wrap:focus-within > svg { color: var(--primary); }
.pw-toggle {
  position: absolute;
  right: 8px;
  height: 28px;
  padding: 0 9px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.auth-submit { min-height: 45px; font-size: 14px; box-shadow: 0 6px 16px rgba(37, 99, 235, .2); }
.auth-perks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.auth-perks > div {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-2);
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.auth-perks svg { width: 15px; height: 15px; color: var(--green); flex-shrink: 0; }
.auth-switch { text-align: center; font-size: 13px; margin-top: 18px; color: var(--muted); }

/* ============================================================================
   10. INFO, SUPPORT, LANDING & POLICY PAGES
   ========================================================================== */
.info-list { padding: 4px 20px; }
.info-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.info-list > div:last-child { border-bottom: none; }
.info-list span { color: var(--subtle); font-weight: 600; }
.info-list b { text-align: right; color: var(--ink); overflow-wrap: anywhere; }

.contact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.contact-grid .panel { margin-bottom: 0; }

.reward-panel { max-width: 680px; margin: 0 auto; }
.reward-amount {
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 800;
  color: var(--green);
  margin: 14px 0;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}

.prose { max-width: 820px; margin: 0 auto; }
.prose h1 { font-size: 26px; margin-bottom: 10px; }
.prose h2 { font-size: 18px; margin: 22px 0 8px; }
.prose p, .policy-page li { color: var(--muted); line-height: 1.75; }
.policy-page ul { padding-left: 20px; margin: 8px 0; }

/* ============================================================================
   11. ADMIN PANEL ARCHITECTURE
   ========================================================================== */
.admin-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 6px;
  margin-bottom: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  scrollbar-width: none;
}
.admin-nav::-webkit-scrollbar { display: none; }
.admin-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}
.admin-nav a svg { width: 15px; height: 15px; }
.admin-nav a:hover { background: var(--surface-3); color: var(--ink); }
.admin-nav a.active { background: var(--primary); color: #ffffff; }

.admin-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi-card { display: flex; flex-direction: column; justify-content: space-between; padding: 15px 16px; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--subtle); }
.kpi-top svg { width: 17px; height: 17px; color: var(--primary); }
.kpi-card strong { font-size: 22px; font-weight: 800; margin: 6px 0 3px; font-variant-numeric: tabular-nums; }
.kpi-card small { font-size: 12px; color: var(--subtle); }

.admin-quick-pages { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.aqp-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}
.aqp-card:hover { border-color: var(--primary); background: var(--surface-2); }
.aqp-ico {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.aqp-card b { display: block; font-size: 14px; color: var(--ink); }
.aqp-card small { display: block; font-size: 12px; color: var(--subtle); }
.aqp-card > svg { margin-left: auto; width: 17px; height: 17px; color: var(--subtle); }

.admin-split-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.admin-card-stack { display: grid; gap: 12px; }
.admin-subcard { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; }
.asc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.admin-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.admin-btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-campaign-grid { display: grid; gap: 14px; }
.admin-campaign-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.acc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.acc-top h2, .acc-top h3 { font-size: 16px; margin-top: 2px; }
.acc-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.acc-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.acc-stats > div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 11px; }
.acc-stats small { display: block; font-size: 11.5px; color: var(--subtle); }
.acc-stats strong { display: block; font-size: 14.5px; margin-top: 2px; }

.adv-cfg summary { cursor: pointer; font-weight: 700; font-size: 13.5px; color: var(--primary); padding: 6px 0; }
.adv-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.adv-toggle {
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.adv-toggle input { width: 17px; height: 17px; accent-color: var(--primary); }
.stk-code {
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-family: var(--font-mono);
}
.admin-wd-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ============================================================================
   12. FOOTER
   ========================================================================== */
.app-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 18px 16px;
  text-align: center;
  font-size: 12.5px;
  color: var(--subtle);
}
.app-footer a { color: var(--primary); font-weight: 600; }
.footer-policy-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 16px; margin-top: 6px; }

/* ============================================================================
   13. RESPONSIVE BREAKPOINTS (MOBILE & TABLET)
   ========================================================================== */
@media (max-width: 900px) {
  .chart-grid,
  .conn-grid,
  .info-grid,
  .admin-kpi-grid,
  .admin-split-grid,
  .wd-grid-pro,
  .lb-page-grid {
    grid-template-columns: 1fr;
  }
  .task-card { grid-template-columns: 1fr; gap: 14px; }
}

@media (max-width: 640px) {
  .app-header { height: 54px; padding: 0 12px; }
  .nav-trigger { height: 35px; padding: 0 10px; }
  .trigger-text { display: none; }
  .brand-name { font-size: 15.5px; }
  .user-display-name { display: none; }
  .user-balance-chip { height: 33px; padding: 0 9px; font-size: 12px; }
  .main-content { padding: 14px 12px 32px; }
  .panel, .content-panel, .wd-card, .card, .task-card { padding: 15px; }
  .overview-hero, .wd-hero { padding: 18px; flex-direction: column; align-items: stretch; }
  .hero-actions { display: grid; grid-template-columns: 1fr; width: 100%; }
  .hero-actions .btn { width: 100%; }
  .live-partners-grid,
  .quota-banner,
  .wd-fields-grid,
  .auth-grid-2,
  .auth-perks,
  .contact-grid,
  .admin-quick-pages,
  .admin-form-row,
  .ttn-modal-actions {
    grid-template-columns: 1fr;
  }
  .wbq-grid,
  .acc-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .info-list > div { flex-direction: column; align-items: flex-start; gap: 4px; }
  .info-list b { text-align: left; }
}

/* ── CSS chuyển từ app.css: popup thể lệ + banner + phí rút ── */
/* ══════════════════════════════════════════════════════════════════════════
   POPUP THỂ LỆ TOP TUẦN (hiện khi vào web, tắt được)
   ══════════════════════════════════════════════════════════════════════════ */
/* Mặc định ẨN cho tới khi JS thêm .is-open (tránh nhấp nháy/nửa vời).
   Vẫn tôn trọng [hidden] để nút đóng hoạt động. */
.rule-popup { position: fixed; inset: 0; z-index: 9999; display: none;
  align-items: center; justify-content: center; padding: 16px; }
.rule-popup.is-open { display: flex; }
.rule-popup[hidden] { display: none !important; }
.rule-popup-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.62);
  backdrop-filter: blur(3px); animation: rpFade .22s ease; }
@keyframes rpFade { from { opacity: 0 } to { opacity: 1 } }

.rule-popup-box {
  position: relative; z-index: 1;
  width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto;
  padding: 22px 22px 18px; border-radius: 18px;
  background: linear-gradient(165deg,#fffbeb 0%,#fef3c7 45%,#ffffff 100%);
  border: 1px solid #fcd34d;
  box-shadow: 0 20px 55px rgba(0,0,0,.35);
  animation: rpIn .26s cubic-bezier(.2,.9,.3,1.1);
}
@keyframes rpIn { from { opacity: 0; transform: translateY(16px) scale(.97) }
                  to   { opacity: 1; transform: none } }

.rule-popup-x {
  position: absolute; top: 10px; right: 12px; width: 32px; height: 32px;
  border-radius: 50%; border: 1px solid #fcd34d; background: #fff; color: #92400e;
  font-size: 15px; font-weight: 700; cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.rule-popup-x:hover { background: #fef3c7; }

.rp-eyebrow { font-size: 10px; font-weight: 900; letter-spacing: .16em; color: #b45309; }
.rule-popup-head h2 { margin: 6px 0 10px; font-size: 20px; color: #7c2d12; }
.rp-note { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px;
  background: #fff; border: 1px dashed #f59e0b; font-size: 13px;
  color: #92400e; line-height: 1.55; }

.rp-prizes { display: grid; grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 8px; margin-bottom: 14px; }
.rp-prize { display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 11px 8px; border-radius: 12px; border: 1px solid #e5e7eb; background: #fff; }
.rp-prize-1 { border-color: #fcd34d; background: linear-gradient(165deg,#fffbeb,#fef3c7); }
.rp-prize-2 { border-color: #cbd5e1; background: linear-gradient(165deg,#f8fafc,#e2e8f0); }
.rp-prize-3 { border-color: #fdba74; background: linear-gradient(165deg,#fff7ed,#ffedd5); }
.rp-medal { font-size: 18px; }
.rp-prize b { font-size: 12px; color: #475569; }
.rp-prize strong { font-size: 17px; color: #0f172a; }
.rp-prize small { font-size: 11px; color: #15803d; font-weight: 600; }

.rp-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 7px; }
.rp-list li { display: flex; gap: 9px; align-items: flex-start; padding: 9px 11px;
  border-radius: 10px; background: rgba(255,255,255,.78);
  border: 1px solid #fde68a; font-size: 12.8px; color: #44403c; line-height: 1.5; }
.rp-list li > span { flex: 0 0 auto; font-size: 14px; line-height: 1.2; }
.rp-champion { background: linear-gradient(90deg,#fffbeb,#fef08a) !important;
  border-color: #facc15 !important; font-weight: 600; }

.rp-mine { margin-bottom: 12px; padding: 9px 12px; border-radius: 10px;
  background: #fff; border: 1px solid #e5e7eb; font-size: 12.5px; color: #334155; }
.rp-mine b { color: #92400e; }

.rp-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.rp-actions .btn { flex: 1 1 auto; min-width: 130px; }

@media (max-width: 520px) {
  .rule-popup-box { padding: 18px 15px 14px; max-height: 92vh; }
  .rule-popup-head h2 { font-size: 17px; }
  .rp-prizes { grid-template-columns: 1fr; }
  .rp-actions { flex-direction: column; }
  .rp-actions .btn { width: 100%; }
}

/* ══════════════════════════════════════════════════════════════════════════
   THÔNG BÁO THỂ LỆ TOP TUẦN + ĐẶC QUYỀN RÚT TIỀN
   ══════════════════════════════════════════════════════════════════════════ */
.tl-card {
  position: relative;
  padding: 20px 22px;
  border-radius: 16px;
  border: 1px solid #fcd34d;
  background: linear-gradient(160deg, #fffbeb 0%, #fef3c7 55%, #fef9ee 100%);
  box-shadow: 0 6px 22px rgba(180, 130, 20, .12);
}
.tl-close {
  position: absolute; top: 10px; right: 12px;
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid #fcd34d; background: #fff; color: #92400e;
  font-size: 14px; font-weight: 700; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, transform .15s;
}
.tl-close:hover { background: #fef3c7; transform: scale(1.06); }

.tl-head h2 {
  margin: 6px 0 8px; font-size: 20px; color: #7c2d12;
  display: flex; align-items: center; gap: 8px;
}
.tl-note {
  margin: 0; padding: 10px 12px; border-radius: 10px;
  background: #fff; border: 1px dashed #f59e0b;
  font-size: 13.5px; color: #92400e; line-height: 1.55;
}

.tl-prizes {
  display: grid; grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 10px; margin: 16px 0;
}
.tl-prize {
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px 12px; border-radius: 13px; text-align: center;
  border: 1px solid #e5e7eb; background: #fff;
}
.tl-prize-1 { border-color: #fcd34d; background: linear-gradient(165deg,#fffbeb,#fef3c7); }
.tl-prize-2 { border-color: #cbd5e1; background: linear-gradient(165deg,#f8fafc,#e2e8f0); }
.tl-prize-3 { border-color: #fdba74; background: linear-gradient(165deg,#fff7ed,#ffedd5); }
.tl-prize-top { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; color: #475569; }
.tl-prize-medal { font-size: 17px; }
.tl-prize-money { font-size: 19px; font-weight: 800; color: #0f172a; }
.tl-prize-fee { font-size: 11.5px; color: #64748b; }
.tl-prize-fee b { color: #15803d; }

.tl-privilege { margin-top: 6px; }
.tl-privilege h3 {
  margin: 0 0 8px; font-size: 15px; color: #7c2d12;
  display: flex; align-items: center; gap: 7px;
}
.tl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tl-list li {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 9px 11px; border-radius: 10px;
  background: rgba(255,255,255,.72); border: 1px solid #fde68a;
  font-size: 13px; color: #44403c; line-height: 1.5;
}
.tl-list li svg, .tl-list li i { flex: 0 0 auto; color: #b45309; margin-top: 2px; }
.tl-champion {
  background: linear-gradient(90deg,#fffbeb,#fef08a) !important;
  border-color: #facc15 !important;
  font-weight: 600;
}

.tl-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-top: 14px;
  padding-top: 12px; border-top: 1px dashed #fcd34d;
}
.tl-mine { font-size: 13px; color: #78350f; }
.tl-mine b { color: #92400e; }

@media (max-width: 700px) {
  .tl-card { padding: 16px 14px; }
  .tl-prizes { grid-template-columns: 1fr; }
  .tl-head h2 { font-size: 17px; }
  .tl-foot { flex-direction: column; align-items: stretch; }
  .tl-foot .btn { width: 100%; }
}

/* Phí "view ảo" hiển thị trên trang rút tiền */
.wd-fee {
  margin: 4px 0 14px; padding: 12px 14px; border-radius: 12px;
  border: 1px solid #e5e7eb; background: #f8fafc; display: grid; gap: 8px;
}
.wd-fee-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; font-size: 13.5px; color: #475569;
}
.wd-fee-row b { color: #0f172a; }
.wd-fee-net { padding-top: 8px; border-top: 1px dashed #cbd5e1; }
.wd-fee-net b { color: #15803d; font-size: 15px; }
.wd-fee-free { color: #15803d !important; }

/* Ghi chú view ảo — admin tự tính (không báo số % cụ thể) */
.wd-fee-note {
  padding-top: 9px; border-top: 1px dashed #cbd5e1;
  font-size: 12.5px; color: #64748b; line-height: 1.55;
}
.wd-fee-note b { color: #334155; }

/* Thống kê view của thành viên (admin — quyết định trừ view ảo khi rút) */
.vs-mini {
  margin-top: 5px; padding: 6px 8px; border-radius: 8px;
  background: #f8fafc; border: 1px solid #e2e8f0;
  font-size: 11.5px; line-height: 1.6; color: #475569;
}
.vs-mini b { color: #0f172a; }
.vs-ok { color: #15803d !important; }
.vs-bad { color: #b91c1c !important; }

/* Gợi ý trên form đăng nhập / quên mật khẩu */
.auth-hint {
  margin: 2px 0 12px; padding: 11px 13px; border-radius: 11px;
  background: #eff6ff; border: 1px solid #bfdbfe;
  font-size: 12.5px; line-height: 1.6; color: #1e40af;
}
.auth-hint b { color: #1d4ed8; }
