/* ==========================================================================
   STC-BROWSER PRO — ULTRA-FUTURISTIC CYBER GLASSMORPHIC DESIGN SYSTEM
   Commercial-Grade Anti-Detection SaaS UI & UX Engine (v3.8 Enterprise)
   ========================================================================== */

/* font hệ thống (không tải font qua Internet) — xem stc_theme.css */

:root {
  /* Biến CŨ của các màn chưa dựng lại: chỉ là BÍ DANH trỏ về token trong stc_theme.css (không mã màu cứng ở đây). */
  --bg-deep: var(--stc-bg); --bg-main: var(--stc-bg); --bg: var(--stc-bg); --bg-surface: var(--stc-surface); --bg-sidebar: var(--stc-side);
  --bg-card: var(--stc-surface); --bg-card-hover: var(--stc-surface-2); --bg-subcard: var(--stc-surface-2);
  --bg-input: var(--stc-input); --bg-input-focus: var(--stc-input); --bg-modal: var(--stc-surface);
  --border-subtle: var(--stc-border); --border-card: var(--stc-border); --border: var(--stc-border); --border-hover: var(--stc-border-strong);
  --border-active: var(--stc-accent); --border-neon-cyan: var(--stc-border);
  --text-main: var(--stc-text); --text: var(--stc-text); --text-muted: var(--stc-muted); --text-dim: var(--stc-dim); --text-bright: var(--stc-text-strong);
  --accent-indigo: var(--stc-accent-text); --accent-indigo-light: var(--stc-accent-text); --accent-cyan: var(--stc-accent-text);
  --accent-cyan-bright: var(--stc-accent-text); --accent-purple: var(--stc-accent-text); --accent-gold: var(--stc-accent-text);
  --accent-emerald: var(--stc-ok); --accent-emerald-bright: var(--stc-ok); --accent-rose: var(--stc-err); --accent-amber: var(--stc-warn);
  /* gradient/glow cũ: phẳng hóa (nền đen-vàng không gradient, không quầng sáng) */
  --gradient-brand: var(--stc-accent); --gradient-brand-shine: var(--stc-accent); --gradient-btn-primary: var(--stc-accent);
  --gradient-btn-success: var(--stc-ok); --gradient-btn-danger: var(--stc-err); --gradient-gold: var(--stc-accent); --gradient-card-glass: none;
  --shadow-glow-cyan: none; --shadow-glow-indigo: none; --shadow-glow-emerald: none;
  --shadow-card: var(--stc-shadow-sm); --shadow-card-hover: var(--stc-shadow-sm);
  --radius-sm: var(--stc-r-ctl); --radius-md: var(--stc-r-card); --radius-lg: var(--stc-r-dlg); --radius-xl: var(--stc-r-dlg);
}

/* ==========================================================================
   Base & Resets
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  user-select: none;
}

body {
  background: var(--bg-deep);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  display: flex;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

/* High-Tech Custom Scrollbars */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--stc-fill-2);
  border-radius: 4px;
  border: 1px solid var(--stc-line);
}
::-webkit-scrollbar-thumb:hover { background: var(--stc-fill-2); }

/* ==========================================================================
   Ambient Cyber Lighting Background
   ========================================================================== */
.cyber-ambient {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ambient-glow {
  position: absolute;
  border-radius: 50%;
  filter: none;
  opacity: 0.18;
  animation: floatAmbient 18s ease-in-out infinite alternate;
}

.ambient-glow.glow-1 {
  width: 550px; height: 550px;
  top: -120px; left: 10%;
  background: none;
}

.ambient-glow.glow-2 {
  width: 650px; height: 650px;
  bottom: -150px; right: 5%;
  background: none;
  animation-duration: 22s;
  animation-delay: -5s;
}

.ambient-glow.glow-3 {
  width: 400px; height: 400px;
  top: 35%; left: 45%;
  background: none;
  opacity: 0.12;
  animation-duration: 26s;
  animation-delay: -10s;
}

@keyframes floatAmbient {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -30px) scale(1.08); }
  100% { transform: translate(-30px, 40px) scale(0.95); }
}

.cyber-grid-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image:none;
  background-size: 40px 40px;
  opacity: 0.6;
}

/* ==========================================================================
   Toast Notification System (Floating Top-Right)
   ========================================================================== */
.toast-container {
  position: fixed;
  top: 24px;
  right: 28px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 320px;
  max-width: 420px;
  background: var(--stc-toast-bg);
  backdrop-filter: none;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  box-shadow: var(--stc-shadow);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transform: translateX(120%);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast.toast-success {
  border-color: var(--stc-border);
  box-shadow: var(--stc-shadow);
}
.toast.toast-error {
  border-color: var(--stc-border);
  box-shadow: var(--stc-shadow);
}
.toast.toast-info {
  border-color: var(--stc-border);
  box-shadow: var(--stc-shadow);
}
.toast.toast-warn {
  border-color: var(--stc-border);
  box-shadow: var(--stc-shadow);
}

.toast-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--stc-text-strong);
  margin-bottom: 2px;
}

