/* ===== RESET & BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #6b57ff;
  --primary-deep: #6e36ff;
  --primary-light: #f2edff;
  --primary-hover: #6e36ff;
  --primary-pale: #f9f7ff;
  --bg: #FAFAFC;
  --bg-card: #FFFFFF;
  --bg-subtle: #F9F7FF;
  --text-primary: #1c1c1c;
  --text-secondary: #444444;
  --text-muted: #68686d;
  --text-link: #6b57ff;
  --border: rgba(5, 0, 9, 0.08);
  --border-strong: rgba(5, 0, 9, 0.12);
  --radius: 8px;
  --radius-sm: 4px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(107,87,255,0.06);
  --shadow-md: 0 2px 8px rgba(107,87,255,0.10);
  --shadow-lg: 0 4px 16px rgba(107,87,255,0.14);
  --shadow-card: 0 2px 12px rgba(0,0,0,0.08);
  --green: #22c55e;
  --green-bg: rgba(34, 197, 94, 0.1);
  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, 0.1);
  --orange: #f97316;
  --orange-bg: rgba(249, 115, 22, 0.1);
  --yellow: #ffd663;
  --blue: #3b82f6;
  --blue-bg: rgba(59, 130, 246, 0.1);
  --sidebar-width: 280px;
  --topnav-height: 64px;
  --content-max: 1200px;
  --font: 'HarmonyOS Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --ease-fast: all .15s cubic-bezier(.4,0,.2,1);
  --ease-base: all .2s cubic-bezier(.4,0,.2,1);
}

html { font-size: 14px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--text-link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== TOP NAV ===== */
.topnav {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  height: var(--topnav-height);
}
.topnav-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 32px;
  height: 100%;
  display: flex; align-items: center; justify-content: space-between;
}
.topnav-left { display: flex; align-items: center; gap: 32px; }
.topnav-right { display: flex; align-items: center; gap: 16px; }

.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.logo-img { height: 28px; width: auto; display: block; }
.logo-img-footer { height: 24px; filter: brightness(0) invert(1); }

.nav-links { display: flex; gap: 4px; }
.nav-links a, .nav-link-wrap > a {
  display: flex; align-items: center; gap: 4px;
  padding: 8px 12px;
  font-size: 14px; font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: var(--ease-fast);
}
.nav-links a:hover, .nav-link-wrap > a:hover { background: var(--bg-subtle); text-decoration: none; }
.nav-links svg { opacity: 0.5; }

.btn-download {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 20px;
  background: var(--primary);
  color: #fff !important;
  font-size: 14px; font-weight: 600;
  border-radius: var(--radius);
  text-decoration: none !important;
  transition: var(--ease-fast);
  font-family: var(--font);
}
.btn-download:hover { background: var(--primary-hover); }

.icon-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: none; cursor: pointer;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: background 0.15s;
}
.icon-btn:hover { background: var(--bg-subtle); }

/* ===== MAIN LAYOUT ===== */
.main-layout {
  display: flex;
  width: var(--content-max);
  max-width: 100%;
  margin: 0 auto;
  flex: 1;
  min-height: calc(100vh - var(--topnav-height) - 140px);
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  position: sticky;
  top: var(--topnav-height);
  height: calc(100vh - var(--topnav-height));
  overflow: hidden;
}
.sidebar-scroll {
  height: 100%;
  overflow-y: auto;
  padding: 28px 0;
}
.sidebar-scroll::-webkit-scrollbar { width: 4px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 2px; }

