/* ==========================================================================
   Xeno Seller Operational App Stylesheet (Comprehensive)
   Exact styling matching Xeno Seller internal operational tool
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Mulish:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,600&display=swap');

:root, [data-theme="mocha"], [data-theme="brown"], [data-theme="slate"] {
  /* Dark Brown / Rich Mocha Sidebar Theme (Màu Nâu Sang Trọng) */
  --sidebar-bg: #281a14;
  --sidebar-card-bg: #38251e;
  --sidebar-card-hover: #4a3228;
  --sidebar-border: rgba(235, 195, 165, 0.18);
  --sidebar-text: #fdf7f2;
  --sidebar-muted: #cbb3a3;
  --sidebar-heading: #dfa46e;
  
  /* App Workspace Theme - Warm Sand & Ivory Harmony */
  --app-bg: #f6f2ec;
  --app-card: #ffffff;
  --app-card-border: #e6ded5;
  --app-ink: #22140f;
  --app-text: #34221a;
  --app-muted: #755f52;
  --app-line: #e6ded5;
  
  /* Accent Colors */
  --shopee-orange: #ee4d2d;
  --tiktok-dark: #20140f;
  --telegram-blue: #2394df;
  --telegram-hover: #1b7ec0;
  --emerald-rec: #10b981;
  --emerald-rec-bg: #e6f9ed;
  --rose-alert: #e11d48;
  --rose-soft: #ffe4e6;
  
  /* Radii */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;
  --r-full: 9999px;
  
  /* Shadows */
  --shadow-card: 0 1px 3px rgba(40, 26, 20, 0.05), 0 4px 14px rgba(40, 26, 20, 0.04);
  --shadow-modal: 0 20px 48px -8px rgba(40, 26, 20, 0.35), 0 8px 16px -4px rgba(40, 26, 20, 0.15);
}

[data-theme="dark"] {
  --sidebar-bg: #07090e;
  --sidebar-card-bg: #0f1422;
  --sidebar-card-hover: #182035;
  --sidebar-border: rgba(255, 255, 255, 0.08);
  --sidebar-text: #f8fafc;
  --sidebar-muted: #94a3b8;
  --sidebar-heading: #64748b;
  
  --app-bg: #0a0e17;
  --app-card: #121826;
  --app-card-border: rgba(255, 255, 255, 0.08);
  --app-ink: #f8fafc;
  --app-text: #e2e8f0;
  --app-muted: #94a3b8;
  --app-line: rgba(255, 255, 255, 0.08);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.4);
}

[data-theme="sapphire"] {
  --sidebar-bg: #0c2340;
  --sidebar-card-bg: #13325b;
  --sidebar-card-hover: #1c457a;
  --sidebar-border: rgba(255, 255, 255, 0.1);
  --sidebar-text: #f0f7ff;
  --sidebar-muted: #93c5fd;
  --sidebar-heading: #60a5fa;
  
  --app-bg: #eef6ff;
  --app-card: #ffffff;
  --app-card-border: #bfdbfe;
  --app-ink: #0c4a6e;
  --app-text: #1e3a5f;
  --app-muted: #475569;
  --app-line: #dbeafe;
}

[data-theme="emerald"] {
  --sidebar-bg: #063528;
  --sidebar-card-bg: #0b4938;
  --sidebar-card-hover: #12634d;
  --sidebar-border: rgba(255, 255, 255, 0.1);
  --sidebar-text: #f0fdf4;
  --sidebar-muted: #86efac;
  --sidebar-heading: #4ade80;
  
  --app-bg: #edfbf2;
  --app-card: #ffffff;
  --app-card-border: #bbf7d0;
  --app-ink: #064e3b;
  --app-text: #134e4a;
  --app-muted: #4b5563;
  --app-line: #dcfce7;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.app-mode, .app-unified-container {
  font-family: 'Mulish', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--app-bg);
  color: var(--app-text);
  min-height: 100vh;
  display: flex;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.5;
  width: 100%;
}

/* ==========================================================================
   Sidebar Layout
   ========================================================================== */

.app-sidebar {
  width: 255px;
  min-width: 255px;
  background-color: var(--sidebar-bg);
  color: var(--sidebar-text);
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid var(--sidebar-border);
  padding: 16px 12px 20px;
  z-index: 50;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.app-sidebar::-webkit-scrollbar {
  width: 4px;
}
.app-sidebar::-webkit-scrollbar-thumb {
  background: rgba(223, 164, 110, 0.3);
  border-radius: 4px;
}

/* Logo Row */
.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 14px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.sidebar-logo svg {
  height: 28px;
  width: auto;
}

.btn-sidebar-toggle {
  background: transparent;
  border: none;
  color: var(--sidebar-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

/* Sidebar Profile & Account Widgets */
.sidebar-user-card {
  background: var(--sidebar-card-bg);
  border: 1px solid var(--sidebar-border);
  border-radius: var(--r-md);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.sidebar-user-card:hover {
  background: var(--sidebar-card-hover);
}

.user-avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #4a3228;
  color: #ffffff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.user-meta-info {
  flex-grow: 1;
  overflow: hidden;
}

.user-meta-name {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-meta-role {
  font-size: 0.6875rem;
  color: var(--sidebar-muted);
}

/* Plan Badge Widget */
.sidebar-plan-card {
  background: var(--sidebar-card-bg);
  border: 1px solid var(--sidebar-border);
  border-radius: var(--r-md);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.sidebar-plan-card:hover {
  background: var(--sidebar-card-hover);
}

.plan-info-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.plan-info-left svg {
  color: #fbbf24;
  flex-shrink: 0;
}

.plan-text-group h4 {
  font-size: 0.78125rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
}

.plan-text-group p {
  font-size: 0.6875rem;
  color: var(--sidebar-muted);
}

/* Referral Widget */
.sidebar-refer-card {
  background: var(--sidebar-card-bg);
  border: 1px solid var(--sidebar-border);
  border-radius: var(--r-md);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.sidebar-refer-card:hover {
  background: var(--sidebar-card-hover);
}

.refer-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.refer-left svg {
  color: #60a5fa;
  flex-shrink: 0;
}

.refer-text h4 {
  font-size: 0.78125rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
}

.refer-text p {
  font-size: 0.6875rem;
  color: var(--sidebar-muted);
}

/* Platform Switcher Pills */
.platform-switch-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: #14161b;
  padding: 3px;
  border-radius: var(--r-md);
  margin-bottom: 8px;
}

.platform-pill-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 10px;
  font-size: 0.8125rem;
  font-weight: 700;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--sidebar-muted);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.platform-pill-btn.active {
  background: #ffffff;
  color: #11141a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.platform-pill-btn svg {
  width: 14px;
  height: 14px;
}

/* Store Selector Dropdown */
.store-selector-box {
  background: var(--sidebar-card-bg);
  border: 1px solid var(--sidebar-border);
  border-radius: var(--r-md);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  cursor: pointer;
}

.store-info-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #ffffff;
}

.store-selector-box:hover {
  background: var(--sidebar-card-hover);
}

/* Menu Navigation Groups */
.sidebar-nav-group {
  margin-bottom: 16px;
}

.nav-group-title {
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sidebar-heading);
  padding: 0 8px 6px;
}

.sidebar-nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  color: var(--sidebar-muted);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 600;
  transition: all 0.15s ease;
  cursor: pointer;
}

.sidebar-nav-item:hover {
  background: rgba(223, 164, 110, 0.12);
  color: #ffffff;
}

.sidebar-nav-item.active {
  background: rgba(223, 164, 110, 0.2);
  color: #ffffff;
  font-weight: 700;
  border-left: 3px solid #dfa46e;
}

.sidebar-nav-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.sidebar-nav-item .badge-soon {
  margin-left: auto;
  font-size: 0.625rem;
  background: rgba(255, 255, 255, 0.1);
  color: var(--sidebar-muted);
  padding: 1px 5px;
  border-radius: 4px;
}

.sidebar-nav-item .dot-active {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  margin-left: auto;
  flex-shrink: 0;
}

.sidebar-nav-item .lock-icon {
  margin-left: auto;
  color: #94a3b8;
  flex-shrink: 0;
}

/* AI Credits Widget at Sidebar Bottom */
.sidebar-bottom-area {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--sidebar-border);
}