.toast-msg {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2.5px;
  background: var(--accent-indigo);
  width: 100%;
}
.toast-success .toast-progress { background: var(--accent-emerald); }
.toast-error .toast-progress { background: var(--accent-rose); }
.toast-info .toast-progress { background: var(--accent-cyan); }
.toast-warn .toast-progress { background: var(--accent-gold); }

/* ==========================================================================
   Cyber Confirmation Dialog
   ========================================================================== */
.confirm-dialog-box {
  max-width: 440px !important;
  text-align: center;
  padding: 30px 28px !important;
  border-radius: var(--radius-lg) !important;
  border: 1px solid var(--stc-border) !important;
  background: var(--stc-toast-bg) !important;
  box-shadow: var(--stc-shadow) !important;
}

.confirm-dialog-icon {
  font-size: 42px;
  margin-bottom: 12px;
  display: inline-block;
  animation: pulseWarning 1.5s infinite;
}

@keyframes pulseWarning {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); filter: none; }
  100% { transform: scale(1); }
}

.confirm-dialog-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--stc-text-strong);
  margin-bottom: 8px;
}

.confirm-dialog-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 24px;
}

.confirm-dialog-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.confirm-dialog-actions .btn {
  flex: 1;
  justify-content: center;
  padding: 11px 18px;
}

/* ==========================================================================
   Sidebar (High-Tech Left Cockpit)
   ========================================================================== */
.sidebar {
  width: 255px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: relative;
  z-index: 20;
  backdrop-filter: none;
}

.brand {
  padding: 22px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--border-subtle);
  background: none;
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: var(--gradient-brand);
  border-radius: var(--stc-r-dlg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  position: relative;
  box-shadow: var(--shadow-glow-indigo);
  flex-shrink: 0;
}

.brand-glow-ring {
  position: absolute;
  top: -2px; left: -2px; right: -2px; bottom: -2px;
  border-radius: var(--stc-r-dlg);
  background: var(--gradient-brand);
  z-index: -1;
  opacity: 0.5;
  filter: none;
  animation: glowPulse 3s infinite alternate;
}

@keyframes glowPulse {
  0% { opacity: 0.3; transform: scale(0.98); }
  100% { opacity: 0.7; transform: scale(1.04); }
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-text h1 {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--stc-text-strong);   /* bỏ chữ gradient: nhấn bằng độ đậm, màu vàng của token */
}

.brand-tag {
  font-size: 10px;
  font-weight: 800;
  background: var(--gradient-brand);
  color: var(--stc-text-strong);
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.8px;
}

.brand-sub {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block;
  margin-top: 2px;
}

.nav-menu {
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  background: transparent;
  border: 1px solid transparent;
}

.nav-icon-box {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--stc-r-card);
  color: var(--text-dim);
  background: transparent;
  border: 1.5px solid transparent;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

.nav-svg {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-item:hover .nav-svg {
  transform: scale(1.06);
}

@media (prefers-reduced-motion: reduce) {
  .nav-item:hover .nav-svg { transform: none; }
}

.nav-item:hover {
  background: var(--stc-fill-1);
  color: var(--stc-text-strong);
  transform: translateX(2px);
}

.nav-item:hover .nav-icon-box {
  color: var(--stc-text);
  background: var(--stc-fill-1);
  border-color: var(--stc-border-strong);
}

.nav-item.active {
  background: var(--stc-fill-2);
  color: var(--stc-text-strong);
  border: 1px solid var(--stc-border-strong);
}

.nav-item.active .nav-icon-box {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--stc-accent-text);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  background: var(--accent-cyan-bright);
  border-radius: 0 4px 4px 0;
  box-shadow: none;
}

.nav-label {
  flex: 1;
}

.nav-badge {
  font-size: 11px;
  font-weight: 700;
  background: var(--stc-fill-2);
  color: var(--text-muted);
  padding: 1px 7px;
  border-radius: var(--stc-r-card);
  font-family: 'JetBrains Mono', monospace;
}

.nav-pill-tag {
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  background: var(--stc-fill-2);
  color: var(--accent-cyan);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--stc-border);
}

.nav-pill-tag.vip {
  background: var(--stc-fill-2);
  color: var(--accent-gold);
  border-color: var(--stc-border);
}