.user-profile {
  display: flex; flex-direction: row; align-items: center;
  padding: 0 20px 20px;
  gap: 12px;
}
.user-info { flex: 1; min-width: 0; }
.user-edit-btn {
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: none; cursor: pointer;
  color: var(--text-muted); flex-shrink: 0; transition: var(--ease-fast);
}
.user-edit-btn:hover { background: var(--bg-subtle); color: var(--primary); }
.avatar {
  width: 52px; height: 52px; flex-shrink: 0;
  border-radius: 50%;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
}
.user-name { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-email { font-size: 12px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== TIER BADGE CARD ===== */
/* ===== USER PLAN TAG ===== */
.user-plan-tag {
  display: inline-block; vertical-align: middle;
  padding: 1px 6px; margin-left: 4px;
  font-size: 10px; font-weight: 600; line-height: 16px;
  background: var(--primary); color: #fff;
  border-radius: var(--radius-sm);
}

/* ===== SUBSCRIPTION BADGE (sidebar) ===== */
.sub-badge {
  margin: 0 16px 8px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-radius: var(--radius);
  color: #fff;
}
.sub-badge-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 4px;
}
.sub-badge-plan { font-size: 12px; font-weight: 600; }
.sub-badge-status {
  display: inline-flex; padding: 1px 6px;
  font-size: 9px; font-weight: 600; line-height: 14px;
  background: var(--green); color: #fff;
  border-radius: 10px;
}
.sub-badge-date { font-size: 11px; opacity: 0.6; margin-bottom: 4px; }
.sub-badge-link {
  font-size: 11px; color: rgba(255,255,255,0.7);
  text-decoration: none !important;
  transition: var(--ease-fast);
}
.sub-badge-link:hover { color: #fff; }

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 20px;
}

.nav-group { padding: 4px 0; }
.nav-group-label {
  padding: 6px 20px 6px;
  font-size: 11px; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 20px;
  font-size: 14px; font-weight: 500;
  color: var(--text-primary);
  text-decoration: none !important;
  transition: all 0.15s;
  cursor: pointer;
  position: relative;
}
.nav-item:hover { background: var(--bg-subtle); }
.nav-item.active {
  background: linear-gradient(90deg, var(--primary-light) 0%, transparent 100%);
  color: var(--primary);
  font-weight: 600;
}
.nav-item.active svg { stroke: var(--primary); }
.nav-item svg { flex-shrink: 0; color: var(--text-muted); }
.nav-item.active svg { color: var(--primary); }

.nav-badge-promo {
  margin-left: auto;
  padding: 1px 6px;
  font-size: 10px; font-weight: 600;
  background: var(--orange-bg);
  color: var(--orange);
  border-radius: 4px;
}

.nav-external { }
.nav-logout { margin-top: 4px; }
.nav-logout span { color: var(--text-muted); }

/* ===== CONTENT ===== */
.content {
  width: calc(var(--content-max) - var(--sidebar-width));
  min-width: 0;
  max-width: calc(var(--content-max) - var(--sidebar-width));
  flex-shrink: 0;
  padding: 32px 40px 48px;
  overflow-y: auto;
}

.page-title {
  font-size: 22px; font-weight: 700;
  margin-bottom: 4px;
}
.page-subtitle {
  font-size: 13px; color: var(--text-secondary);
  margin-bottom: 24px;
}

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.page-header .page-title { margin-bottom: 0; }

/* ===== DASHBOARD PRODUCT CARD ===== */
.dash-product-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px;
}
.dash-product-left {
  display: flex; align-items: center; gap: 14px;
}
.dash-product-logo {
  width: 44px; height: 44px; border-radius: 50%;
  object-fit: contain;
}
.dash-product-name { font-size: 20px; font-weight: 700; margin-right: 4px; }
.dash-all-products {
  font-size: 14px; font-weight: 500; color: var(--primary);
  text-decoration: none; white-space: nowrap;
}
.dash-all-products:hover { text-decoration: underline; }
.dash-stats-card {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}
.dash-stat { flex: 1; }
.dash-stat-divider {
  width: 1px; background: var(--border);
  margin: 0 24px; flex-shrink: 0;
}
.dash-stat-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.dash-stat-label { font-size: 13px; color: var(--text-secondary); }
.dash-stat-link { font-size: 13px; font-weight: 500; color: var(--primary); text-decoration: none; }
.dash-stat-link:hover { text-decoration: underline; }
.dash-stat-number {
  display: flex; align-items: baseline; gap: 6px;
  margin-bottom: 12px;
}
.dash-stat-big { font-size: 36px; font-weight: 700; color: var(--text-primary); }
.dash-stat-total { font-size: 14px; color: var(--text-muted); }
.dash-tooltip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--border); color: var(--text-muted);
  font-size: 10px; font-weight: 700; cursor: help;
  vertical-align: middle; margin-left: 2px;
  position: relative;
}
.dash-tooltip:hover { background: var(--primary); color: #fff; }
.dash-tooltip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #222;
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  padding: 8px 12px;
  border-radius: 6px;
  white-space: normal;
  width: 240px;
  text-align: left;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s, visibility 0.15s;
  z-index: 100;
}
.dash-tooltip::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #222;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s, visibility 0.15s;
  z-index: 100;
}
.dash-tooltip:hover::after,
.dash-tooltip:hover::before {
  opacity: 1;
  visibility: visible;
}
.dash-progress {
  height: 6px; background: var(--border);
  border-radius: 3px; overflow: hidden;
}
.dash-progress-fill {
  height: 100%; border-radius: 3px;
  background: var(--primary);
  transition: width 0.3s;
}