.ai-credits-box {
  background: var(--sidebar-card-bg);
  border: 1px solid var(--sidebar-border);
  border-radius: var(--r-md);
  padding: 10px 12px;
  margin-bottom: 12px;
}

.ai-credits-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  margin-bottom: 6px;
}

.ai-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  color: #ffffff;
}

.ai-credits-count {
  font-weight: 700;
  color: #ffffff;
  font-size: 0.78125rem;
}

.ai-progress-track {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--r-full);
  overflow: hidden;
  margin-bottom: 6px;
}

.ai-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #818cf8);
  border-radius: var(--r-full);
}

.ai-reset-date {
  font-size: 0.6875rem;
  color: var(--sidebar-muted);
}

/* Download App Button */
.btn-download-app {
  width: 100%;
  background: #11141a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border-radius: var(--r-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-download-app:hover {
  background: #232731;
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-download-top {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 0.8125rem;
}

.btn-download-sub {
  font-size: 0.6875rem;
  color: var(--sidebar-muted);
  margin-left: 24px;
}

/* ==========================================================================
   Main Workspace Layout
   ========================================================================== */

.app-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  background-color: var(--app-bg);
}

/* Workspace Header */
.app-header {
  background: #ffffff;
  border-bottom: 1px solid var(--app-line);
  padding: 12px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--app-ink);
  letter-spacing: -0.02em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-header-task {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid #d0d5dd;
  border-radius: var(--r-sm);
  background: #ffffff;
  color: #344054;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-header-task:hover {
  background: #f8fafc;
  border-color: #98a2b3;
}

.btn-header-telegram {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border: none;
  border-radius: var(--r-sm);
  background: var(--telegram-blue);
  color: #ffffff;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-header-telegram:hover {
  background: var(--telegram-hover);
}

.btn-icon-header {
  width: 34px;
  height: 34px;
  border: 1px solid #d0d5dd;
  border-radius: var(--r-sm);
  background: #ffffff;
  color: #475467;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-icon-header:hover {
  background: #f8fafc;
  border-color: #98a2b3;
  color: #11141a;
}