/* Sidebar Engine Status Card */
.sidebar-stats {
  padding: 16px;
  border-top: 1px solid var(--border-subtle);
  background: var(--stc-surface-2);
}

.engine-status-card {
  background: var(--stc-fill-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-emerald);
  margin-bottom: 8px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: none;
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 color-mix(in srgb, var(--stc-ok) 70%, transparent); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px color-mix(in srgb, var(--stc-ok) 0%, transparent); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 color-mix(in srgb, var(--stc-ok) 0%, transparent); }
}

.engine-details {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.6;
}

.engine-footer-strip {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--stc-line);
  display: flex;
  justify-content: flex-end;
}

.shield-active-pill {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-cyan);
  background: var(--stc-fill-2);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ==========================================================================
   Main Content Wrapper & Topbar
   ========================================================================== */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 10;
  overflow: hidden;
  overflow: clip;      /* 13/11: 'hidden' vẫn cuộn được bằng lệnh => scrollIntoView (Cài đặt > Cập nhật) đẩy thanh trên + cột mục ra khỏi màn hình; 'clip' không cuộn được */
  min-width: 0;        /* 'hidden' tự cho phần tử flex co về 0, 'clip' thì KHÔNG => phải đặt tường minh, nếu không khung giãn theo nội dung và trang tràn ngang ở cửa sổ hẹp */
  min-height: 0;
}



.breadcrumb-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.breadcrumb-hub {
  color: var(--accent-indigo-light);
}

.breadcrumb-current {
  color: var(--text-muted);
}

.page-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.2px;
  color: var(--stc-text-strong);
}


.system-health-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--stc-fill-2);
  border: 1px solid var(--stc-border);
  border-radius: var(--stc-r-dlg);
  padding: 6px 14px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.health-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: none;
  animation: pulseDot 2s infinite;
}

.health-text {
  color: var(--accent-emerald);
}

.health-divider {
  color: var(--stc-dim);
}

.health-ping {
  color: var(--accent-cyan);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
}


.search-box {
  position: relative;
}

.search-box input {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  padding: 9px 65px 9px 36px;
  font-size: 13px;
  outline: none;
  width: 250px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.search-box input:focus {
  border-color: var(--accent-cyan);
  box-shadow: none;
  width: 290px;
  background: var(--bg-input-focus);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 13px;
}

.search-kbd-hint {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-dim);
  background: var(--stc-fill-1);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--stc-border);
  pointer-events: none;
}

/* ==========================================================================
   Tactile Cyber Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: none;
  position: relative;
  overflow: hidden;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--gradient-btn-primary);
  color: var(--stc-accent-ink);
  border: 1px solid var(--stc-border);
}
.btn-primary:hover {
  box-shadow: none;
  transform: translateY(-1px);
}

.btn-success {
  background: var(--gradient-btn-success);
  color: var(--stc-ink-on-solid);
}
.btn-success:hover {
  box-shadow: none;
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--gradient-btn-danger);
  color: var(--stc-ink-on-solid);
}
.btn-danger:hover {
  box-shadow: none;
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--stc-fill-1);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}
.btn-secondary:hover {
  background: var(--stc-fill-2);
  border-color: var(--stc-border-strong);
  transform: translateY(-1px);
}

.btn-tile {
  background: var(--stc-fill-2) !important;
  border-color: var(--stc-border) !important;
  color: var(--stc-info-text) !important;
}
.btn-tile:hover {
  background: var(--stc-fill-2) !important;
  box-shadow: none !important;
}

.btn-ecom {
  background: var(--stc-fill-2) !important;
  border-color: var(--stc-border) !important;
  color: var(--stc-gold-text) !important;
}
.btn-ecom:hover {
  background: var(--stc-fill-2) !important;
  box-shadow: none !important;
}

.btn-sm {
  padding: 6px 13px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-xs {
  padding: 3px 8px;
  font-size: 11px;
  border-radius: var(--radius-sm);
}

.btn-action-group {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
}

.btn-action-group .btn-secondary.btn-sm {
  width: 30px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--stc-r-ctl);
  color: var(--stc-muted);
  background: var(--stc-fill-1);
  border: 1px solid var(--stc-border);
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.btn-action-group .btn-secondary.btn-sm:hover {
  color: var(--stc-text-strong);
  background: var(--stc-fill-2);
  border-color: var(--stc-border-strong);
  transform: translateY(-1px);
}

.btn-action-group .btn-secondary.btn-sm:hover[style*="accent-rose"] {
  background: var(--stc-err-soft) !important;
  border-color: var(--stc-border-strong) !important;
  color: var(--stc-err-text) !important;
}

/* ==========================================================================
   Metrics Overview Dashboard (4 Luminous Glass Cards)
   ========================================================================== */
.metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 20px 28px 0 28px;
  flex-shrink: 0;
}

.metric-card {
  background: var(--bg-card);
  backdrop-filter: none;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.metric-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: var(--gradient-brand);
  opacity: 0.6;
}

.card-glow-indigo:hover { border-color: var(--stc-border-strong); }
.card-glow-emerald:hover { border-color: var(--stc-border-strong); }
.card-glow-cyan:hover { border-color: var(--stc-border-strong); }
.card-glow-purple:hover { border-color: var(--stc-border-strong); }

.metric-data {
  flex: 1;
}

.metric-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 4px;
}

.metric-value-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.metric-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--stc-text-strong);
  letter-spacing: -0.5px;
  font-family: 'JetBrains Mono', monospace;
}

.metric-sub-tag {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
}

.metric-radar-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--stc-fill-2);
  border: 1px solid var(--stc-border);
  color: var(--accent-emerald);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--stc-r-card);
  letter-spacing: 0.5px;
}

.radar-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: none;
  animation: pulseDot 1.5s infinite;
}

.metric-mini-chips {
  display: flex;
  gap: 5px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.mini-chip {
  font-size: 10px;
  background: var(--stc-fill-1);
  color: var(--text-muted);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--stc-line);
}

.mini-chip.highlight {
  color: var(--accent-cyan);
  border-color: var(--stc-border);
  background: var(--stc-fill-2);
}

.mini-chip.success {
  color: var(--accent-emerald);
  border-color: var(--stc-border);
  background: var(--stc-fill-2);
}

.btn-micro-link {
  background: transparent;
  border: none;
  color: var(--accent-rose);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 0 0 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-micro-link:hover { text-decoration: underline; }

.metric-badge {
  width: 44px;
  height: 44px;
  border-radius: var(--stc-r-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.metric-indigo { background: var(--stc-fill-2); border: 1px solid var(--stc-border); }
.metric-emerald { background: var(--stc-fill-2); border: 1px solid var(--stc-border); }
.metric-cyan { background: var(--stc-fill-2); border: 1px solid var(--stc-border); }
.metric-purple { background: var(--stc-fill-2); border: 1px solid var(--stc-border); }

/* ==========================================================================
   Views Container & Filter Pills Toolbar
   ========================================================================== */
.views-container {
  flex: 1;
  padding: 18px 28px;
  overflow-y: auto;
}

.tab-view { display: none; height: 100%; }
.tab-view.active { display: block; }

.filter-pills-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 12px;
}

.pills-group {
  display: flex;
  gap: 6px;
  background: var(--stc-surface-2);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  backdrop-filter: none;
}

.pill-btn {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.pill-svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  vertical-align: middle;
}

.pill-btn:hover { color: var(--stc-text-strong); background: var(--stc-fill-1); }

.pill-btn.active {
  background: var(--stc-fill-2);
  color: var(--stc-text-strong);
  border: 1px solid var(--stc-border-strong);
  box-shadow: none;
}

.pill-count {
  font-size: 10.5px;
  font-family: 'JetBrains Mono', monospace;
  background: var(--stc-fill-2);
  padding: 1px 6px;
  border-radius: var(--stc-r-card);
  font-weight: 700;
}
.pill-btn.active .pill-count {
  background: var(--accent-indigo);
  color: var(--stc-text-strong);
}

/* Country Badge Vector Styling */
.country-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--stc-fill-1);
  border: 1px solid var(--stc-border);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 11.5px;
  color: var(--text-main);
}

.country-code-pill {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 10px;
  color: var(--accent-cyan);
  background: var(--stc-fill-2);
  border: 1px solid var(--stc-border);
  padding: 1px 4px;
  border-radius: 3px;
  line-height: 1.2;
}

.warmer-icon-box {
  width: 32px;
  height: 32px;
  border-radius: var(--stc-r-card);
  background: var(--stc-fill-1);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
  flex-shrink: 0;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spin {
  animation: spin 1s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

.batch-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.selected-counter {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-cyan);
  background: var(--stc-fill-2);
  border: 1px solid var(--stc-border-strong);
  padding: 6px 14px;
  border-radius: var(--stc-r-dlg);
  display: inline-flex;
  align-items: center;
}

.btn-batch-del {
  color: var(--accent-rose) !important;
  border-color: var(--stc-border) !important;
}
.btn-batch-del:hover {
  background: var(--stc-err-soft) !important;
  border-color: var(--accent-rose) !important;
}

/* ==========================================================================
   Commercial-Grade High-Tech Table
   ========================================================================== */
.table-card {
  background: var(--bg-card);
  backdrop-filter: none;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.table-responsive {
  max-height: calc(100vh - 290px);
  overflow-y: auto;
  overflow-x: auto;
}

.bit-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.bit-table th {
  background: var(--stc-surface-2);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 10;
}

.bit-table td {
  padding: 12px 16px;
  font-size: 12.5px;
  border-bottom: 1px solid var(--stc-line);
  vertical-align: middle;
  transition: background 0.15s ease;
}

.bit-table tbody tr:hover td {
  background: var(--stc-fill-2);
}

/* Checkbox Modern Cyber Styling */
input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-indigo);
  cursor: pointer;
  vertical-align: middle;
}