/* ===== TABS ===== */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  gap: 0;
}
.tab {
  padding: 12px 20px;
  font-size: 14px; font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
}
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--primary); font-weight: 600; border-bottom-color: var(--primary); }

/* ===== CARDS ===== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}
.mp-section { transition: box-shadow .2s, transform .2s; }
.mp-section:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.mp-toggle:hover { color: var(--primary) !important; }
.action-tip-bubble {
  display: none;
  position: absolute;
  bottom: calc(100% + 10px);
  right: -12px;
  width: 260px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 400;
  line-height: 20px;
  padding: 14px 16px;
  border-radius: var(--radius);
  box-shadow: 0 4px 24px rgba(0,0,0,.15);
  border: 1px solid var(--border);
  text-align: left;
  z-index: 200;
}
.action-tip-bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  right: 18px;
  border: 6px solid transparent;
  border-top-color: var(--bg-card);
}
.action-tip-bubble::before {
  content: '';
  position: absolute;
  top: 100%;
  right: 17px;
  border: 7px solid transparent;
  border-top-color: var(--border);
}
.action-tip:hover .action-tip-bubble { display: block; }
.tip-down .action-tip-bubble {
  bottom: auto; top: calc(100% + 10px);
  right: auto; left: -12px;
}
.tip-down .action-tip-bubble::after {
  top: auto; bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: var(--bg-card);
  right: auto; left: 18px;
}
.tip-down .action-tip-bubble::before {
  top: auto; bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: var(--border);
  right: auto; left: 17px;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px;
}
.card-body { padding: 0 24px 20px; }

/* ===== PRODUCT INFO CARD ===== */
.product-name-row {
  display: flex; align-items: center; gap: 10px;
}
.product-icon {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12px; font-weight: 700;
}
.product-name { font-size: 16px; font-weight: 700; }

.platform-toggle {
  display: flex; align-items: center; gap: 2px;
  background: transparent;
}
.platform-toggle button {
  padding: 5px 14px;
  font-size: 12px; font-weight: 500;
  border: 1px solid var(--border); cursor: pointer;
  background: transparent; color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: var(--ease-fast);
  font-family: var(--font);
}
.platform-toggle button:hover { border-color: var(--blue); color: var(--blue); }
.platform-toggle button.active {
  background: var(--blue); color: #fff; border-color: var(--blue);
}

.stats-row {
  display: flex; gap: 0;
}
.stat-block {
  flex: 1; padding-right: 24px;
}
.stat-block + .stat-block {
  padding-left: 24px; padding-right: 0;
  border-left: 1px solid var(--border);
}
.stat-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.stat-label { font-size: 13px; color: var(--text-secondary); }
.stat-link { font-size: 13px; font-weight: 500; }
.stat-number {
  display: flex; align-items: baseline; gap: 6px;
}
.stat-big { font-size: 32px; font-weight: 700; }
.stat-total { font-size: 14px; color: var(--text-secondary); }
.progress-bar {
  height: 4px; background: var(--border);
  border-radius: 2px; margin-top: 10px; overflow: hidden;
}
.progress-fill {
  height: 100%; background: var(--primary); border-radius: 2px;
  transition: width 0.3s;
}