/* Workspace Content Container */
.workspace-container {
  padding: 24px 28px 48px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* Metric Stats Cards Row */
.stats-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-metric-card {
  background: #ffffff;
  border: 1px solid var(--app-card-border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}

.stat-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--app-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.stat-big-num {
  font-size: 1.875rem;
  font-weight: 900;
  color: var(--app-ink);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.stat-subtext {
  font-size: 0.75rem;
  color: var(--emerald-rec);
  font-weight: 700;
  margin-top: 6px;
}

.stat-subtext.blue { color: #2563eb; }
.stat-subtext.rose { color: var(--rose-alert); }

/* Action Banner Bar */
.action-banner-row {
  background: #ffffff;
  border: 1px solid var(--app-card-border);
  border-radius: var(--r-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
  flex-wrap: wrap;
  gap: 12px;
}

.banner-left-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.filter-pills-group {
  display: flex;
  gap: 4px;
  background: var(--app-bg);
  padding: 3px;
  border-radius: var(--r-sm);
}

.filter-tab-pill {
  padding: 6px 12px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--app-muted);
  border-radius: var(--r-sm);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-tab-pill.active {
  background: #ffffff;
  color: var(--app-ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.banner-right-btns {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-create-auto {
  background: #11141a;
  color: #ffffff;
  padding: 8px 18px;
  font-size: 0.84375rem;
  font-weight: 800;
  border-radius: var(--r-sm);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s ease;
}

.btn-create-auto:hover {
  background: #2a313d;
}

/* Common App Table Card */
.app-table-card {
  background: #ffffff;
  border: 1px solid var(--app-card-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  margin-bottom: 24px;
}

.table-header-title {
  padding: 16px 20px;
  border-bottom: 1px solid var(--app-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.table-header-title h3 {
  font-size: 0.9375rem;
  font-weight: 800;
  color: var(--app-ink);
}

.app-data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.84375rem;
}

.app-data-table th {
  background: #f8fafc;
  color: #475467;
  font-weight: 700;
  padding: 12px 18px;
  border-bottom: 1px solid var(--app-line);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.app-data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--app-line);
  color: var(--app-text);
  vertical-align: middle;
}

.slot-time-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: monospace;
  font-weight: 800;
  color: #11141a;
  background: #f1f5f9;
  padding: 4px 10px;
  border-radius: var(--r-sm);
  font-size: 0.8125rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--r-full);
  font-size: 0.75rem;
  font-weight: 700;
}

.status-badge.active {
  background: #e6f9ed;
  color: #10b981;
}

.status-badge.pending {
  background: #fef3c7;
  color: #d97706;
}

.status-badge.inactive {
  background: #f1f5f9;
  color: #64748b;
}

.table-action-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-table-action {
  background: #ffffff;
  border: 1px solid #d0d5dd;
  border-radius: var(--r-sm);
  padding: 5px 10px;
  font-size: 0.78125rem;
  font-weight: 700;
  color: #344054;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-table-action:hover {
  background: #f8fafc;
}

.btn-table-action.danger {
  color: #e11d48;
}

.btn-table-action.danger:hover {
  background: #fff1f2;
  border-color: #fecdd3;
}

/* Editable Cost Input in Table */
.cogs-input {
  width: 105px;
  padding: 5px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #11141a;
  outline: none;
  transition: border-color 0.15s ease;
}

.cogs-input:focus {
  border-color: #11141a;
  box-shadow: 0 0 0 2px rgba(17, 20, 26, 0.1);
}

/* Switch Toggle Component */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 20px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: #10b981;
}

input:checked + .toggle-slider:before {
  transform: translateX(18px);
}

/* ==========================================================================
   Modal Styles
   ========================================================================== */

.flash-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(17, 20, 26, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.flash-modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.flash-modal-card {
  background: #ffffff;
  width: 100%;
  max-width: 680px;
  border-radius: 18px;
  box-shadow: var(--shadow-modal);
  overflow: hidden;
  position: relative;
  transform: translateY(20px) scale(0.98);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.flash-modal-overlay.open .flash-modal-card {
  transform: translateY(0) scale(1);
}

.flash-modal-header {
  padding: 24px 28px 16px;
  position: relative;
}

.flash-modal-header h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #11141a;
  margin-bottom: 6px;
}

.flash-modal-header p {
  font-size: 0.8125rem;
  color: #64748b;
  line-height: 1.45;
}

.btn-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: transparent;
  border: none;
  color: #64748b;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-modal-close:hover {
  background: #f1f5f9;
  color: #11141a;
}

.flash-modal-body {
  padding: 8px 28px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-config-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-head-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.section-icon-badge {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  background: #11141a;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.section-text-info h3 {
  font-size: 0.9375rem;
  font-weight: 800;
  color: #11141a;
  line-height: 1.2;
}

.section-text-info p {
  font-size: 0.78125rem;
  color: #64748b;
  margin-top: 2px;
}

.modal-field-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-field-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #475467;
}

.modal-select-input, .modal-text-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d0d5dd;
  border-radius: var(--r-md);
  background: #ffffff;
  color: #11141a;
  font-size: 0.875rem;
  font-weight: 600;
  outline: none;
}

.modal-select-input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475467' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.modal-radio-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.modal-radio-card {
  border: 1px solid #e2e8f0;
  border-radius: var(--r-md);
  padding: 14px 16px;
  cursor: pointer;
  background: #ffffff;
  transition: all 0.15s ease;
  position: relative;
  display: flex;
  flex-direction: column;
}

.modal-radio-card:hover {
  border-color: #cbd5e1;
}

.modal-radio-card.selected {
  border: 2px solid #11141a;
  background: #fafaf9;
}

.radio-top-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.radio-circle-indicator {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-radio-card.selected .radio-circle-indicator {
  border-color: #11141a;
}

.modal-radio-card.selected .radio-circle-indicator::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #11141a;
}

.radio-card-title {
  font-size: 0.875rem;
  font-weight: 800;
  color: #11141a;
}

.badge-khuyen-dung {
  font-size: 0.625rem;
  font-weight: 800;
  color: var(--emerald-rec);
  background: var(--emerald-rec-bg);
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.radio-card-desc {
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.45;
  margin-left: 24px;
}

.modal-inputs-4col {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.input-cell-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-cell-box label {
  font-size: 0.6875rem;
  font-weight: 700;
  color: #475467;
  line-height: 1.3;
  min-height: 28px;
}

.input-cell-box input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d0d5dd;
  border-radius: var(--r-sm);
  background: #ffffff;
  color: #11141a;
  font-size: 0.875rem;
  font-weight: 700;
  outline: none;
  transition: border-color 0.15s ease;
}

.input-cell-box input:focus {
  border-color: #11141a;
  box-shadow: 0 0 0 2px rgba(17, 20, 26, 0.08);
}

.modal-helper-note {
  font-size: 0.71875rem;
  color: #64748b;
  line-height: 1.4;
}

.flash-modal-footer {
  padding: 16px 28px 24px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid #f1f5f9;
}

.btn-modal-cancel {
  background: transparent;
  border: none;
  color: #475467;
  font-size: 0.875rem;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: var(--r-sm);
  cursor: pointer;
}

.btn-modal-cancel:hover {
  background: #f1f5f9;
  color: #11141a;
}

.btn-modal-save {
  background: #11141a;
  color: #ffffff;
  border: none;
  font-size: 0.875rem;
  font-weight: 800;
  padding: 9px 24px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-modal-save:hover {
  background: #2b303c;
}

/* Toast */
.app-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #11141a;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: var(--r-md);
  font-size: 0.84375rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-modal);
  z-index: 1100;
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.25s ease;
}

.app-toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Responsive */
@media (max-width: 900px) {
  .app-sidebar {
    width: 72px;
    min-width: 72px;
    padding: 12px 8px;
  }
  .sidebar-logo span, .user-meta-info, .plan-text-group, .refer-text, .store-info-row span, .nav-group-title, .sidebar-nav-item span, .btn-download-sub, .btn-download-top span, .ai-reset-date {
    display: none;
  }
  .platform-switch-row {
    grid-template-columns: 1fr;
  }
  .stats-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .modal-radio-cards-grid {
    grid-template-columns: 1fr;
  }
  .modal-inputs-4col {
    grid-template-columns: repeat(2, 1fr);
  }
}
/* Append Connection & Shopee OAuth Styles to app.css */

/* Connection Center Page */
.connection-header-banner {
  background: #ffffff;
  border: 1px solid var(--app-card-border);
  border-radius: var(--r-lg);
  padding: 16px 22px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
  flex-wrap: wrap;
  gap: 12px;
}

.connection-banner-meta h3 {
  font-size: 0.9375rem;
  font-weight: 800;
  color: var(--app-ink);
  margin-bottom: 2px;
}

.connection-banner-meta p {
  font-size: 0.78125rem;
  color: var(--app-muted);
}

.connection-group-card {
  background: #ffffff;
  border: 1px solid var(--app-card-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
  overflow: hidden;
}

.connection-group-header {
  padding: 14px 20px;
  background: #f8fafc;
  border-bottom: 1px solid var(--app-line);
  display: flex;
  align-items: center;
  gap: 12px;
}

.platform-badge-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 900;
  font-size: 0.8125rem;
}

.platform-badge-icon.shopee { background: #ee4d2d; }
.platform-badge-icon.tiktok { background: #11141a; }

.connection-group-title h3 {
  font-size: 0.9375rem;
  font-weight: 800;
  color: var(--app-ink);
  line-height: 1.2;
}

.connection-group-title p {
  font-size: 0.75rem;
  color: var(--app-muted);
}

/* Connection Service Rows */
.connection-service-list {
  display: flex;
  flex-direction: column;
}

.connection-service-row {
  padding: 18px 22px;
  border-bottom: 1px solid var(--app-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: background 0.15s ease;
}

.connection-service-row:last-child {
  border-bottom: none;
}

.connection-service-row:hover {
  background: #fafaf9;
}

.service-row-left {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.service-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #11141a;
  flex-shrink: 0;
  margin-top: 2px;
}

.service-text-box h4 {
  font-size: 0.90625rem;
  font-weight: 800;
  color: #11141a;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.service-text-box p {
  font-size: 0.78125rem;
  color: #64748b;
  margin-bottom: 4px;
}

.service-status-line {
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #94a3b8;
}

.service-status-line.connected {
  color: #10b981;
  font-weight: 700;
}

/* Modal: Shopee Permissions (Image 3) */
.perm-diagram-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 18px;
}

.perm-diagram-circle {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.35rem;
}

.perm-diagram-circle.xeno, .perm-diagram-circle.xeno { background: #11141a; color: #fff; }
.perm-diagram-circle.target { background: #f8fafc; border: 1px solid #e2e8f0; color: #11141a; font-size: 1.25rem; }

.perm-diagram-link {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #94a3b8;
}

.perm-diagram-link::before, .perm-diagram-link::after {
  content: "";
  width: 24px;
  height: 1px;
  border-bottom: 2px dashed #cbd5e1;
}

.perm-columns-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 16px 0;
}

.perm-col-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--r-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.perm-col-box h4 {
  font-size: 0.84375rem;
  font-weight: 800;
  color: #11141a;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
}

.perm-item-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.perm-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.78125rem;
  line-height: 1.45;
  color: #334155;
}

.perm-item .ico-yes {
  color: #10b981;
  font-weight: 900;
  flex-shrink: 0;
}

.perm-item .ico-no {
  color: #ef4444;
  font-weight: 900;
  flex-shrink: 0;
}

.perm-security-notice {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--r-md);
  padding: 12px 16px;
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ==========================================================================
   Shopee Open Platform OAuth Modal / Popup (Image 4)
   ========================================================================== */

.shopee-oauth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.shopee-oauth-overlay.open {
  opacity: 1;
  visibility: visible;
}

.shopee-oauth-card {
  background: #ffffff;
  width: 100%;
  max-width: 440px;
  border-radius: 8px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.25);
  padding: 36px 32px 28px;
  position: relative;
  transform: translateY(20px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.shopee-oauth-overlay.open .shopee-oauth-card {
  transform: translateY(0);
}

.shopee-brand-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 24px;
}

.shopee-logo-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ee4d2d;
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.shopee-logo-badge svg {
  width: 36px;
  height: 36px;
}

.shopee-auth-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #222222;
  line-height: 1.3;
}

.shopee-input-group {
  margin-bottom: 16px;
}

.shopee-combo-input {
  display: flex;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}

.shopee-combo-input select {
  background: #fafafa;
  border: none;
  border-right: 1px solid #e5e7eb;
  padding: 10px 12px;
  font-size: 0.875rem;
  font-weight: 700;
  color: #374151;
  outline: none;
  cursor: pointer;
}

.shopee-combo-input input {
  flex-grow: 1;
  padding: 10px 14px;
  border: none;
  font-size: 0.875rem;
  outline: none;
}

.shopee-text-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  font-size: 0.875rem;
  outline: none;
}

.shopee-text-input:focus, .shopee-combo-input:focus-within {
  border-color: #ee4d2d;
  box-shadow: 0 0 0 2px rgba(238, 77, 45, 0.15);
}

.shopee-forgot-link {
  display: block;
  font-size: 0.78125rem;
  color: #2563eb;
  margin: 8px 0 16px;
  text-decoration: none;
}

.shopee-btn-login {
  width: 100%;
  background: #ee4d2d;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 12px;
  font-size: 0.9375rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s ease;
  box-shadow: 0 2px 6px rgba(238, 77, 45, 0.3);
}

.shopee-btn-login:hover {
  background: #d73211;
}

.shopee-or-divider {
  display: flex;
  align-items: center;
  margin: 18px 0;
  color: #9ca3af;
  font-size: 0.75rem;
  font-weight: 700;
}

.shopee-or-divider::before, .shopee-or-divider::after {
  content: "";
  flex-grow: 1;
  height: 1px;
  background: #e5e7eb;
}

.shopee-or-divider span {
  padding: 0 12px;
}

.shopee-btn-switch {
  width: 100%;
  background: #ffffff;
  border: 1px solid #ee4d2d;
  color: #ee4d2d;
  border-radius: 4px;
  padding: 10px;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
}

.shopee-btn-switch:hover {
  background: #fff5f3;
}

.shopee-auth-footer {
  margin-top: 20px;
  font-size: 0.75rem;
  color: #6b7280;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ==========================================================================
   ONBOARDING CONNECT SCREEN (EXACT MATCH TO IMAGE 3 / 5e554c55.jpg)
   ========================================================================== */
.onboard-page-container {
  max-width: 820px;
  margin: 0 auto;
  padding: 40px 24px;
  text-align: center;
}

.onboard-diagram-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}

.onboard-logo-p {
  width: 58px;
  height: 58px;
  background: #11141a;
  color: #ffffff;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 900;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.onboard-link-middle {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.onboard-link-dot-line {
  width: 24px;
  height: 2px;
  border-top: 2px dotted #cbd5e1;
}

.onboard-link-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.onboard-target-box {
  width: 58px;
  height: 58px;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #11141a;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.onboard-status-pill {
  display: inline-block;
  background: #fef3c7;
  color: #b45309;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 9999px;
  margin-bottom: 12px;
}

.onboard-status-pill.connected {
  background: #d1fae5;
  color: #065f46;
}

.onboard-title {
  font-size: 1.625rem;
  font-weight: 900;
  color: #11141a;
  margin-bottom: 8px;
}

.onboard-subtitle {
  font-size: 0.875rem;
  color: #64748b;
  max-width: 580px;
  margin: 0 auto 28px;
  line-height: 1.5;
}

.onboard-features-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  max-width: 520px;
  margin: 0 auto 28px;
  padding: 20px 24px;
  text-align: left;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.onboard-feature-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #334155;
}

.onboard-feature-row .check-ico {
  color: #10b981;
  font-weight: 900;
  font-size: 1rem;
}

.btn-onboard-primary {
  background: #11141a;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 13px 44px;
  font-size: 0.9375rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(17, 20, 26, 0.15);
  margin-bottom: 36px;
}

.btn-onboard-primary:hover {
  background: #27272a;
  transform: translateY(-1px);
}

.onboard-steps-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 720px;
  margin: 0 auto 28px;
  text-align: left;
}

.onboard-step-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.onboard-step-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #11141a;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.onboard-step-body h5 {
  font-size: 0.84375rem;
  font-weight: 800;
  color: #11141a;
  margin-bottom: 4px;
}

.onboard-step-body p {
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.4;
  margin: 0;
}

.onboard-footer-notes {
  font-size: 0.75rem;
  color: #94a3b8;
  line-height: 1.6;
}

/* ==========================================================================
   TIKTOK SHOP OAUTH OVERLAY
   ========================================================================== */
.tiktok-oauth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.tiktok-oauth-overlay.open {
  display: flex;
  animation: fadeIn 0.15s ease-out;
}

.tiktok-oauth-card {
  background: #0f0f11;
  color: #ffffff;
  border: 1px solid #27272a;
  border-radius: 16px;
  width: 100%;
  max-width: 440px;
  padding: 32px 30px;
  position: relative;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
}

.tiktok-brand-header {
  text-align: center;
  margin-bottom: 24px;
}

.tiktok-logo-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.35rem;
  font-weight: 900;
  color: #ffffff;
  margin-bottom: 12px;
}