/* OS & Platform Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: var(--stc-r-ctl);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.badge-win { background: var(--stc-fill-2); color: var(--stc-blue-text); border: 1px solid var(--stc-border); }
.badge-mac { background: var(--stc-fill-2); color: var(--stc-purple-text); border: 1px solid var(--stc-border); }
.badge-android { background: var(--stc-fill-2); color: var(--stc-ok-text); border: 1px solid var(--stc-border); }
.badge-ios { background: var(--stc-fill-2); color: var(--stc-rose-text); border: 1px solid var(--stc-border); }
.badge-linux { background: var(--stc-fill-2); color: var(--stc-gold-text); border: 1px solid var(--stc-border); }

.badge-running {
  background: var(--stc-fill-2);
  color: var(--stc-ok-text);
  border: 1px solid var(--stc-border);
  box-shadow: none;
}

.badge-stopped {
  background: var(--stc-fill-2);
  color: var(--text-dim);
  border: 1px solid var(--stc-border);
}

/* Section Tag Pills */
.section-tag-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--stc-fill-2);
  color: var(--accent-indigo-light);
  border: 1px solid var(--stc-border);
}
.section-tag-pill.gold {
  background: var(--stc-fill-2);
  color: var(--accent-gold);
  border-color: var(--stc-border);
}
.section-tag-pill.cyan {
  background: var(--stc-fill-2);
  color: var(--accent-cyan);
  border-color: var(--stc-border);
}
.section-tag-pill.purple {
  background: var(--stc-fill-2);
  color: var(--accent-purple);
  border-color: var(--stc-border);
}
.section-tag-pill.green {
  background: var(--stc-fill-2);
  color: var(--accent-emerald);
  border-color: var(--stc-border);
}
.section-tag-pill.orange {
  background: var(--stc-fill-2);
  color: var(--stc-orange-text);
  border-color: var(--stc-border);
}

/* Proxy Cell & Flags */
.proxy-flag-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.proxy-ip-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-main);
  font-family: 'JetBrains Mono', Consolas, monospace;
}

.latency-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--stc-r-card);
  background: var(--stc-fill-2);
  color: var(--accent-emerald);
  border: 1px solid var(--stc-border);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* ==========================================================================
   Mobile Farm View (Realistic Phone Frames)
   ========================================================================== */
.mobile-farm-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  background: var(--bg-card);
  padding: 22px 26px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
}

.mobile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
  overflow-y: auto;
  max-height: calc(100vh - 290px);
  padding-bottom: 20px;
}

.mobile-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
  position: relative;
  box-shadow: var(--shadow-card);
}

.mobile-card:hover {
  transform: translateY(-3px);
  border-color: var(--stc-border-strong);
  box-shadow: none;
}

.mobile-card-top {
  display: flex;
  gap: 14px;
  margin-bottom: 14px;
}

.mobile-phone-frame {
  width: 62px;
  height: 114px;
  background: var(--stc-bg);
  border: 2.5px solid var(--stc-border);
  border-radius: var(--stc-r-dlg);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: none;
}

.mobile-phone-notch {
  width: 26px;
  height: 5px;
  background: var(--stc-surface-2);
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
  position: absolute;
  top: 0;
}

.mobile-phone-screen {
  width: 100%;
  height: 100%;
  background: var(--stc-surface-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.mobile-info { flex: 1; }
.mobile-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--stc-text-strong);
  line-height: 1.3;
}
.mobile-specs {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 5px;
  line-height: 1.6;
}

/* ==========================================================================
   E-Commerce Golden Presets View
   ========================================================================== */
.ecommerce-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
  margin-top: 14px;
}

.ecommerce-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
  position: relative;
  box-shadow: var(--shadow-card);
}

.ecommerce-card:hover {
  transform: translateY(-3px);
  border-color: var(--stc-border-strong);
  box-shadow: none;
}

.ecommerce-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.ecommerce-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--stc-r-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: var(--stc-fill-2);
  border: 1px solid var(--stc-border);
}

.ecommerce-card-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.ecommerce-card-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.ecommerce-badge-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.ecommerce-specs-list {
  list-style: none;
  padding: 0;
  margin: 0 0 14px 0;
  flex: 1;
}