/* ===== PROMO AREA ===== */
.dash-state { display: none; }
.dash-state.active { display: block; }

/* Dev tab — fixed to right edge of viewport */
.dash-dev-tab {
  position: fixed; right: 0; top: 50%;
  transform: translateY(-50%);
  z-index: 90;
  display: flex; flex-direction: column; gap: 2px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  padding: 6px 4px;
  box-shadow: var(--shadow-md);
}
.dash-dev-label {
  font-size: 9px; font-weight: 700; color: var(--orange);
  text-align: center; letter-spacing: 1px; padding-bottom: 4px;
  border-bottom: 1px solid var(--border); margin-bottom: 2px;
}
.promo-dev-btn {
  padding: 3px 10px; font-size: 11px; font-weight: 500;
  border: none; background: transparent; cursor: pointer;
  border-radius: 3px; color: var(--text-muted);
  font-family: var(--font); transition: var(--ease-fast);
}
.promo-dev-btn:hover { color: var(--text-primary); }
.promo-dev-btn.active { background: var(--primary); color: #fff; }

/* Empty card */
.promo-empty-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
}

/* Congrats card */
.promo-congrats-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 20px;
}

/* Banner shared */
.promo-banner {
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  display: flex; justify-content: space-between; align-items: center;
  color: #fff;
  margin-bottom: 20px;
}
.promo-banner-purple {
  background: linear-gradient(135deg, #6b57ff 0%, #8a5dff 40%, #a78bfa 100%);
}
.promo-banner-blue {
  background: linear-gradient(135deg, #0792ea 0%, #5b9cf5 50%, #a78bfa 100%);
}
.promo-banner-left { max-width: 62%; }
.promo-banner-right { text-align: right; flex-shrink: 0; }

.promo-badge-yellow {
  display: inline-block; padding: 4px 12px;
  background: var(--yellow); color: #8a5600;
  font-size: 12px; font-weight: 700;
  border-radius: var(--radius-sm); margin-bottom: 10px;
}
.promo-banner-title { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.promo-banner-desc { font-size: 13px; opacity: 0.9; line-height: 1.6; margin-bottom: 14px; }
.promo-banner-features {
  display: flex; align-items: center; gap: 12px;
  font-size: 13px; font-weight: 500;
}
.promo-feat-divider {
  width: 1px; height: 14px; background: rgba(255,255,255,0.35);
}

.promo-price-old {
  font-size: 14px; opacity: 0.55; text-decoration: line-through;
}
.promo-price-current {
  font-size: 36px; font-weight: 700; margin: 2px 0 14px;
}
.promo-price-orange { color: var(--orange); }
.promo-price-yellow { color: var(--yellow); }
.promo-price-white { color: #fff; }
.promo-per-product {
  font-size: 12px; opacity: 0.7; margin-top: 8px;
}

.btn-promo-buy {
  display: inline-block; padding: 10px 28px;
  background: #fff; color: var(--primary);
  font-size: 14px; font-weight: 600;
  border-radius: var(--radius); border: none;
  text-decoration: none !important; cursor: pointer;
  transition: var(--ease-fast); font-family: var(--font);
}
.btn-promo-buy:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

/* ===== SERVICE CARDS ===== */
.section-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.section-title { font-size: 18px; font-weight: 700; }
.section-link { font-size: 13px; font-weight: 500; }

.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 24px; }
.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.service-card-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 10px;
}
.service-icon {
  width: 40px; height: 40px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; background: #f5f3ff;
}
.service-card-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.service-card-desc { font-size: 12px; color: var(--text-secondary); margin-bottom: 10px; line-height: 1.5; }
.service-card-link { font-size: 13px; font-weight: 500; }

/* ===== BADGE ===== */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  font-size: 11px; font-weight: 600;
  border-radius: 10px;
}
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-orange { background: var(--orange-bg); color: var(--orange); }
.badge-blue { background: var(--blue-bg); color: var(--blue); }
.badge-purple { background: var(--primary-light); color: var(--primary); }
.badge-gray { background: rgba(0,0,0,0.06); color: var(--text-secondary); }

/* ===== OS CARDS (Orders & Subscriptions) ===== */
.os-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.os-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.os-card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.os-card-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600;
}
.os-card-icon { display: none; }
.os-card-icon-img {
  width: 20px; height: 20px; border-radius: 4px;
  object-fit: contain;
}
.os-card-value {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; margin-bottom: 4px;
}
.os-card-meta { font-size: 12px; color: var(--text-secondary); }