.tiktok-logo-badge svg {
  width: 32px;
  height: 32px;
  fill: #fe2c55;
  filter: drop-shadow(-2px -2px 0px #25f4ee);
}

.tiktok-auth-title {
  font-size: 1.125rem;
  font-weight: 800;
  color: #f4f4f5;
  line-height: 1.3;
}

.tiktok-input-group {
  margin-bottom: 16px;
}

.tiktok-combo-input {
  display: flex;
  background: #18181b;
  border: 1px solid #3f3f46;
  border-radius: 8px;
  overflow: hidden;
}

.tiktok-combo-input select {
  background: #27272a;
  border: none;
  border-right: 1px solid #3f3f46;
  padding: 10px 12px;
  font-size: 0.875rem;
  font-weight: 700;
  color: #f4f4f5;
  outline: none;
  cursor: pointer;
}

.tiktok-combo-input input {
  flex-grow: 1;
  background: transparent;
  padding: 10px 14px;
  border: none;
  color: #ffffff;
  font-size: 0.875rem;
  outline: none;
}

.tiktok-text-input {
  width: 100%;
  background: #18181b;
  color: #ffffff;
  padding: 10px 14px;
  border: 1px solid #3f3f46;
  border-radius: 8px;
  font-size: 0.875rem;
  outline: none;
}

.tiktok-text-input:focus, .tiktok-combo-input:focus-within {
  border-color: #fe2c55;
  box-shadow: 0 0 0 2px rgba(254, 44, 85, 0.25);
}

.tiktok-btn-login {
  width: 100%;
  background: linear-gradient(135deg, #fe2c55, #ff0050);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-size: 0.9375rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 4px 14px rgba(254, 44, 85, 0.35);
  margin-top: 10px;
}

.tiktok-btn-login:hover {
  background: linear-gradient(135deg, #e0264b, #d90045);
  transform: translateY(-1px);
}

/* ==========================================================================
   DEVELOPER API CONFIG CARD
   ========================================================================== */
.dev-api-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px;
  margin-top: 20px;
}

.dev-api-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.dev-input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.dev-field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 800;
  color: #475569;
  margin-bottom: 6px;
}

.dev-field input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-family: monospace;
}

