:root {
  /* ── Brand Colors ── */
  --primary:       #1a7a4a;
  --primary-dark:  #145c38;
  --primary-light: #22a865;
  --accent:        #f5a623;
  --accent-dark:   #d4881a;
  --danger:        #e63946;
  --warning:       #f4a261;
  --success:       #2a9d8f;
  --info:          #457b9d;

  /* ── Neutrals ── */
  --bg:            #f0f4f0;
  --surface:       #ffffff;
  --surface-2:     #f7faf8;
  --border:        #dde8e2;
  --text:          #1a2e23;
  --text-muted:    #6b8070;
  --text-light:    #98b0a4;

  /* ── Sidebar ── */
  --sidebar-bg:    #0f2a1c;
  --sidebar-hover: #1a4530;
  --sidebar-active:#1a7a4a;
  --sidebar-text:  #c8ddd2;
  --sidebar-width: 280px;

  /* ── Spacing & Radius ── */
  --radius-sm:  8px;
  --radius-md:  14px;
  --radius-lg:  20px;
  --shadow-sm:  0 2px 8px rgba(0,0,0,.08);
  --shadow-md:  0 6px 24px rgba(0,0,0,.12);
  --shadow-lg:  0 16px 48px rgba(0,0,0,.16);

  /* ── Transition ── */
  --transition: .22s cubic-bezier(.4,0,.2,1);
}

/* ══════════════════════════════════════════════
   RESET & BASE
══════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-light); }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ══════════════════════════════════════════════
   LOGIN & CTV REGISTRATION SPLIT PAGE
══════════════════════════════════════════════ */
.login-body {
  background: #0d2217;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

.login-page-split {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 10% 20%, rgba(34, 168, 101, 0.15) 0%, transparent 40%),
              radial-gradient(circle at 90% 80%, rgba(245, 166, 35, 0.12) 0%, transparent 40%),
              linear-gradient(135deg, #091a11 0%, #0f2c1e 50%, #07150d 100%);
  padding: 30px 20px;
  position: relative;
}

.login-page-split::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
  pointer-events: none;
}