/* ===== TABLE ===== */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.data-table td {
  padding: 14px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-subtle); }

.product-cell { display: flex; flex-direction: column; gap: 2px; }
.product-cell .sub-text { font-size: 11px; color: var(--text-muted); }

.action-btn {
  padding: 4px 8px; border: none; background: none;
  cursor: pointer; color: var(--text-muted); font-size: 16px;
  border-radius: var(--radius-sm);
}
.action-btn:hover { background: var(--bg-subtle); }

.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 4px; margin-top: 20px;
}
.page-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  cursor: pointer; background: var(--bg-card);
  color: var(--text-primary);
  transition: all 0.15s;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-btn.disabled { opacity: 0.3; cursor: not-allowed; }

/* ===== FORM ELEMENTS ===== */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.form-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  outline: none;
  transition: border-color 0.15s;
}
.form-input:focus { border-color: var(--primary); }

.radio-group { display: flex; gap: 20px; align-items: center; }
.radio-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 14px; cursor: pointer;
}
.radio-label input[type="radio"] { accent-color: var(--primary); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 20px;
  font-size: 14px; font-weight: 600;
  border-radius: var(--radius-sm);
  border: none; cursor: pointer;
  font-family: var(--font);
  transition: all 0.15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn-outline:hover { background: var(--bg-subtle); }
.btn-danger { background: var(--red); color: #fff; }
.btn-sm { padding: 5px 14px; font-size: 13px; }

/* ===== ACCOUNT SETTINGS CARD ===== */
.settings-row {
  display: flex; gap: 16px;
}
.settings-item {
  flex: 1;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  background: var(--bg);
  border-radius: var(--radius);
}
.settings-icon {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--bg-subtle);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary); flex-shrink: 0;
}
.settings-info { flex: 1; min-width: 0; }
.settings-label { font-size: 12px; color: var(--text-muted); margin-bottom: 2px; }
.settings-value { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-action { flex-shrink: 0; }

/* ===== SUBSCRIPTION CARD ===== */
.sub-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 16px;
}
.sub-item-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 4px;
}
.sub-item-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 16px; font-weight: 600;
}
.sub-item-id { font-size: 12px; color: var(--text-muted); margin-bottom: 16px; }
.sub-item-stats {
  display: flex; gap: 0;
  background: var(--bg);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.sub-stat {
  flex: 1; padding: 12px 16px;
}
.sub-stat + .sub-stat { border-left: 1px solid var(--border); }
.sub-stat-label { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.sub-stat-value { font-size: 14px; font-weight: 600; }
.sub-stat-note { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }

/* ===== COUPON CARDS ===== */
.coupon-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.coupon-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  background: var(--bg-card);
}
.coupon-left {
  width: 100px; min-height: 100px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--orange-bg) 0%, rgba(250,100,0,0.15) 100%);
  border-right: 1px dashed var(--border);
  padding: 12px;
}
.coupon-amount { font-size: 24px; font-weight: 700; color: var(--orange); }
.coupon-type { font-size: 11px; color: var(--text-secondary); }
.coupon-right { flex: 1; padding: 14px 16px; display: flex; flex-direction: column; justify-content: center; }
.coupon-desc { font-size: 13px; margin-bottom: 6px; line-height: 1.5; }
.coupon-expiry { font-size: 12px; color: var(--text-muted); }