.ecommerce-specs-list li {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.45;
}

.ecommerce-specs-list li span.bullet {
  color: var(--accent-emerald);
  font-size: 12px;
}

.ecommerce-proxy-tip {
  background: var(--stc-surface-2);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 11px;
  color: var(--text-dim);
  border: 1px solid var(--stc-border);
  margin-bottom: 14px;
  line-height: 1.4;
}

.modal-ecommerce-wide {
  max-width: 1120px !important;
  width: 95% !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;              /* chỉ phần thân cuộn; tiêu đề + nút đóng (×) đứng yên, luôn thấy */
}
.modal-ecommerce-wide > .modal-header { flex: 0 0 auto; }
.modal-ecommerce-wide > .modal-header + div {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.modal-ecommerce-wide .modal-header p { overflow-wrap: anywhere; }
/* màn thấp (vd. 1366x768 phóng 150% => cao ~512px): thu gọn tiêu đề để dành chỗ cho danh sách mẫu */
@media (max-height: 640px) {
  .modal-overlay { padding: 8px; }
  .modal-content { max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); }
  .modal-ecommerce-wide .modal-header { padding: 10px 18px; }
  .modal-ecommerce-wide .modal-header p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; }
  .modal-ecommerce-wide .modal-header + div { padding: 14px 18px !important; }
}

/* ==========================================================================
   Security Audit Grid
   ========================================================================== */
.audit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 10px;
}

.audit-card {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.2s ease;
}

.audit-card:hover {
  border-color: var(--stc-border-hover);
  transform: translateY(-2px);
  box-shadow: none;
}

.audit-icon { font-size: 32px; margin-bottom: 2px; }
.audit-card h4 { font-size: 15px; font-weight: 800; color: var(--stc-text-strong); }
.audit-card p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
  flex: 1;
}

.audit-target-btn {
  justify-content: flex-start !important;
  text-align: left !important;
  padding: 12px 16px !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
}

.audit-picker-icon { font-size: 20px; }
.audit-picker-title { font-weight: 700; color: var(--stc-text-strong); }
.audit-picker-sub { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

/* Proxy Tester Box */
.proxy-tester-box {
  background: var(--bg-input);
  padding: 20px 22px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  max-width: 860px;
}

/* Feature Matrix List */
.feature-box {
  background: var(--stc-fill-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.feature-info h4 {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--stc-text-strong);
  margin-bottom: 2px;
}

.feature-info p {
  font-size: 12px;
  color: var(--text-muted);
}

/* Warmer Preset Cards */
.warmer-preset-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}
.warmer-preset-card:hover {
  border-color: var(--border-hover);
  background: var(--stc-fill-1);
}
.warmer-preset-card.active {
  background: var(--stc-fill-2);
  border-color: var(--stc-border-hover);
  box-shadow: none;
}

.warmer-profile-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--stc-fill-1);
  border: 1px solid transparent;
  transition: all 0.15s ease;
}
.warmer-profile-item:hover {
  background: var(--stc-fill-1);
  border-color: var(--border-subtle);
}

.warmer-log-line {
  margin-bottom: 4px;
  word-break: break-all;
}

/* Form Controls */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 7px;
}

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  padding: 10px 14px;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  border-color: var(--accent-indigo);
  box-shadow: none;
}

/* ==========================================================================
   Modals & BitBrowser Pro Digital Twin Dialog
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--stc-scrim);
  backdrop-filter: none;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;                 /* hộp luôn cách mép cửa sổ, không dính/cắt ở màn nhỏ */
  opacity: 0;
  pointer-events: none;
  visibility: hidden;            /* hộp ĐÃ ĐÓNG không nhận Tab/trình đọc màn hình (opacity:0 vẫn để nút bên trong lấy tiêu điểm); ẩn SAU khi mờ xong */
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s linear 0.25s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s;
}

.modal-content {
  background: var(--bg-modal);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--stc-shadow);
  width: 90%;
  max-width: 680px;
  max-height: calc(100vh - 32px);   /* không bao giờ cao hơn cửa sổ: phần dư cuộn trong hộp thay vì bị cắt/tràn */
  max-height: calc(100dvh - 32px);
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
  transform: translateY(16px) scale(0.98);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.open .modal-content {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--stc-surface-2);
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--stc-text-strong);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s;
}
.modal-close:hover { color: var(--stc-text-strong); }

/* BitModal Dialog (Twin Format) */
.bit-modal-dialog {
  width: 980px !important;
  max-width: 95vw !important;
  max-height: 90vh !important;
  background: var(--dlg-bg) !important;
  border: 1px solid var(--dlg-border) !important;
  border-radius: var(--stc-r-dlg) !important;
  box-shadow: var(--dlg-shadow) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  padding: 0 !important;
}