.login-wrapper {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  max-width: 1240px;
  width: 100%;
  background: rgba(18, 44, 30, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(26, 122, 74, 0.15);
  overflow: hidden;
  position: relative;
  z-index: 2;
  animation: fadeInModal .4s cubic-bezier(.16,1,.3,1);
}

@keyframes fadeInModal {
  from { opacity: 0; transform: translateY(18px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── KHUNG TRÁI: CHÍNH SÁCH BÁN HÀNG CTV ── */
.policy-column {
  background: linear-gradient(175deg, rgba(15, 42, 28, 0.95) 0%, rgba(10, 28, 19, 0.98) 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding: 40px 38px;
  display: flex;
  flex-direction: column;
  color: #e2ede7;
  position: relative;
}

.policy-header {
  margin-bottom: 24px;
}

.policy-badge-top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(34, 168, 101, 0.18);
  border: 1px solid rgba(34, 168, 101, 0.4);
  color: #5ce69e;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 5px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.policy-title {
  font-size: 21px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.35;
  margin-bottom: 8px;
  letter-spacing: -.3px;
  background: linear-gradient(135deg, #ffffff 30%, #b8f2d2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.policy-subtitle {
  font-size: 13.5px;
  color: #9ebdb0;
  line-height: 1.5;
  margin-bottom: 18px;
}

.policy-issuer-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 16px;
  border-radius: 12px;
}

.issuer-icon {
  font-size: 26px;
  background: rgba(26, 122, 74, 0.35);
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.issuer-info {
  font-size: 13px;
  line-height: 1.4;
}

.issuer-name {
  font-weight: 700;
  color: #ffffff;
}

.issuer-org {
  color: #92b8a6;
  font-size: 12px;
}

.issuer-meta {
  display: flex;
  gap: 14px;
  margin-top: 4px;
  font-size: 11.5px;
  flex-wrap: wrap;
}

.issuer-meta a {
  color: #5ce69e;
  text-decoration: none;
}

.issuer-meta a:hover {
  text-decoration: underline;
}

/* Scrollable Content for Policy */
.policy-content-scroll {
  flex: 1;
  overflow-y: auto;
  padding-right: 8px;
  margin-right: -8px;
  max-height: 520px;
}

.policy-content-scroll::-webkit-scrollbar {
  width: 5px;
}
.policy-content-scroll::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 4px;
}
.policy-content-scroll::-webkit-scrollbar-thumb {
  background: rgba(34, 168, 101, 0.4);
  border-radius: 4px;
}

.policy-section {
  margin-bottom: 24px;
}

.section-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.badge-num {
  background: #f5a623;
  color: #0f2a1c;
  font-weight: 900;
  font-size: 12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.badge-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #f7d28b;
  letter-spacing: .3px;
  text-transform: uppercase;
}

.policy-card-highlight {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.policy-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.item-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  margin-top: 2px;
}

.item-icon.green { background: rgba(34, 168, 101, 0.25); color: #5ce69e; }
.item-icon.gold  { background: rgba(245, 166, 35, 0.25); color: #ffd166; }
.item-icon.blue  { background: rgba(69, 123, 157, 0.25); color: #8ecae6; }

.item-body strong {
  font-size: 13.5px;
  color: #ffffff;
  display: block;
  margin-bottom: 3px;
}

.item-body p {
  font-size: 12.5px;
  color: #a7c7b8;
  line-height: 1.5;
  margin: 0;
}

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

.policy-feature-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  transition: all .2s ease;
}

.policy-feature-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(34, 168, 101, 0.35);
  transform: translateX(3px);
}

.policy-feature-card.highlight-profit {
  background: linear-gradient(135deg, rgba(245, 166, 35, 0.12) 0%, rgba(26, 122, 74, 0.15) 100%);
  border: 1px solid rgba(245, 166, 35, 0.35);
}

.feature-icon {
  font-size: 22px;
  flex-shrink: 0;
  margin-top: 2px;
}

.feature-body h4 {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}

.feature-body p {
  font-size: 12.5px;
  color: #a7c7b8;
  line-height: 1.5;
  margin: 0;
}

.feature-body strong {
  color: #ffe082;
}

.policy-sublist {
  margin: 6px 0 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.policy-sublist li {
  font-size: 12px;
  color: #a7c7b8;
  line-height: 1.45;
}

.policy-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12.5px;
  color: #92b8a6;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.policy-footer strong {
  color: #5ce69e;
}

.policy-footer a {
  color: #ffd166;
  font-weight: 600;
}

/* ── KHUNG PHẢI: FORM ĐĂNG NHẬP / ĐĂNG KÝ ── */
.auth-column {
  background: var(--surface);
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

.auth-card {
  width: 100%;
}

.auth-header {
  margin-bottom: 22px;
}

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

.brand-icon {
  font-size: 38px;
  line-height: 1;
  animation: bounce 2s infinite;
}

.brand-text h2 {
  font-size: 19px;
  font-weight: 800;
  color: var(--primary-dark);
  letter-spacing: -.3px;
  margin: 0;
}

.brand-text p {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 2px 0 0 0;
}

/* Mobile Toggle */
.mobile-policy-toggle {
  display: none;
  margin-bottom: 18px;
}

.btn-toggle-policy {
  width: 100%;
  padding: 10px 14px;
  background: #f0f7f3;
  border: 1px solid #cce8d9;
  border-radius: var(--radius-sm);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-toggle-policy:hover {
  background: #e4f2eb;
}

/* Tabs */
.auth-tabs {
  display: flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 22px;
  gap: 4px;
}

.auth-tab {
  flex: 1;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  border-radius: 8px;
  cursor: pointer;
  transition: all .2s cubic-bezier(.4,0,.2,1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.auth-tab:hover {
  color: var(--text);
}

.auth-tab.active {
  background: var(--surface);
  color: var(--primary-dark);
  box-shadow: var(--shadow-sm);
}

/* Pane animation */
.auth-pane {
  display: none;
  animation: fadeInTab .25s ease-out;
}

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

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

.pane-intro {
  margin-bottom: 18px;
}

.pane-intro h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}

.pane-intro p {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
}

/* Form Styles */
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-group .req {
  color: var(--danger);
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.label-row label {
  margin-bottom: 0;
}

.link-forgot {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.link-forgot:hover {
  text-decoration: underline;
}

.input-wrap {
  position: relative;
}

.input-wrap .input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  pointer-events: none;
  color: var(--text-muted);
}

.form-control {
  width: 100%;
  padding: 11px 12px 11px 38px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface-2);
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(26, 122, 74, 0.12);
}

.form-control::placeholder {
  color: var(--text-light);
  font-size: 13px;
}

.toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--text-muted);
  padding: 4px;
}

/* Submit Buttons */
.btn-submit {
  width: 100%;
  padding: 13px;
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  margin-top: 6px;
}

.btn-primary-gradient {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  box-shadow: 0 4px 14px rgba(26, 122, 74, 0.3);
}

.btn-accent-gradient {
  background: linear-gradient(135deg, #145c38 0%, #1a7a4a 60%, #f5a623 100%);
  box-shadow: 0 4px 14px rgba(26, 122, 74, 0.3);
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(26, 122, 74, 0.4);
}

.btn-submit:active {
  transform: translateY(0);
}

.btn-submit .spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto;
}

.auth-sub-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

.btn-link-action {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

.btn-link-action:hover {
  text-decoration: underline;
}

.auth-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

.support-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.support-info a {
  color: var(--primary);
  text-decoration: none;
}

.support-info a:hover {
  text-decoration: underline;
}

.support-info .dot {
  color: var(--border);
}

/* Alerts */
.login-alert {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.45;
}
.login-alert.error   { background: #fde8e8; color: #c0392b; border: 1px solid #f5c6c6; }
.login-alert.success { background: #e8f8f0; color: #1a7a4a; border: 1px solid #b8e8cc; }
.login-alert.info    { background: #e8f0fb; color: #2c5282; border: 1px solid #bee3f8; }

/* ── RESPONSIVE MEDIA QUERIES ── */
@media (max-width: 1024px) {
  .login-wrapper {
    grid-template-columns: 1fr 1fr;
    max-width: 960px;
  }
  .policy-column {
    padding: 30px 24px;
  }
  .auth-column {
    padding: 30px 24px;
  }
}

@media (max-width: 880px) {
  .login-page-split {
    padding: 16px 12px;
    align-items: flex-start;
  }

  .login-wrapper {
    grid-template-columns: 1fr;
    border-radius: 18px;
  }

  .mobile-policy-toggle {
    display: block;
  }

  .policy-column {
    display: none;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 24px 20px;
    order: 2;
  }

  .policy-column.mobile-expanded {
    display: flex;
  }

  .policy-content-scroll {
    max-height: none;
    overflow-y: visible;
  }

  .auth-column {
    padding: 28px 20px;
    order: 1;
  }
}

@media (max-width: 520px) {
  .form-row-2 {
    grid-template-columns: 1fr;
    gap: 0;
  }

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

  .brand-text h2 {
    font-size: 17px;
  }

  .auth-tab {
    font-size: 13px;
    padding: 8px 10px;
  }

  .policy-title {
    font-size: 18px;
  }
}

/* ══════════════════════════════════════════════
   APP LAYOUT
══════════════════════════════════════════════ */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 1000;
  transition: transform var(--transition);
  box-shadow: 4px 0 20px rgba(0,0,0,.3);
  overflow-y: auto;
}
.sidebar-header {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.sidebar-logo .logo-icon { font-size: 32px; }
.sidebar-logo .logo-text h2 {
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.3px;
  line-height: 1.2;
}
.sidebar-logo .logo-text span {
  font-size: 11px;
  color: var(--sidebar-text);
  letter-spacing: 1px;
  text-transform: uppercase;
}
.sidebar-user {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.user-info .user-name {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}
.user-info .user-level {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
  display: inline-block;
  margin-top: 3px;
}
.badge-basic   { background: rgba(255,255,255,.15); color: #ccc; }
.badge-silver  { background: #c0c0c040; color: #d0d0d0; }
.badge-gold    { background: rgba(245,166,35,.2); color: var(--accent); }
.badge-diamond { background: rgba(100,180,255,.2); color: #7ec8f7; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }

.nav-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,.3);
  padding: 12px 20px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  color: var(--sidebar-text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  border-left: 3px solid transparent;
  position: relative;
}
.nav-item:hover {
  background: var(--sidebar-hover);
  color: #fff;
  border-left-color: var(--primary-light);
}
.nav-item.active {
  background: var(--sidebar-active);
  color: #fff;
  border-left-color: var(--accent);
  font-weight: 700;
}
.nav-item .nav-icon { font-size: 22px; flex-shrink: 0; width: 26px; text-align: center; }
.nav-item .nav-label { flex: 1; }
.nav-item .nav-badge {
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
}
.nav-arrow {
  font-size: 11px;
  color: rgba(255,255,255,.5);
  transition: transform var(--transition);
}
.nav-tree.open .nav-arrow {
  transform: rotate(180deg);
}

/* Nav Tree Submenu */
.nav-tree-body {
  display: flex;
  flex-direction: column;
  padding-left: 20px;
  background: rgba(0,0,0,.15);
  border-left: 2px solid rgba(255,255,255,.1);
  margin-left: 22px;
  margin-top: 2px;
  margin-bottom: 6px;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
.nav-sub-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  color: rgba(255,255,255,.75);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.nav-sub-item:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}
.nav-sub-item.active {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}
.nav-sub-item .sub-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}
.nav-sub-item .sub-label {
  flex: 1;
}

.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-balance {
  background: rgba(255,255,255,.06);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 12px;
}
.sidebar-balance .bal-label {
  font-size: 11px;
  color: rgba(255,255,255,.4);
  text-transform: uppercase;
  letter-spacing: .8px;
}
.sidebar-balance .bal-amount {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
  margin-top: 2px;
}
.btn-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  background: rgba(230,57,70,.12);
  color: #f78c8c;
  border: 1px solid rgba(230,57,70,.2);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  font-family: inherit;
}
.btn-logout:hover {
  background: rgba(230,57,70,.25);
  color: #ff9f9f;
}

/* ── Main Content ── */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  max-width: calc(100vw - var(--sidebar-width));
  width: 100%;
}
.topbar {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  height: 60px;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 999;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  width: 100%;
  flex-wrap: nowrap;
}
.topbar-toggle {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 38px;
  height: 38px;
  font-size: 22px;
  cursor: pointer;
  color: var(--text);
  padding: 0;
  align-items: center;
  justify-content: center;
  line-height: 1;
  user-select: none;
  flex-shrink: 0;
}
.topbar-toggle:hover {
  background: var(--bg);
}
.topbar-title {
  flex: 1;
  min-width: 0;
  font-size: 16.5px;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-title span { color: var(--text-muted); font-weight: 400; font-size: 13px; margin-left: 8px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

/* ── Topbar Right (Wallet + User Dropdown) ── */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-wrap: nowrap;
}
.topbar-balance {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(26,122,74,.08), rgba(245,166,35,.12));
  border: 1px solid rgba(245,166,35,.35);
  padding: 6px 14px;
  border-radius: 30px;
  font-weight: 700;
  white-space: nowrap;
}
.tb-bal-label { font-size: 16px; }
.tb-bal-amount {
  font-size: 15px;
  color: #b45309;
  font-weight: 800;
}

/* ── User Dropdown ── */
.user-dropdown-wrap {
  position: relative;
}
.user-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 4px 10px 4px 5px;
  border-radius: 30px;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  outline: none;
}
.user-dropdown-toggle:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(26,122,74,.15);
}
.topbar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #22a865);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  flex-shrink: 0;
}
.topbar-user-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
}
.topbar-user-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-user-level {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 600;
  margin-top: 1px;
}
.dropdown-caret {
  font-size: 11px;
  color: var(--text-muted);
  transition: transform .2s ease;
  margin-left: 2px;
}
.user-dropdown-toggle[aria-expanded="true"] .dropdown-caret {
  transform: rotate(180deg);
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  max-width: 90vw;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(0,0,0,.2);
  padding: 10px 0;
  z-index: 9999;
  display: none !important;
  animation: fadeInDown .2s ease;
}
.user-dropdown-menu.show {
  display: block !important;
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.user-dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 16px 12px;
}
.user-dropdown-avatar-lg {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #22a865);
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  flex-shrink: 0;
}
.user-dropdown-info {
  min-width: 0;
  flex: 1;
}
.user-dropdown-displayname {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-dropdown-sub {
  font-size: 12px;
  color: var(--text-muted);
}
.user-dropdown-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 12px 8px;
  background: var(--bg);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.ud-stat-box {
  display: flex;
  flex-direction: column;
}
.ud-stat-label {
  font-size: 11px;
  color: var(--text-muted);
}
.ud-stat-val {
  font-size: 13px;
  font-weight: 800;
  margin-top: 2px;
}
.user-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}
.user-dropdown-links {
  display: flex;
  flex-direction: column;
}
.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: background var(--transition);
}
.user-dropdown-item:hover {
  background: var(--bg);
  color: var(--primary);
}
.ud-item-icon {
  font-size: 15px;
  width: 20px;
  text-align: center;
}
.ud-logout {
  color: #dc2626 !important;
  font-weight: 600;
}
.ud-logout:hover {
  background: #fee2e2 !important;
}
.btn-start-selling {
  padding: 16px 36px;
  font-size: 17px;
  font-weight: 800;
  border-radius: 50px;
  background: linear-gradient(135deg, #22a865, #1a7a4a);
  box-shadow: 0 8px 24px rgba(26,122,74,.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  color: #fff !important;
  max-width: 100%;
  box-sizing: border-box;
  text-align: center;
  transition: all var(--transition);
}
.btn-start-selling:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(26,122,74,.45);
  color: #fff !important;
}
.sidebar-logo-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  padding: 2px;
}

/* ── Filter Tabs ── */
.filter-tab {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
}
.filter-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.filter-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.page-body {
  padding: 28px;
  flex: 1;
}

/* ══════════════════════════════════════════════
   DASHBOARD – HOME MENU
══════════════════════════════════════════════ */
.dashboard-welcome {
  background: linear-gradient(135deg, var(--primary) 0%, #2d9b5a 100%);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  color: #fff;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: 0 8px 32px rgba(26,122,74,.3);
  position: relative;
  overflow: hidden;
}
.dashboard-welcome::after {
  content: '🌿';
  position: absolute;
  right: 140px;
  bottom: -10px;
  font-size: 80px;
  opacity: .15;
}
.welcome-text h2 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 4px;
  letter-spacing: -.3px;
}
.welcome-text p { font-size: 15px; opacity: .85; }
.welcome-stats { display: flex; gap: 24px; }
.welcome-stat { text-align: center; }
.welcome-stat .stat-num {
  font-size: 26px;
  font-weight: 800;
  display: block;
  line-height: 1;
}
.welcome-stat .stat-lbl {
  font-size: 12px;
  opacity: .75;
  margin-top: 4px;
}

/* Notification banner */
.notif-banner {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 28px;
}
.notif-banner-header {
  background: var(--surface-2);
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: .5px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}
.notif-item {
  padding: 14px 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surface-2); }
.notif-icon { font-size: 22px; flex-shrink: 0; margin-top: 1px; }
.notif-body .notif-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.notif-body .notif-time { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Menu Grid – Main */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.menu-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  border: 2px solid transparent;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.menu-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  opacity: 0;
  transition: opacity var(--transition);
}
.menu-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.menu-card:hover::before { opacity: .04; }
.menu-card .card-icon {
  font-size: 36px;
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  position: relative;
  z-index: 1;
}
.menu-card:hover .card-icon {
  background: rgba(26,122,74,.08);
  transform: scale(1.1);
}
.menu-card .card-body { position: relative; z-index: 1; }
.menu-card .card-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .3px;
  color: var(--text);
  transition: color var(--transition);
}
.menu-card:hover .card-title { color: var(--primary); }
.menu-card .card-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}
.menu-card .card-arrow {
  margin-left: auto;
  font-size: 18px;
  color: var(--text-light);
  transition: var(--transition);
  position: relative;
  z-index: 1;
}
.menu-card:hover .card-arrow {
  color: var(--primary);
  transform: translateX(4px);
}
.menu-card.highlight {
  background: linear-gradient(135deg, #1a7a4a08, #22a86508);
  border-color: var(--border);
}

/* ══════════════════════════════════════════════
   INNER PAGES – COMMON
══════════════════════════════════════════════ */
.page-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.page-header-icon {
  font-size: 40px;
  width: 64px; height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: var(--radius-md);
  box-shadow: 0 6px 16px rgba(26,122,74,.3);
}
.page-header-text h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.3px;
}
.page-header-text p {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* Cards */
.card {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface-2);
}
.card-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.card-body { padding: 22px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  box-shadow: 0 4px 12px rgba(26,122,74,.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(26,122,74,.4); color: #fff; }
.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
}
.btn-accent:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(245,166,35,.4); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c0392b; color: #fff; }
.btn-copy {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}
.btn-copy:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-copy.copied { background: var(--success); color: #fff; border-color: var(--success); }

/* Filter Tabs */
.filter-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.filter-tab {
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  transition: var(--transition);
  font-family: inherit;
}
.filter-tab:hover { border-color: var(--primary); color: var(--primary); }
.filter-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Search Bar */
.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}
.search-bar .form-control { padding-left: 16px; }
.search-input {
  flex: 1;
  position: relative;
}
.search-input input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: var(--transition);
}
.search-input input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,122,74,.1);
}
.search-input .search-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  pointer-events: none;
}