/* ===== EXTENDED SERVICES DETAIL ===== */
.ext-service-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex; gap: 20px;
  margin-bottom: 16px;
}
.ext-service-icon {
  width: 64px; height: 64px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; flex-shrink: 0;
}
.ext-service-content { flex: 1; }
.ext-service-name { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.ext-service-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 12px; }
.ext-service-pricing { display: flex; align-items: center; gap: 16px; }
.ext-price-item { display: flex; align-items: baseline; gap: 4px; }
.ext-price-label { font-size: 12px; color: var(--text-muted); }
.ext-price-value { font-size: 20px; font-weight: 700; color: var(--primary); }
.ext-service-action { display: flex; align-items: flex-end; flex-shrink: 0; }

/* ===== LICENSE MANAGEMENT ===== */
.license-header { margin-bottom: 20px; }
.license-stat-row {
  display: flex; align-items: center; gap: 16px; margin-bottom: 16px;
}
.license-stat-num { font-size: 28px; font-weight: 700; }
.license-stat-label { font-size: 14px; color: var(--text-secondary); }
.license-progress {
  height: 6px; background: var(--border);
  border-radius: 3px; overflow: hidden; margin-bottom: 24px;
}
.license-progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--primary), #8a5dff);
  border-radius: 3px;
}
.license-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 20px; }

/* ===== SUPPORT TICKET ===== */
.ticket-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 20px;
  text-align: center;
}
.ticket-empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.3; }
.ticket-empty-text { font-size: 15px; color: var(--text-secondary); margin-bottom: 20px; }