.dev-json-box {
  background: #0f172a;
  color: #38bdf8;
  padding: 12px 16px;
  border-radius: 8px;
  font-family: monospace;
  font-size: 0.75rem;
  overflow-x: auto;
  max-height: 180px;
  white-space: pre-wrap;
}

/* Connection Tab Nav Pills */
.conn-tabs-nav {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 12px;
  margin-bottom: 20px;
}

.conn-tab-btn {
  background: transparent;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
}

.conn-tab-btn.active {
  background: #11141a;
  border-color: #11141a;
  color: #ffffff;
}

/* ==========================================================================
   DIRECT ACCOUNT & PASSWORD LOGIN TAB STYLES
   ========================================================================== */
.direct-login-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 28px 32px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.direct-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f1f5f9;
}

.direct-header h3 {
  font-size: 1.25rem;
  font-weight: 900;
  color: #11141a;
  margin-bottom: 4px;
}

.direct-header p {
  font-size: 0.84375rem;
  color: #64748b;
  margin: 0;
}

.platform-select-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 22px;
}

.platform-select-card {
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  background: #ffffff;
}

.platform-select-card:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.platform-select-card.active.shopee {
  border-color: #ee4d2d;
  background: #fff5f3;
}

.platform-select-card.active.tiktok {
  border-color: #11141a;
  background: #f4f4f5;
}

.platform-select-card .p-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.platform-select-card.shopee .p-logo {
  background: #ee4d2d;
  color: #ffffff;
}

.platform-select-card.tiktok .p-logo {
  background: #11141a;
  color: #ffffff;
}

.platform-select-info h4 {
  font-size: 0.9375rem;
  font-weight: 800;
  color: #11141a;
  margin-bottom: 2px;
}

.platform-select-info p {
  font-size: 0.75rem;
  color: #64748b;
  margin: 0;
}

.login-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

.login-field-group {
  display: flex;
  flex-direction: column;
}

.login-field-group label {
  font-size: 0.8125rem;
  font-weight: 800;
  color: #334155;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
}

.login-field-group label .hint-link {
  font-size: 0.75rem;
  font-weight: 600;
  color: #2563eb;
  cursor: pointer;
  text-decoration: underline;
}