/* Image Grid */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.resource-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.resource-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.resource-card .rc-thumb {
  aspect-ratio: 4/3;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  overflow: hidden;
}
.resource-card .rc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.resource-card .rc-body { padding: 12px 14px; }
.resource-card .rc-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.resource-card .rc-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* List Style (bài mẫu, kịch bản) */
.resource-list { display: flex; flex-direction: column; gap: 14px; }
.resource-list-item {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 20px 22px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.resource-list-item:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(26,122,74,.1);
}
.resource-list-item .rli-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.resource-list-item .rli-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.resource-list-item .rli-content {
  font-size: 14px;
  color: var(--text-muted);
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 14px;
  white-space: pre-wrap;
  line-height: 1.7;
  font-family: inherit;
  border-left: 3px solid var(--primary);
}
.resource-list-item .rli-actions { margin-top: 12px; display: flex; gap: 8px; }

/* Video Grid */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.video-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.video-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.video-thumb {
  aspect-ratio: 16/9;
  background: #000;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-thumb iframe, .video-thumb video { width: 100%; height: 100%; border: none; }
.video-thumb .play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.3);
  transition: var(--transition);
}
.video-thumb .play-btn {
  width: 56px; height: 56px;
  background: rgba(255,255,255,.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
  transition: var(--transition);
}
.video-card:hover .play-btn { transform: scale(1.1); background: #fff; }
.video-info { padding: 14px 16px; }
.video-info h3 { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.video-info p { font-size: 12px; color: var(--text-muted); }

/* Order Form */
.order-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.order-form-grid .full-width { grid-column: 1 / -1; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 7px;
}
.form-label .required { color: var(--danger); }
.form-input {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: var(--transition);
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,122,74,.1);
}
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b8070' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
textarea.form-input { resize: vertical; min-height: 100px; }

/* Table */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  width: 100%;
}
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.data-table th {
  background: var(--surface-2);
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .6px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}
.status-pending    { background: #fff3cd; color: #856404; }
.status-processing { background: #cfe2ff; color: #084298; }
.status-shipping   { background: #d1ecf1; color: #0c5460; }
.status-completed  { background: #d4edda; color: #155724; }
.status-cancelled  { background: #f8d7da; color: #721c24; }

/* Pagination */
.pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 24px;
  flex-wrap: wrap;
}
.page-btn {
  width: 38px; height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Accordion */
.accordion-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  overflow: hidden;
}
.accordion-header {
  padding: 16px 20px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: background var(--transition);
  user-select: none;
}
.accordion-header:hover { background: var(--surface-2); }
.accordion-header .acc-icon { transition: transform var(--transition); }
.accordion-header.open .acc-icon { transform: rotate(180deg); }
.accordion-body {
  padding: 0 20px;
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease, padding .3s ease;
}
.accordion-body.open { max-height: 1000px; padding: 16px 20px; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 60px; margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.empty-state p { font-size: 14px; }

/* PDF Viewer */
.pdf-viewer-wrap {
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #525659;
}
.pdf-viewer-wrap iframe { width: 100%; height: 70vh; border: none; }

/* Combo card */
.combo-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.combo-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--primary); }
.combo-thumb { aspect-ratio: 16/9; background: var(--bg); overflow: hidden; position: relative; }
.combo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.combo-badge {
  position: absolute;
  top: 10px; right: 10px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 20px;
}
.combo-body { padding: 16px; }
.combo-name { font-size: 15px; font-weight: 800; color: var(--text); margin-bottom: 8px; line-height: 1.4; }
.combo-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.combo-price-val {
  font-size: 17px;
  font-weight: 800;
  color: var(--primary);
}
.combo-commission-badge {
  font-size: 11.5px;
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  padding: 3px 8px;
  border-radius: 20px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.combo-price-ctv { font-size: 20px; font-weight: 800; color: var(--primary); }
.combo-price-retail { font-size: 13px; color: var(--text-muted); text-decoration: line-through; }
.combo-commission { font-size: 12px; background: #e8f8f0; color: var(--primary); padding: 3px 10px; border-radius: 20px; font-weight: 700; }

/* Overlay & Modal */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.overlay.active { display: flex; animation: fadeIn .2s ease; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp .3s ease;
}
.modal-header {
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { font-size: 18px; font-weight: 800; color: var(--text); }
.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  line-height: 1;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 18px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 260px;
  max-width: 360px;
  animation: slideUp .3s ease;
  border-left: 4px solid var(--primary);
  font-size: 14px;
  font-weight: 600;
}
.toast.error { border-left-color: var(--danger); }
.toast.success { border-left-color: var(--success); }
.toast.warning { border-left-color: var(--warning); }
.toast .toast-icon { font-size: 20px; }
.toast .toast-msg { flex: 1; }
.toast .toast-close { cursor: pointer; color: var(--text-muted); font-size: 18px; padding: 2px; background: none; border: none; }

/* Form grids */
.form-grid {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
  width: 100%;
}
.form-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}
.form-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}
.form-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 999;
  opacity: 0;
  transition: opacity .3s ease;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.sidebar-overlay.active,
.sidebar.open ~ .sidebar-overlay {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

/* ══════════════════════════════════════════════
   ANIMATIONS
══════════════════════════════════════════════ */
@keyframes fadeIn   { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp  { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin     { to { transform: rotate(360deg); } }
@keyframes bounce   { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-6px)} }
@keyframes pulse    { 0%,100%{opacity:1} 50%{opacity:.5} }

/* ══════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════ */
@media (max-width: 900px) {
  :root { --sidebar-width: 270px; }
  .sidebar {
    transform: translateX(-100%);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100vh;
    z-index: 1000;
  }
  .sidebar.open { transform: translateX(0); }
  .main-content {
    margin-left: 0 !important;
    max-width: 100vw !important;
    width: 100% !important;
  }
  .topbar-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }
  .dashboard-welcome { flex-direction: column; align-items: flex-start; }
  .welcome-stats { justify-content: flex-start; }
  .order-form-grid { grid-template-columns: 1fr; }
  .order-form-grid .full-width { grid-column: 1; }
  .form-grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  /* Ẩn khối header lớn (ảnh và chữ to) trên menu theo yêu cầu */
  .page-header {
    display: none !important;
  }
  .form-grid-3, .form-grid-2, .form-grid-4 {
    grid-template-columns: 1fr;
  }
  .topbar-right {
    gap: 6px;
  }
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
  }
  .data-table th, .data-table td {
    padding: 8px 10px;
    font-size: 13px;
    white-space: nowrap;
  }
  .data-table td.break-word {
    white-space: normal;
    word-break: break-word;
    max-width: 200px;
  }
}

@media (max-width: 600px) {
  .page-body { padding: 12px 10px; }
  .menu-grid { grid-template-columns: 1fr 1fr; }
  .resource-grid { grid-template-columns: 1fr; }
  .video-grid { grid-template-columns: 1fr; }
  .welcome-stats { gap: 10px; }
  
  /* Topbar trên điện thoại cao ráo, thoáng, cố định chuẩn Safari / Chrome / Zalo */
  .topbar {
    padding: 0 10px;
    height: 56px;
    min-height: 56px;
    gap: 8px;
    flex-wrap: nowrap !important;
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 999 !important;
  }
  .topbar-toggle {
    width: 36px;
    height: 36px;
    font-size: 20px;
    display: inline-flex !important;
  }
  .topbar-title {
    font-size: 14.5px;
    min-width: 0;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topbar-right {
    margin-left: auto;
    gap: 6px;
    flex-wrap: nowrap;
    flex-shrink: 0;
  }
  .topbar-balance {
    padding: 4px 8px;
    font-size: 12px;
    gap: 4px;
    border-radius: 20px;
  }
  .tb-bal-label { font-size: 13px; }
  .tb-bal-amount { font-size: 12px; font-weight: 800; }
  
  .user-dropdown-toggle {
    padding: 3px 6px 3px 4px;
    gap: 4px;
    border-radius: 20px;
  }
  .topbar-user-avatar {
    width: 26px;
    height: 26px;
    font-size: 12px;
  }
  .topbar-user-name {
    max-width: 70px;
    font-size: 12px;
  }
  .topbar-user-level {
    display: none !important;
  }
  .user-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 240px;
    max-width: calc(100vw - 20px);
    box-shadow: 0 12px 32px rgba(0,0,0,.25);
  }

  .login-card { padding: 24px 16px; }
  .card-header { padding: 10px 12px; flex-direction: column; align-items: flex-start; gap: 6px; }
  .card-body { padding: 12px; }

  /* Nút bán hàng ngay co giãn vừa vặn màn hình điện thoại */
  .btn-start-selling {
    padding: 13px 14px;
    font-size: 14px;
    width: 100%;
    border-radius: 12px;
    gap: 6px;
    box-shadow: 0 4px 14px rgba(26,122,74,.25);
  }
}

@media (max-width: 400px) {
  .menu-grid { grid-template-columns: 1fr; }
  .resource-grid { grid-template-columns: 1fr; }
  .topbar-title { max-width: 95px; }
  .btn-start-selling {
    font-size: 13px;
    padding: 12px 10px;
  }
}

/* ══════════════════════════════════════════════
   PRODUCTS PAGE (DESKTOP & MOBILE RESPONSIVE)
══════════════════════════════════════════════ */
.prod-quick-stats-bar {
  background: linear-gradient(135deg, rgba(26,122,74,.08), rgba(34,168,101,.04));
  border: 1px solid rgba(26,122,74,.2);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.pqs-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.pqs-item {
  font-size: 13.5px;
  color: var(--text);
  font-weight: 600;
}
.pqs-user-badge {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12.5px;
  color: var(--text-muted);
}
.pqs-user-badge strong {
  color: var(--primary);
}

.prod-filter-card {
  margin-bottom: 20px;
  padding: 16px 20px;
}
.prod-filter-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.pff-search {
  flex: 2;
  min-width: 220px;
}
.pff-select-wrap {
  flex: 1;
  min-width: 170px;
}
.pff-btn-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}
.pff-btn-submit {
  padding: 10px 18px;
  white-space: nowrap;
}
.pff-btn-reset {
  padding: 10px 14px;
  white-space: nowrap;
}

/* Mobile Product Cards */
.prod-mobile-list {
  display: none;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}
.prod-mobile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.prod-mobile-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}
.pm-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.pm-thumb-box {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.pm-thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pm-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}
.pm-title-box {
  flex: 1;
  min-width: 0;
}
.pm-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  margin: 0 0 6px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pm-title a {
  color: inherit;
  text-decoration: none;
}
.pm-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  align-items: center;
}
.pm-tag {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1.2;
}
.pm-tag-sku {
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.pm-tag-cat {
  color: var(--primary);
  background: rgba(26,122,74,.08);
  font-weight: 600;
}

.pm-pricing-row {
  background: #fff5f5;
  border: 1px solid #fed7d7;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.pm-price-group {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}
.pm-price-lbl {
  font-size: 12px;
  color: #7f1d1d;
  font-weight: 600;
}
.pm-price-val {
  font-size: 15.5px;
  font-weight: 800;
  color: #d92525;
}
.pm-price-old {
  font-size: 11.5px;
  color: var(--text-muted);
  text-decoration: line-through;
}
.pm-comm-group {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  padding: 3px 8px;
  border-radius: 16px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.pm-comm-rate {
  font-size: 10.5px;
  opacity: .85;
}

.pm-actions-group {
  display: flex;
  gap: 8px;
  align-items: center;
}
.pm-btn-view {
  flex: 1;
  justify-content: center;
  padding: 8px 10px;
  font-weight: 700;
  font-size: 12.5px;
  white-space: nowrap;
}
.pm-btn-copy {
  flex: 1.5;
  justify-content: center;
  padding: 8px 10px;
  font-weight: 700;
  font-size: 12.5px;
  white-space: nowrap;
}

/* Chuyển đổi giữa Desktop và Mobile */
@media (max-width: 768px) {
  .prod-desktop-table-wrap {
    display: none !important;
  }
  .prod-mobile-list {
    display: flex !important;
  }
  .prod-filter-card {
    padding: 12px 14px;
  }
  .prod-filter-form {
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
  }
  .pff-search, .pff-select-wrap {
    min-width: 100%;
    width: 100%;
  }
  .pff-btn-wrap {
    width: 100%;
  }
  .pff-btn-submit {
    flex: 1;
    justify-content: center;
  }
  .pff-btn-reset {
    flex: 0 0 auto;
  }
}

/* ── 📊 Progress Bars Doanh Thu (Tháng & Trọn Đời) ─────────────────────────── */
.revenue-progress-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.rev-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.04);
  position: relative;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}

.rev-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.rev-card.rev-card-month {
  border-color: rgba(16, 185, 129, 0.35);
  background: linear-gradient(180deg, rgba(16,185,129,0.03) 0%, var(--surface) 100%);
}

.rev-card.rev-card-lifetime {
  border-color: rgba(99, 102, 241, 0.35);
  background: linear-gradient(180deg, rgba(99,102,241,0.03) 0%, var(--surface) 100%);
}

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

.rev-card-title-group h3 {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.rev-card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.rev-current-amount {
  font-size: 20px;
  font-weight: 900;
  color: var(--primary);
  line-height: 1.2;
  text-align: right;
  white-space: nowrap;
}

.rev-current-amount.amount-lifetime {
  color: #4f46e5;
}

.rev-progress-container {
  position: relative;
  margin: 22px 0 28px;
}

.rev-progress-track {
  height: 10px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.rev-progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width .8s cubic-bezier(0.4, 0, 0.2, 1);
}

.rev-fill-month {
  background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.rev-fill-lifetime {
  background: linear-gradient(90deg, #6366f1 0%, #a855f7 50%, #f59e0b 100%);
}

/* Các điểm mốc Milestone */
.rev-milestones-row {
  position: absolute;
  top: -5px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.rev-milestone-marker {
  position: absolute;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.rev-milestone-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  transition: all .3s ease;
  font-size: 10px;
  font-weight: 800;
  color: #64748b;
}

.rev-milestone-marker.achieved .rev-milestone-dot {
  background: #10b981;
  border-color: #059669;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(16,185,129,0.5);
}

.rev-milestone-marker.achieved.marker-lifetime .rev-milestone-dot {
  background: #f59e0b;
  border-color: #d97706;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(245,158,11,0.5);
}

.rev-milestone-label {
  margin-top: 16px;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  white-space: nowrap;
  text-align: center;
}

.rev-milestone-marker.achieved .rev-milestone-label {
  color: var(--text);
  font-weight: 800;
}

.rev-card-footer {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text);
}

.rev-card-footer strong {
  color: var(--primary);
}

@media (max-width: 520px) {
  .revenue-progress-grid {
    grid-template-columns: 1fr;
  }
  .rev-current-amount {
    font-size: 17px;
  }
  .rev-milestone-label {
    font-size: 9.5px;
  }
}

/* ── PDF Viewer Wrap ── */
.pdf-viewer-wrap {
  position: relative;
  width: 100%;
  min-height: 600px;
  height: 80vh;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #525659;
  border: 1px solid var(--border);
}

.pdf-viewer-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

@media (max-width: 768px) {
  .pdf-viewer-wrap {
    min-height: 480px;
    height: 70vh;
  }
}