/* ===== RECOMMENDED PRODUCTS ===== */
.products-row { display: flex; gap: 16px; margin-bottom: 24px; }
.rec-product {
  flex: 1; min-width: 0;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--ease-fast);
  display: flex; align-items: center; gap: 10px;
}
.rec-product:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.rec-product-img {
  width: 36px; height: 36px; border-radius: 8px;
  object-fit: contain; flex-shrink: 0;
}
.rec-product-name { font-size: 13px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.rec-product-badge {
  padding: 3px 10px;
  font-size: 11px; font-weight: 700;
  background: var(--orange);
  color: #fff;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--text-primary);
  color: rgba(255,255,255,0.6);
  font-size: 12px;
  padding: 28px 32px;
}
.footer-inner { max-width: var(--content-max); margin: 0 auto; }
.footer-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.footer-logo { display: flex; align-items: center; gap: 8px; }
.footer-logo .logo-img-footer { height: 22px; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: rgba(255,255,255,0.6); font-size: 12px; }
.footer-links a:hover { color: #fff; }
.footer-lang select {
  background: rgba(255,255,255,0.1);
  color: #fff; border: 1px solid rgba(255,255,255,0.2);
  padding: 4px 10px; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 12px;
}
.footer-copyright { margin-bottom: 8px; }
.footer-disclaimer { font-size: 11px; opacity: 0.5; line-height: 1.6; }

/* ===== MODAL / OVERLAY ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(5,0,9,0.45);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(5,0,9,0.18);
  width: 520px; max-width: 92vw;
  max-height: 88vh; overflow-y: auto;
  padding: 32px;
  position: relative;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.2s;
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }
.modal.modal-lg { width: 720px; }
.modal.modal-sm { width: 400px; }

.modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: var(--bg); border-radius: 50%;
  cursor: pointer; color: var(--text-secondary); font-size: 16px;
  transition: background 0.15s;
}
.modal-close:hover { background: var(--border); }

.modal-title {
  font-size: 18px; font-weight: 700;
  margin-bottom: 8px; text-align: center;
  padding-right: 24px;
}
.modal-subtitle {
  font-size: 13px; color: var(--text-secondary);
  text-align: center; margin-bottom: 24px;
}
.modal-body { margin-bottom: 24px; }
.modal-footer {
  display: flex; align-items: center; justify-content: center; gap: 12px;
}
.modal-footer.right { justify-content: flex-end; }

/* ===== STEPPER ===== */
.stepper {
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 28px; gap: 0;
  flex-wrap: nowrap;
}
.stepper-step {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 500; color: var(--text-muted);
  white-space: nowrap; flex-shrink: 0;
}
.stepper-step.active { color: var(--primary); font-weight: 600; }
.stepper-step.done { color: var(--green); }
.stepper-dot {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  border: 2px solid var(--border);
  color: var(--text-muted); background: var(--bg-card);
  flex-shrink: 0;
}
.stepper-step.active .stepper-dot { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.stepper-step.done .stepper-dot { border-color: var(--green); color: #fff; background: var(--green); }
.stepper-line {
  width: 32px; height: 2px;
  background: var(--border);
  margin: 0 6px;
  flex-shrink: 0;
}
.stepper-step.done + .stepper-line,
.stepper-line.done { background: var(--green); }

/* ===== VERIFICATION CODE INPUT ===== */
.code-inputs {
  display: flex; gap: 10px; justify-content: center; margin: 20px 0;
}
.code-input {
  width: 48px; height: 56px;
  text-align: center; font-size: 24px; font-weight: 700;
  border: 2px solid var(--border-strong);
  border-radius: var(--radius);
  font-family: var(--font);
  outline: none; transition: border-color 0.15s;
}
.code-input:focus { border-color: var(--primary); }

/* ===== DROPDOWN MENU ===== */
.dropdown-wrap { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 160px;
  z-index: 50;
  padding: 4px 0;
  display: none;
}
.dropdown-menu.show { display: block; }
.dropdown-item {
  display: block; width: 100%;
  padding: 8px 16px;
  font-size: 13px; font-weight: 500;
  color: var(--text-primary);
  text-align: left; border: none; background: none;
  cursor: pointer; font-family: var(--font);
  transition: background 0.1s;
}
.dropdown-item:hover { background: var(--bg-subtle); }
.dropdown-item.danger { color: var(--red); }
.dropdown-item.disabled { color: var(--text-muted); cursor: not-allowed; }
.dropdown-item.disabled:hover { background: none; }

/* ===== TOAST ===== */
.toast-container {
  position: fixed; top: 80px; right: 24px; z-index: 300;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--green);
  font-size: 13px; font-weight: 500;
  transform: translateX(120%);
  transition: transform 0.3s ease;
  min-width: 280px;
}
.toast.show { transform: translateX(0); }
.toast.toast-error { border-left-color: var(--red); }
.toast.toast-warning { border-left-color: var(--orange); }
.toast-icon { font-size: 18px; flex-shrink: 0; }

/* ===== TEXTAREA ===== */
.form-textarea {
  width: 100%; min-height: 100px;
  padding: 10px 14px;
  font-size: 14px; font-family: var(--font);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  outline: none; resize: vertical;
  transition: border-color 0.15s;
}
.form-textarea:focus { border-color: var(--primary); }

/* ===== SELECT ===== */
.form-select {
  width: 100%; padding: 10px 14px;
  font-size: 14px; font-family: var(--font);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  outline: none; background: var(--bg-card);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23666' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}
.form-select:focus { border-color: var(--primary); }

/* ===== SUCCESS STATE ===== */
.success-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--green-bg);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  font-size: 28px;
}
.success-text { text-align: center; font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.success-detail { text-align: center; font-size: 13px; color: var(--text-secondary); margin-bottom: 24px; }

/* ===== UPGRADE OFFER CARD (in modal) ===== */
.upgrade-offer-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 20px;
  margin: 16px 0;
  position: relative;
}
.upgrade-offer-card .offer-ribbon {
  position: absolute; top: 12px; right: -4px;
  background: var(--red);
  color: #fff; font-size: 10px; font-weight: 700;
  padding: 3px 10px;
  border-radius: 4px 0 0 4px;
}
.offer-price-row { display: flex; align-items: baseline; gap: 12px; margin-top: 10px; }
.offer-price-label { font-size: 12px; color: var(--text-muted); }
.offer-price-old { font-size: 13px; color: var(--text-muted); text-decoration: line-through; }
.offer-price-discount { font-size: 13px; color: var(--green); font-weight: 600; }
.offer-price-final { font-size: 22px; font-weight: 700; color: var(--primary); }

/* ===== CHECKBOX LIST ===== */
.checkbox-list { display: flex; flex-direction: column; gap: 8px; }
.checkbox-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; cursor: pointer; padding: 6px 0;
}
.checkbox-label input[type="checkbox"] { accent-color: var(--primary); width: 16px; height: 16px; }

/* ===== LINK BUTTON ===== */
.link-btn {
  background: none; border: none;
  color: var(--text-link); font-size: 13px; font-weight: 500;
  cursor: pointer; font-family: var(--font);
  padding: 0; text-decoration: underline;
}
.link-btn:hover { color: var(--primary-hover); }

/* ===== TOP NAV DROPDOWNS ===== */
.nav-links { position: relative; }
.nav-link-wrap { position: relative; }
.nav-dropdown {
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  min-width: 200px; padding: 8px 0; z-index: 120;
  opacity: 0; pointer-events: none; transition: opacity 0.15s, transform 0.15s;
  transform: translateX(-50%) translateY(4px);
}
.nav-link-wrap:hover .nav-dropdown {
  opacity: 1; pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.nav-dropdown a {
  display: block; padding: 8px 16px; font-size: 13px; font-weight: 500;
  color: var(--text-primary); text-decoration: none !important;
  transition: background 0.1s;
}
.nav-dropdown a:hover { background: var(--bg-subtle); color: var(--primary); }

/* ===== NOTIFICATION POPUP ===== */
.notif-popup {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  width: 320px; z-index: 120;
  display: none;
}
.notif-popup.show { display: block; }
.notif-popup-header {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  font-size: 14px; font-weight: 600;
  display: flex; justify-content: space-between; align-items: center;
}
.notif-popup-body { max-height: 280px; overflow-y: auto; }
.notif-item {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background 0.1s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg-subtle); }
.notif-item-title { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.notif-item-desc { font-size: 12px; color: var(--text-muted); }
.notif-item-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red);
}