.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input-wrap input, .login-input-wrap select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.875rem;
  color: #1e293b;
  outline: none;
  background: #ffffff;
  transition: all 0.15s ease;
}

.login-input-wrap input:focus, .login-input-wrap select:focus {
  border-color: #ee4d2d;
  box-shadow: 0 0 0 3px rgba(238, 77, 45, 0.12);
}

.btn-toggle-eye {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  font-size: 1rem;
  padding: 4px;
}

.btn-toggle-eye:hover {
  color: #334155;
}

.auth-method-selector {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.auth-method-pill {
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.78125rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #64748b;
  transition: all 0.15s ease;
}

.auth-method-pill.active {
  background: #11141a;
  border-color: #11141a;
  color: #ffffff;
}

.direct-actions-row {
  display: flex;
  gap: 12px;
  margin-bottom: 22px;
}

.btn-direct-submit {
  background: #ee4d2d;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 13px 26px;
  font-size: 0.9375rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 4px 12px rgba(238, 77, 45, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-direct-submit:hover {
  background: #d73211;
  transform: translateY(-1px);
}

.btn-qr-scan {
  background: #ffffff;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 13px 20px;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.btn-qr-scan:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

/* Real-time Connection Console */
.connection-console {
  background: #0f172a;
  border-radius: 10px;
  padding: 16px 20px;
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 0.78125rem;
  color: #38bdf8;
  max-height: 180px;
  overflow-y: auto;
  line-height: 1.6;
  border: 1px solid #1e293b;
}

.console-line {
  margin: 3px 0;
}

.console-line.success {
  color: #4ade80;
  font-weight: bold;
}

.console-line.warn {
  color: #facc15;
}

.console-line.time {
  color: #64748b;
  margin-right: 8px;
}

/* QR Code Modal Overlay */
.qr-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 10001;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.qr-modal-overlay.open {
  display: flex;
}

.qr-modal-card {
  background: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  padding: 28px;
  text-align: center;
  position: relative;
  box-shadow: 0 20px 40px rgba(0,0,0,0.25);
}

.qr-img-box {
  width: 220px;
  height: 220px;
  margin: 16px auto;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.console-line.error {
  color: #f87171 !important;
  font-weight: 700;
}
.btn-direct-submit.btn-error {
  background: #dc2626 !important;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3) !important;
}

/* ==========================================================================
   AI OPERATIONS & DAILY MEASUREMENT DASHBOARD STYLES
   ========================================================================== */
.ai-health-banner {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 60%, #4338ca 100%);
  color: #ffffff;
  border-radius: 16px;
  padding: 26px 30px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 10px 25px -5px rgba(67, 56, 202, 0.3);
  position: relative;
  overflow: hidden;
}

.ai-health-banner::after {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.3) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.ai-health-left h2 {
  font-size: 1.45rem;
  font-weight: 900;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-health-left p {
  font-size: 0.84375rem;
  color: #c7d2fe;
  max-width: 540px;
  line-height: 1.5;
  margin: 0;
}

.ai-score-ring {
  background: rgba(255, 255, 255, 0.1);
  border: 3px solid #818cf8;
  border-radius: 50%;
  width: 90px;
  height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(129, 140, 248, 0.4);
}

.ai-score-num {
  font-size: 1.85rem;
  font-weight: 900;
  line-height: 1;
  color: #ffffff;
}

.ai-score-sub {
  font-size: 0.625rem;
  font-weight: 700;
  color: #a5b4fc;
  text-transform: uppercase;
}

.ai-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.ai-kpi-card {
  background: #ffffff;
  border: 1px solid var(--app-card-border);
  border-radius: 12px;
  padding: 18px 20px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ai-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
}

.ai-kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.ai-kpi-title {
  font-size: 0.78125rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ai-kpi-val {
  font-size: 1.5rem;
  font-weight: 900;
  color: #11141a;
  line-height: 1.2;
  margin-bottom: 6px;
}

.ai-kpi-trend {
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.trend-up { color: #10b981; }
.trend-down { color: #ef4444; }

/* AI Recommendation Cards */
.ai-section-title {
  font-size: 1.15rem;
  font-weight: 900;
  color: #11141a;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-recommendation-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 28px;
}

.ai-rec-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 5px solid #6366f1;
  border-radius: 10px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.ai-rec-card.warning {
  border-left-color: #f59e0b;
}

.ai-rec-card.danger {
  border-left-color: #ef4444;
}

.ai-rec-card.success {
  border-left-color: #10b981;
}

.ai-rec-body h4 {
  font-size: 0.9375rem;
  font-weight: 800;
  color: #11141a;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-rec-body p {
  font-size: 0.8125rem;
  color: #475569;
  line-height: 1.5;
  margin: 0;
}

.ai-rec-tag {
  font-size: 0.6875rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}

.tag-warning { background: #fef3c7; color: #b45309; }
.tag-danger { background: #fee2e2; color: #b91c1c; }
.tag-success { background: #d1fae5; color: #065f46; }
.tag-ai { background: #ede9fe; color: #6d28d9; }

/* Floating AI Copilot Widget */
.floating-copilot-btn {
  position: fixed;
  bottom: 26px;
  right: 26px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #ffffff;
  border: none;
  border-radius: 9999px;
  padding: 12px 20px;
  font-size: 0.875rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.35);
  z-index: 9998;
  transition: all 0.2s ease;
}

.floating-copilot-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 28px rgba(124, 58, 237, 0.45);
}

.floating-copilot-btn .pulse-dot {
  width: 10px;
  height: 10px;
  background: #4ade80;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.3);
  animation: pulseGreen 1.8s infinite;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

/* Copilot Chat Drawer / Modal */
.copilot-drawer {
  position: fixed;
  bottom: 86px;
  right: 26px;
  width: 400px;
  height: 560px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  display: none;
  flex-direction: column;
  z-index: 9999;
  overflow: hidden;
  animation: slideUpFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.copilot-drawer.open {
  display: flex;
}

@keyframes slideUpFade {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.copilot-header {
  background: linear-gradient(135deg, #1e1b4b, #3730a3);
  color: #ffffff;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.copilot-header h4 {
  font-size: 0.9375rem;
  font-weight: 800;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.copilot-chat-body {
  flex: 1;
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #f8fafc;
}

.copilot-bubble {
  max-width: 86%;
  padding: 11px 15px;
  border-radius: 12px;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.copilot-bubble.ai {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #1e293b;
  align-self: flex-start;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.copilot-bubble.user {
  background: #4f46e5;
  color: #ffffff;
  align-self: flex-end;
}

.copilot-prompt-pills {
  padding: 10px 18px;
  background: #ffffff;
  border-top: 1px solid #f1f5f9;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  white-space: nowrap;
}

.copilot-prompt-pills button {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  padding: 5px 12px;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
}

.copilot-prompt-pills button:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.copilot-input-bar {
  padding: 12px 16px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 8px;
}

.copilot-input-bar input {
  flex: 1;
  padding: 9px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.8125rem;
  outline: none;
}

.copilot-input-bar input:focus {
  border-color: #6366f1;
}

.copilot-btn-send {
  background: #4f46e5;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 9px 14px;
  font-weight: 800;
  cursor: pointer;
}

/* Telegram Modal */
.telegram-modal-card {
  background: #17212b;
  color: #ffffff;
  border-radius: 16px;
  max-width: 480px;
  width: 100%;
  padding: 24px 26px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.tg-bubble {
  background: #242f3d;
  border-radius: 10px;
  padding: 14px 18px;
  margin: 16px 0;
  font-size: 0.8125rem;
  line-height: 1.6;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  border-left: 3px solid #2b98f0;
}

/* ==========================================================================
   BILLING & SUBSCRIPTION PLANS VIEW (#viewBilling)
   Matching 3-step billing layout with Xeno Seller -30% pricing
   ========================================================================== */
.billing-wrapper {
  max-width: 1120px;
  margin: 0 auto;
  padding-bottom: 110px;
}

/* 3-Step Progress Stepper */
.billing-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 22px;
  background: var(--app-card);
  border: 1px solid var(--app-card-border);
  padding: 12px 20px;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
}

.billing-step-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--app-muted);
}

.billing-step-item.active {
  color: var(--app-ink);
}

.billing-step-item.done {
  color: #059669;
}

.billing-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  background: var(--app-bg);
  color: var(--app-muted);
  border: 1px solid var(--app-card-border);
}

.billing-step-item.active .billing-step-num {
  background: #281a14;
  color: #ffffff;
  border-color: #281a14;
}

.billing-step-item.done .billing-step-num {
  background: #10b981;
  color: #ffffff;
  border-color: #10b981;
}

.billing-step-divider {
  width: 36px;
  height: 2px;
  background: var(--app-line);
}

/* Current Plan & Promo Banner Row */
.billing-top-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 16px;
  margin-bottom: 20px;
}

.billing-current-card {
  background: var(--app-card);
  border: 1px solid var(--app-card-border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
}

.billing-current-label {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--app-muted);
  margin-bottom: 6px;
}

.billing-current-title {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--app-ink);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.billing-current-meta {
  font-size: 0.8rem;
  color: var(--app-muted);
}

.billing-promo-banner {
  background: linear-gradient(135deg, #281a14 0%, #3d2419 60%, #5c261b 100%);
  color: #ffffff;
  border-radius: var(--r-lg);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(40, 26, 20, 0.22);
}

.billing-promo-badge {
  display: inline-block;
  background: #e11d48;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.billing-promo-banner h3 {
  font-size: 1.2rem;
  font-weight: 900;
  margin-bottom: 4px;
  color: #ffffff;
}

.billing-promo-banner p {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.82);
}

/* Controls Bar (Kỳ thanh toán + Số shop) */
.billing-controls-bar {
  background: var(--app-card);
  border: 1px solid var(--app-card-border);
  border-radius: var(--r-lg);
  padding: 16px 20px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: var(--shadow-card);
}

.billing-control-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.billing-control-label {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--app-ink);
}

.billing-period-pills {
  display: inline-flex;
  background: var(--app-bg);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--app-card-border);
  gap: 4px;
}

.billing-period-btn {
  padding: 7px 14px;
  border-radius: 8px;
  border: none;
  background: transparent;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--app-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.billing-period-btn:hover {
  color: var(--app-ink);
}

.billing-period-btn.active {
  background: #281a14;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(40, 26, 20, 0.2);
}

.billing-gift-tag {
  font-size: 0.68rem;
  background: #fef3c7;
  color: #b45309;
  padding: 2px 6px;
  border-radius: 999px;
  font-weight: 800;
}

.billing-period-btn.active .billing-gift-tag {
  background: #dfa46e;
  color: #281a14;
}

.billing-shop-stepper {
  display: inline-flex;
  align-items: center;
  background: var(--app-bg);
  border: 1px solid var(--app-card-border);
  border-radius: 10px;
  padding: 3px;
  gap: 4px;
}

.billing-step-btn {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: none;
  background: var(--app-card);
  color: var(--app-ink);
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.billing-step-btn:hover {
  background: #281a14;
  color: #ffffff;
}

.billing-shop-val {
  min-width: 68px;
  text-align: center;
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--app-ink);
}

/* 2x2 Paid Plans Grid */
.billing-plans-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 16px;
}

.billing-plan-card {
  background: var(--app-card);
  border: 2px solid var(--app-card-border);
  border-radius: var(--r-xl);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-card);
}

.billing-plan-card:hover {
  border-color: #dfa46e;
  transform: translateY(-2px);
}

.billing-plan-card.selected {
  border-color: #281a14;
  box-shadow: 0 0 0 3px rgba(40, 26, 20, 0.12), 0 12px 28px rgba(40, 26, 20, 0.1);
}

.billing-plan-badge {
  position: absolute;
  top: 18px;
  right: 20px;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
}

.billing-plan-badge.popular {
  background: #ffe4e6;
  color: #e11d48;
}

.billing-plan-badge.best-value {
  background: #fef3c7;
  color: #b45309;
}

.billing-plan-name {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--app-ink);
  margin-bottom: 4px;
}

.billing-plan-desc {
  font-size: 0.82rem;
  color: var(--app-muted);
  margin-bottom: 14px;
  min-height: 36px;
}

.billing-price-box {
  background: var(--app-bg);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin-bottom: 14px;
  border: 1px solid var(--app-line);
}

.billing-price-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.billing-price-strike {
  font-size: 0.85rem;
  color: var(--app-muted);
  text-decoration: line-through;
}

.billing-price-pct {
  font-size: 0.72rem;
  font-weight: 800;
  background: #dcfce7;
  color: #059669;
  padding: 2px 7px;
  border-radius: 999px;
}

.billing-price-main {
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--app-ink);
  line-height: 1.2;
  margin: 4px 0;
}

.billing-price-main span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--app-muted);
}

.billing-price-sub {
  font-size: 0.78rem;
  color: var(--app-muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.billing-ai-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #3730a3;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 14px;
}

.billing-features-list {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex-grow: 1;
}

.billing-features-list li {
  font-size: 0.8rem;
  color: var(--app-text);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.billing-features-list li.excluded {
  color: var(--app-muted);
  opacity: 0.7;
}

.billing-select-btn {
  width: 100%;
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  border: 2px solid #281a14;
  background: transparent;
  color: var(--app-ink);
  transition: all 0.15s ease;
}

.billing-select-btn:hover {
  background: rgba(40, 26, 20, 0.08);
}

.billing-plan-card.selected .billing-select-btn {
  background: #281a14;
  color: #ffffff;
}

.billing-tiktok-note {
  margin-top: 10px;
  font-size: 0.73rem;
  color: var(--app-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Free & Trial Section */
.billing-free-section {
  margin: 26px 0;
}

.billing-section-kicker {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #b45309;
  margin-bottom: 4px;
}

.billing-section-title {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--app-ink);
  margin-bottom: 14px;
}

.billing-free-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.billing-free-card {
  background: var(--app-card);
  border: 1px solid var(--app-card-border);
  border-radius: var(--r-lg);
  padding: 18px 22px;
  box-shadow: var(--shadow-card);
}

/* Comparison Table */
.billing-compare-card {
  background: var(--app-card);
  border: 1px solid var(--app-card-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

.billing-compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.billing-compare-table th,
.billing-compare-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--app-line);
  text-align: center;
}

.billing-compare-table th:first-child,
.billing-compare-table td:first-child {
  text-align: left;
  width: 34%;
}

.billing-compare-table thead th {
  background: var(--app-bg);
  font-weight: 800;
  color: var(--app-ink);
}

.billing-compare-group-row td {
  background: rgba(223, 164, 110, 0.14);
  font-weight: 800;
  color: var(--app-ink);
  text-align: left !important;
  cursor: pointer;
}

/* Sticky Bottom Order Summary Bar */
.billing-sticky-bar {
  position: fixed;
  bottom: 16px;
  left: 275px;
  right: 24px;
  z-index: 80;
  background: #221510;
  color: #ffffff;
  border: 1px solid rgba(223, 164, 110, 0.35);
  border-radius: 14px;
  padding: 14px 22px;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.billing-sticky-bar.visible {
  display: flex;
}

.billing-sticky-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.billing-sticky-plan {
  font-size: 0.92rem;
  font-weight: 800;
  color: #ffffff;
}

.billing-sticky-sub {
  font-size: 0.76rem;
  color: #cbb3a3;
}

.billing-sticky-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.billing-sticky-total {
  text-align: right;
}

.billing-sticky-total-num {
  font-size: 1.25rem;
  font-weight: 900;
  color: #dfa46e;
}

.billing-sticky-vat {
  font-size: 0.72rem;
  color: #cbb3a3;
}

.btn-create-order {
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  color: #ffffff;
  border: none;
  padding: 12px 22px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.35);
  transition: transform 0.15s ease;
}

.btn-create-order:hover {
  transform: translateY(-1px);
}

/* Step 2: VietQR Payment Layout */
.billing-payment-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.3fr;
  gap: 20px;
}

.billing-qr-card,
.billing-order-info-card {
  background: var(--app-card);
  border: 1px solid var(--app-card-border);
  border-radius: var(--r-xl);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

@media (max-width: 960px) {
  .billing-top-grid,
  .billing-plans-grid,
  .billing-free-grid,
  .billing-payment-grid {
    grid-template-columns: 1fr;
  }
  .billing-sticky-bar {
    left: 16px;
    right: 16px;
    flex-direction: column;
    align-items: stretch;
  }
}

/* ==========================================================================
   Sidebar User Profile Dropdown Popover (Matching Screenshot 32e70183.png)
   ========================================================================== */
.sidebar-user-wrap {
  position: relative;
}

.sidebar-user-card .user-chevron {
  transition: transform 0.2s ease;
}

.sidebar-user-wrap.open .sidebar-user-card .user-chevron {
  transform: rotate(180deg);
}

.sidebar-user-popover {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #ffffff;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.28), 0 4px 12px rgba(15, 23, 42, 0.1);
  padding: 14px 0 8px;
  z-index: 200;
  display: none;
  animation: popFadeIn 0.18s ease-out;
}

.sidebar-user-wrap.open .sidebar-user-popover {
  display: block;
}

@keyframes popFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.user-pop-header {
  padding: 0 16px 12px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 6px;
}

.user-pop-name {
  font-size: 0.92rem;
  font-weight: 800;
  color: #0f172a;
  word-break: break-word;
}

.user-pop-role {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 2px;
}

.user-pop-item {
  width: 100%;
  background: transparent;
  border: none;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  text-align: left;
  transition: background 0.14s ease;
}

.user-pop-item:hover {
  background: #f8fafc;
}

.user-pop-item svg {
  width: 17px;
  height: 17px;
  color: #475569;
  flex-shrink: 0;
}

.user-pop-divider {
  height: 1px;
  background: #f1f5f9;
  margin: 6px 16px;
}

.user-pop-item.danger {
  color: #e11d48;
  font-weight: 700;
}

.user-pop-item.danger svg {
  color: #e11d48;
}

.user-pop-item.danger:hover {
  background: #fff1f2;
}

/* Dark Mode Toggle Switch inside Popover */
.user-pop-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e293b;
}

.pop-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.pop-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.pop-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #cbd5e1;
  transition: 0.2s;
  border-radius: 999px;
}

.pop-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: 0.2s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.pop-switch input:checked + .pop-slider {
  background-color: #281a14;
}

.pop-switch input:checked + .pop-slider:before {
  transform: translateX(18px);
}

/* Account Action Modals (Security / Change Password / Report Issue) */
.account-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(6px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.account-modal-overlay.active {
  display: flex;
}

.account-modal-card {
  width: 100%;
  max-width: 460px;
  background: var(--app-card, #ffffff);
  color: var(--app-ink, #0f172a);
  border: 1px solid var(--app-card-border, #e2e8f0);
  border-radius: 16px;
  padding: 22px 24px;
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.3);
}

.account-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--app-line, #e2e8f0);
}

.account-modal-head h3 {
  font-size: 1.1rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--app-muted, #64748b);
  line-height: 1;
}