.bit-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 26px;
  background: var(--dlg-head-bg);
  border-bottom: 1px solid var(--border-subtle);
}

.bit-modal-header-title {
  font-size: 16.5px;
  font-weight: 800;
  color: var(--dlg-title);
  letter-spacing: -0.2px;
}

.bit-modal-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s;
}
.bit-modal-close:hover { color: var(--dlg-hover-text); }

.bit-modal-main {
  display: flex;
  flex: 1;
  min-height: 520px;
  max-height: calc(90vh - 130px);
  overflow: hidden;
}

/* Left Icon Navigation Bar */
.bit-modal-sidebar {
  width: 64px;
  background: var(--dlg-rail-bg);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0;
  gap: 12px;
  flex-shrink: 0;
}

.bit-sidebar-tab {
  width: 42px;
  height: 42px;
  border-radius: var(--stc-r-card);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  background: transparent;
  border: none;
}

.bit-sidebar-tab:hover {
  color: var(--dlg-muted);
  background: var(--dlg-tint-1);
}

.bit-sidebar-tab.active {
  color: var(--accent-cyan);
  background: var(--stc-fill-2);
}

.bit-sidebar-tab.active::before {
  content: "";
  position: absolute;
  left: -11px;
  top: 7px;
  bottom: 7px;
  width: 3.5px;
  background: var(--accent-cyan);
  border-radius: 0 3px 3px 0;
  box-shadow: none;
}

/* Modal Body & Panes */
.bit-modal-body {
  flex: 1;
  padding: 24px 30px;
  overflow-y: auto;
  background: var(--dlg-body-bg);
}

.bit-tab-pane {
  display: block;
  margin-bottom: 28px;
  scroll-margin-top: 14px;
}

.bit-section-title {
  font-size: 15.5px;
  font-weight: 800;
  color: var(--dlg-strong);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  letter-spacing: -0.2px;
}

.bit-title-pipe {
  color: var(--accent-indigo);
  font-weight: 900;
  font-size: 18px;
}

.bit-action-links {
  margin-left: auto;
  font-size: 12.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bit-action-btn-link {
  background: transparent;
  border: none;
  color: var(--accent-cyan);
  cursor: pointer;
  font-size: 12.5px;
  padding: 2px 4px;
}
.bit-action-btn-link:hover { text-decoration: underline; }

.bit-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 14px;
}

.bit-form-col {
  display: flex;
  flex-direction: column;
}

.bit-form-group {
  margin-bottom: 14px;
}

.bit-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--dlg-muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.bit-info-icon {
  font-size: 12px;
  color: var(--text-dim);
  cursor: help;
  font-weight: normal;
}

.bit-required { color: var(--accent-rose); }

.bit-input,
.bit-select,
.bit-textarea {
  width: 100%;
  background: var(--dlg-field-bg);
  border: 1px solid var(--dlg-field-border);
  border-radius: var(--stc-r-card);
  color: var(--dlg-text);
  padding: 9px 13px;
  font-size: 13px;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bit-input:focus,
.bit-select:focus,
.bit-textarea:focus {
  border-color: var(--accent-indigo);
  outline: none;
  box-shadow: 0 0 0 1px var(--stc-accent);
  background: var(--dlg-field-bg-focus);
}

.bit-input::placeholder,
.bit-textarea::placeholder { color: var(--dlg-placeholder); }

.bit-input-with-counter {
  position: relative;
  width: 100%;
}
.bit-input-with-counter .bit-input { padding-right: 58px; }

.bit-counter {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--text-dim);
  pointer-events: none;
  font-family: 'JetBrains Mono', monospace;
}

.bit-input-clearable {
  position: relative;
  width: 100%;
}
.bit-input-clearable .bit-input { padding-right: 32px; }

.bit-btn-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  padding: 2px 4px;
}
.bit-btn-clear:hover { color: var(--dlg-hover-text); }

/* Normal-flow button for panels/modals (NOT absolute like .bit-btn-clear, which
   is an in-input clear button). Using .bit-btn-clear on panel buttons made them
   jump to right:8px/top:50% and overlap each other. */
.stc-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--stc-fill-2);
  border: 1px solid var(--stc-border);
  color: var(--stc-accent-text);
  border-radius: var(--stc-r-ctl);
  font-size: 13px;
  cursor: pointer;
  padding: 7px 12px;
  white-space: nowrap;
}
.stc-btn:hover { background: var(--stc-fill-2); color: var(--stc-text-strong); }
.stc-btn.sm { padding: 2px 8px; font-size: 11px; }

.bit-input-with-btn {
  display: flex;
  gap: 8px;
  width: 100%;
}