/* ===== USER AVATAR DROPDOWN ===== */
.avatar-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  width: 200px; z-index: 120; padding: 8px 0;
  display: none;
}
.avatar-dropdown.show { display: block; }
.avatar-dropdown a, .avatar-dropdown button {
  display: block; width: 100%; padding: 8px 16px; font-size: 13px; font-weight: 500;
  color: var(--text-primary); text-align: left; border: none; background: none;
  cursor: pointer; font-family: var(--font); text-decoration: none !important;
  transition: background 0.1s;
}
.avatar-dropdown a:hover, .avatar-dropdown button:hover { background: var(--bg-subtle); }
.avatar-dropdown .danger { color: var(--red); }

/* ===== PROFILE AVATAR ===== */
.profile-avatar-wrap {
  position: relative; display: inline-block; cursor: pointer;
}
.profile-avatar-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.5);
  border-radius: 50%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.15s; cursor: pointer;
}
.profile-avatar-wrap:hover .profile-avatar-overlay { opacity: 1; }

/* ===== FORM ERROR ===== */
.form-error {
  font-size: 12px; color: var(--red); margin-top: 4px;
}

/* ===== SPINNER ===== */
.spinner {
  width: 32px; height: 32px; margin: 0 auto;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .topnav-inner { padding: 0 16px; }
  .sidebar { display: none; }
  .content { width: 100%; max-width: 100%; padding: 24px 16px 32px; }
  .nav-links { display: none; }
  .os-grid { grid-template-columns: 1fr; }
  .coupon-grid { grid-template-columns: 1fr; }
  .settings-row { flex-direction: column; }
}