.bit-input-icon-btn {
  background: var(--dlg-iconbtn-bg);
  border: 1px solid var(--dlg-iconbtn-border);
  border-radius: var(--stc-r-card);
  color: var(--dlg-muted);
  padding: 0 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.bit-input-icon-btn:hover {
  background: var(--dlg-iconbtn-bg-hover);
  color: var(--dlg-hover-text);
}

.bit-radio-group {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 38px;
}

.bit-radio-label,
.bit-chk-label {
  font-size: 13px;
  color: var(--dlg-soft);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.bit-radio-label input[type="radio"],
.bit-chk-label input[type="checkbox"] {
  accent-color: var(--accent-indigo);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.bit-pill-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.bit-pill-btn {
  padding: 6px 16px;
  border-radius: var(--stc-r-card);
  background: var(--dlg-field-bg);
  border: 1px solid var(--dlg-field-border);
  color: var(--dlg-muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.bit-pill-btn:hover {
  border-color: var(--stc-border-hover);
  color: var(--dlg-strong);
}

.bit-pill-btn.active {
  background: var(--stc-fill-2);
  border-color: var(--stc-border-hover);
  color: var(--accent-indigo-light);
}

.bit-subcard {
  background: var(--dlg-subcard-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--stc-r-card);
  padding: 18px 20px;
  margin-bottom: 16px;
}

.bit-subcard-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--dlg-strong);
  margin-bottom: 14px;
}

.bit-setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--dlg-row-line);
}
.bit-setting-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.bit-setting-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--dlg-setting-title);
}

.bit-setting-sub {
  font-size: 11.5px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* Switch Toggle */
.bit-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}

.bit-switch input { opacity: 0; width: 0; height: 0; }

.bit-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--dlg-track);
  transition: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: var(--stc-r-dlg);
  border: 1px solid var(--stc-border);
}

.bit-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: var(--dlg-knob);
  transition: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 50%;
}

input:checked + .bit-slider {
  background-color: var(--accent-indigo);
  border-color: var(--accent-indigo);
}

input:checked + .bit-slider:before {
  transform: translateX(18px);
  background-color: var(--stc-accent-ink);
}

.bit-alert-warning {
  background: var(--stc-warn-soft);
  border: 1px solid var(--stc-border);
  color: var(--accent-gold);
  border-radius: var(--stc-r-card);
  padding: 10px 14px;
  font-size: 12px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bit-ua-box {
  position: relative;
  width: 100%;
}

.bit-ua-textarea {
  width: 100%;
  background: var(--dlg-field-bg);
  border: 1px solid var(--dlg-field-border);
  border-radius: var(--stc-r-card);
  color: var(--dlg-muted);
  padding: 10px 65px 10px 12px;
  font-size: 12px;
  font-family: 'JetBrains Mono', Consolas, monospace;
  resize: none;
  box-sizing: border-box;
}

.bit-btn-change-ua {
  position: absolute;
  right: 8px;
  bottom: 10px;
  background: var(--stc-fill-2);
  border: 1px solid var(--stc-border);
  color: var(--accent-cyan);
  border-radius: var(--stc-r-ctl);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}
.bit-btn-change-ua:hover {
  background: var(--accent-cyan);
  color: var(--dlg-onaccent);
}

.bit-shield-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.bit-tag {
  background: var(--dlg-tag-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--stc-r-ctl);
  color: var(--text-muted);
  font-size: 11px;
  padding: 4px 10px;
}

/* Modal Footer */
.bit-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 26px;
  background: var(--dlg-rail-bg);
  border-top: 1px solid var(--border-subtle);
}

.bit-btn-random-all {
  background: var(--stc-accent);
  color: var(--stc-accent-ink);
  border: none;
  padding: 10px 20px;
  border-radius: var(--stc-r-card);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: none;
}
.bit-btn-random-all:hover {
  box-shadow: none;
  transform: translateY(-1px);
}

.bit-footer-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bit-btn-cancel {
  background: var(--dlg-tint-1);
  border: 1px solid var(--border-subtle);
  color: var(--dlg-soft);
  padding: 10px 22px;
  border-radius: var(--stc-r-card);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.bit-btn-cancel:hover {
  background: var(--dlg-tint-2);
  color: var(--dlg-hover-text);
}

.bit-btn-confirm {
  background: var(--gradient-btn-primary);
  color: var(--stc-accent-ink);
  border: none;
  padding: 10px 28px;
  border-radius: var(--stc-r-card);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: none;
}
.bit-btn-confirm:hover {
  box-shadow: none;
  transform: translateY(-1px);
}/* Cloud Phone: giao diện nằm ở static/css/cloudphone.css (token --stc-*). */