:root {
  --bg-canvas: #F7F9F8;
  --surface: #FFFFFF;
  --surface-low: #EFF5F0;
  --surface-high: #E8F2EE;
  --border: #E7ECE9;
  --border-strong: #D3DDD7;

  --forest: #153F32;
  --forest-hover: #214F32;
  --lime: #DCF29E;
  --lime-hover: #CEEA84;
  --on-lime: #153F32;

  --shopee: #ED5C32;
  --shopee-tint: #FFEDE8;

  --text: #171D1A;
  --text-muted: #4F5A54;
  --text-outline: #717974;

  --success: #15803D;
  --success-bg: #DCFCE7;
  --info: #1D4ED8;
  --info-bg: #DBEAFE;
  --warning: #B45309;
  --warning-bg: #FEF3C7;
  --danger: #DC2626;
  --danger-bg: #FEE2E2;
  --gray-text: #4B5563;
  --gray-bg: #F3F4F6;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 9999px;

  --shadow-modal: 0 12px 32px -8px rgba(21, 63, 50, 0.14);
  --shadow-toast: 0 10px 28px rgba(21, 63, 50, 0.22);
  --font: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-canvas);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 22px;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

input, select, textarea {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--forest);
  outline-offset: 2px;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--surface-low);
  color: var(--forest);
  padding: 1px 6px;
  border-radius: 5px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 100;
  background: var(--forest);
  color: #FFFFFF;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-weight: 600;
}
.skip-link:focus {
  top: 12px;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ==================== APP SHELL (USER) ==================== */

.app-shell {
  min-height: 100vh;
  display: flex;
  background: var(--bg-canvas);
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 236px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px 16px;
  z-index: 40;
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(23, 29, 26, 0.4);
  z-index: 35;
}
.sidebar-backdrop.open {
  display: block;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 6px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--forest);
}

.brand-badge {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--forest);
  color: var(--lime);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
}

.brand-dot {
  color: var(--forest);
}

.brand-tagline {
  margin: 12px 0 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

.sidebar-close {
  display: none;
}

.workspace-label {
  margin: 22px 10px 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-outline);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 14px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-item-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.nav-item:hover {
  background: var(--surface-low);
  color: var(--text);
}

.nav-item.active {
  background: var(--forest);
  color: #FFFFFF;
  font-weight: 600;
}

.nav-count {
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--surface-low);
  color: var(--forest);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.nav-item.active .nav-count {
  background: rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
}

.sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 14px;
}

.sidebar-wallet-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-high);
  border: 1px solid var(--border);
  transition: background-color 0.15s ease;
}
.sidebar-wallet-card:hover {
  background: #DFECE7;
}
.sidebar-wallet-card small {
  font-size: 11px;
  font-weight: 600;
  color: var(--forest);
}
.sidebar-wallet-card strong {
  font-size: 16px;
  font-weight: 700;
  color: var(--forest);
  font-variant-numeric: tabular-nums;
}

.support-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
}
.support-btn:hover {
  background: var(--surface-low);
  color: var(--text);
}

.profile-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-canvas);
  text-align: left;
  transition: background-color 0.15s ease;
}
.profile-btn:hover {
  background: var(--surface-low);
}
.profile-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.profile-meta strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-meta small {
  font-size: 11px;
  color: var(--text-muted);
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  background: var(--forest);
  color: var(--lime);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
  border: none;
}

.main-shell {
  flex: 1;
  min-width: 0;
  margin-left: 236px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 64px;
  padding: 0 32px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 14px;
}
.breadcrumb .crumb-root {
  color: var(--text-muted);
  white-space: nowrap;
}
.breadcrumb .crumb-sep {
  width: 14px;
  height: 14px;
  color: var(--text-outline);
}
.breadcrumb strong {
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-menu {
  display: none;
}

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

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--surface-high);
  color: var(--forest);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.status-pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}

.user-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  transition: background-color 0.15s ease;
}
.user-pill-btn:hover {
  background: var(--surface-low);
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  display: inline-grid;
  place-items: center;
  position: relative;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.icon-btn:hover {
  background: var(--surface-low);
  color: var(--text);
}
.icon-btn.plain {
  border-color: transparent;
  background: transparent;
}
.icon-btn.unread::after {
  content: '';
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--shopee);
  box-shadow: 0 0 0 2px var(--surface);
}

.main-container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 28px 32px 48px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.account-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--surface-high);
  border: 1px solid #D3E4DD;
  color: var(--forest);
  font-size: 13px;
}
.account-banner-copy {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.page-heading h1 {
  margin: 0;
  font-size: 24px;
  line-height: 32px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text);
}
.page-heading p {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--text-muted);
}
.page-heading-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ==================== BUTTONS & INPUTS ==================== */

.primary-btn,
.secondary-btn,
.lime-btn,
.danger-btn,
.text-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  line-height: 20px;
  transition: background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
  white-space: nowrap;
}

.primary-btn {
  padding: 10px 18px;
  background: var(--forest);
  color: #FFFFFF;
  border: 1px solid var(--forest);
}
.primary-btn:hover:not(:disabled) {
  background: var(--forest-hover);
  border-color: var(--forest-hover);
}
.primary-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.lime-btn {
  padding: 11px 20px;
  background: var(--lime);
  color: var(--on-lime);
  border: 1px solid var(--lime);
  font-weight: 700;
}
.lime-btn:hover:not(:disabled) {
  background: var(--lime-hover);
  border-color: var(--lime-hover);
}
.lime-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.secondary-btn {
  padding: 9px 15px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.secondary-btn:hover:not(:disabled) {
  background: var(--surface-low);
}
.secondary-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.danger-btn {
  padding: 9px 16px;
  background: var(--danger);
  color: #FFFFFF;
  border: 1px solid var(--danger);
}
.danger-btn:hover:not(:disabled) {
  background: #B91C1C;
}

.text-btn {
  padding: 4px 8px;
  background: transparent;
  border: none;
  color: var(--forest);
  font-size: 13px;
}
.text-btn:hover {
  text-decoration: underline;
}
.danger-text {
  color: var(--danger);
}

.full-width {
  width: 100%;
}

.inline-btn {
  display: inline-flex;
}

.sm-btn {
  padding: 7px 12px;
  font-size: 13px;
}

/* ==================== HERO LINK CONVERTER CARD ==================== */

.converter-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.converter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.converter-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.platform-logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--shopee-tint);
  color: var(--shopee);
  display: inline-grid;
  place-items: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}
.platform-logo.small {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-size: 12px;
}

.converter-title-wrap h2 {
  margin: 0;
  font-size: 18px;
  line-height: 26px;
  font-weight: 600;
  color: var(--text);
}

.converter-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-muted);
}

.converter-pill {
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--surface-high);
  color: var(--forest);
  font-size: 12px;
  font-weight: 600;
}

.url-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 14px;
  background: var(--bg-canvas);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.url-input-bar:focus-within {
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(21, 63, 50, 0.08);
  background: var(--surface);
}
.url-input-bar .icon {
  color: var(--text-outline);
}
.url-input-bar input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-size: 14px;
  color: var(--text);
  padding: 8px 4px;
}
.url-input-bar input::placeholder {
  color: var(--text-outline);
}

.paste-btn {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}
.paste-btn:hover {
  background: var(--surface-low);
  color: var(--text);
}

.converter-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--surface-high);
  border: 1px solid #C9DFD6;
}
.converter-result-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.converter-result-badge {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-pill);
  background: var(--forest);
  color: var(--lime);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.converter-result-url {
  display: block;
  font-weight: 700;
  color: var(--forest);
  font-size: 14px;
  word-break: break-all;
}
.converter-result-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.builder-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
}
.builder-note .icon {
  color: var(--forest);
}

/* ==================== KPI STATS & PANELS ==================== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

.stat-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.stat-card strong {
  font-size: 24px;
  line-height: 30px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.stat-card.highlight strong {
  color: var(--forest);
}
.stat-card.danger strong {
  color: var(--danger);
}
.stat-card strong small {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}

.stat-hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.stat-hint .icon {
  width: 14px;
  height: 14px;
}

.green-text {
  color: var(--success) !important;
}
.forest-text {
  color: var(--forest) !important;
}
.warning-text {
  color: var(--warning) !important;
}
.cancelled-money {
  color: var(--text-outline);
  text-decoration: line-through;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.section-heading h2 {
  margin: 0;
  font-size: 18px;
  line-height: 26px;
  font-weight: 600;
  color: var(--text);
}
.section-heading p {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}
.section-kicker {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--forest);
  margin-bottom: 4px;
}

.overview-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

/* ==================== BADGES ==================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge > span:first-child:empty {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}
.badge.green {
  background: var(--success-bg);
  color: var(--success);
}
.badge.blue {
  background: var(--info-bg);
  color: var(--info);
}
.badge.amber {
  background: var(--warning-bg);
  color: var(--warning);
}
.badge.red {
  background: var(--danger-bg);
  color: var(--danger);
}
.badge.gray {
  background: var(--gray-bg);
  color: var(--gray-text);
}
.badge.forest {
  background: var(--surface-high);
  color: var(--forest);
}
.badge.orange {
  background: var(--shopee);
  color: #FFFFFF;
}
.badge.shopee {
  background: var(--shopee-tint);
  color: var(--shopee);
}

/* ==================== SAVED LINKS ==================== */

.links-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.links-summary-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.saved-link-list {
  display: flex;
  flex-direction: column;
}

.saved-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.saved-link-row:first-child {
  padding-top: 2px;
}
.saved-link-row:last-child {
  padding-bottom: 2px;
  border-bottom: none;
}

.saved-link-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.saved-link-info {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.saved-link-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.saved-link-url {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--forest);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.saved-link-url:hover {
  text-decoration: underline;
}
.saved-link-meta {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.saved-link-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ==================== ORDERS & TABLES ==================== */

.order-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.order-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-canvas);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.order-tab:hover {
  background: var(--surface-low);
  color: var(--text);
}
.order-tab.selected {
  background: var(--forest);
  border-color: var(--forest);
  color: #FFFFFF;
}
.order-tab span {
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.order-tab.selected span {
  background: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
}

.table-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.search-field {
  flex: 1;
  min-width: 240px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-canvas);
}
.search-field:focus-within {
  border-color: var(--forest);
  background: var(--surface);
}
.search-field .icon {
  color: var(--text-outline);
}
.search-field input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-size: 13.5px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th {
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

.align-right {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.order-product {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  padding: 0;
  text-align: left;
}
.order-product strong {
  display: block;
  font-weight: 600;
  color: var(--text);
}
.order-product small {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.order-thumb {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--surface-low);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
}
.order-thumb.large {
  width: 56px;
  height: 56px;
}
.product-art {
  width: 100%;
  height: 100%;
}

.table-platform {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  white-space: nowrap;
}

.table-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-muted);
}

.pagination {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ==================== WALLET PAGE ==================== */

.wallet-layout {
  display: grid;
  grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
  gap: 24px;
  align-items: start;
}

.wallet-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.wallet-card {
  background: var(--forest);
  color: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.wallet-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.wallet-card-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}
.wallet-mode-pill {
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 600;
}

.wallet-amount {
  font-size: 36px;
  line-height: 44px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  margin: 4px 0 0;
}

.wallet-sub {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
}

.wallet-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.wallet-actions-hint {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.78);
}

.wallet-card-bottom {
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.wallet-card-bottom span {
  display: block;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
}
.wallet-card-bottom strong {
  display: block;
  margin-top: 2px;
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.payout-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 12px;
  background: var(--bg-canvas);
  border: 1px solid var(--border);
  flex-wrap: wrap;
}
.payout-row-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.payout-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--surface-high);
  color: var(--forest);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.payout-row-left strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.payout-row-left small {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
}
.payout-row-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.steps-list {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.steps-list li {
  counter-increment: step;
  position: relative;
  padding-left: 36px;
}
.steps-list li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 2px;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-pill);
  background: var(--surface-high);
  color: var(--forest);
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.steps-list li strong {
  display: block;
  font-size: 14px;
  color: var(--text);
}
.steps-list li span {
  display: block;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ==================== GUIDE & CALCULATOR ==================== */

.journey-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.journey-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.journey-num {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-pill);
  background: var(--surface-high);
  color: var(--forest);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
}
.journey-card strong {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.journey-card p {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.guide-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.calculation-result {
  padding: 16px 18px;
  border-radius: 12px;
  background: var(--forest);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.calculation-result span {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
}
.calculation-result strong {
  font-size: 22px;
  font-weight: 700;
  color: var(--lime);
  font-variant-numeric: tabular-nums;
}

.faq details {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-canvas);
  padding: 12px 14px;
}
.faq details + details {
  margin-top: 10px;
}
.faq summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq details p {
  margin: 10px 0 0;
  font-size: 13.5px;
  color: var(--text-muted);
}

/* ==================== FORMS, DIALOGS, NOTICES, EMPTY ==================== */

form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

label.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

input[type="text"],
input[type="url"],
input[type="number"],
input[type="password"],
input[type="file"],
select {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--bg-canvas);
  color: var(--text);
  font-size: 14px;
  font-weight: 400;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus {
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(21, 63, 50, 0.08);
  background: var(--surface);
}

.form-error {
  margin: 0;
  min-height: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--danger);
}
.form-error:empty {
  display: none;
}

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

.panel-note {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 19px;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-high);
  border: 1px solid #CBE0D7;
  color: var(--forest);
  font-size: 13px;
}
.notice.amber {
  background: var(--warning-bg);
  border-color: #FDE68A;
  color: var(--warning);
}
.notice.red-notice {
  background: var(--danger-bg);
  border-color: #FECACA;
  color: var(--danger);
}

.empty-state {
  text-align: center;
  padding: 36px 20px;
  border-radius: 14px;
  border: 1px dashed var(--border-strong);
  background: var(--bg-canvas);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.empty-state .icon {
  width: 28px;
  height: 28px;
  color: var(--text-outline);
}
.empty-state h3 {
  margin: 4px 0 0;
  font-size: 16px;
  color: var(--text);
}
.empty-state p {
  margin: 0;
  max-width: 380px;
  font-size: 13px;
  color: var(--text-muted);
}

.loading-state {
  text-align: center;
  padding: 28px;
  color: var(--text-muted);
  font-size: 13.5px;
}

/* ==================== MODAL ==================== */

dialog {
  width: min(490px, calc(100vw - 28px));
  max-height: calc(100vh - 36px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-modal);
  overflow: auto;
}
dialog.wide {
  width: min(580px, calc(100vw - 28px));
}
dialog::backdrop {
  background: rgba(23, 29, 26, 0.45);
  backdrop-filter: blur(2px);
}

.modal-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 2;
}
.modal-heading h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.modal-body {
  padding: 20px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.signin-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.signin-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-weight: 600;
  font-size: 14px;
  transition: background-color 0.15s ease;
}
.signin-option:hover:not(:disabled) {
  background: var(--surface-low);
  border-color: var(--forest);
}
.signin-option:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.bot-merge-box {
  padding: 16px;
  border-radius: 12px;
  background: var(--surface-high);
  border: 1px solid #C8DDD5;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reset-zone {
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.channel-pills {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.channel-pill {
  padding: 9px 8px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--bg-canvas);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}
.channel-pill.selected {
  background: var(--forest);
  border-color: var(--forest);
  color: #FFFFFF;
}

.order-modal-product {
  display: flex;
  align-items: center;
  gap: 14px;
}
.order-modal-product h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}
.order-modal-product p {
  margin: 2px 0 6px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.order-modal-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: var(--bg-canvas);
  border: 1px solid var(--border);
}
.order-modal-stats small {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}
.order-modal-stats strong {
  display: block;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.timeline {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.timeline li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.timeline li > span {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-pill);
  background: var(--gray-bg);
  color: var(--text-outline);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.timeline li.done > span {
  background: var(--forest);
  color: var(--lime);
}
.timeline li strong {
  display: block;
  font-size: 14px;
  color: var(--text);
}
.timeline li p {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--text-muted);
}

.breakdown {
  margin: 0;
  display: flex;
  flex-direction: column;
}
.breakdown > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.breakdown > div:first-child {
  padding-top: 2px;
}
.breakdown > div:last-child {
  padding-bottom: 2px;
  border-bottom: none;
}
.breakdown dt {
  color: var(--text-muted);
}
.breakdown dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: var(--bg-canvas);
  border: 1px solid var(--border);
}
.round-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-pill);
  background: var(--surface-high);
  color: var(--forest);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.round-icon.amber-bg {
  background: var(--warning-bg);
  color: var(--warning);
}

.break-url {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg-canvas);
  border: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-muted);
  word-break: break-all;
}

.success-mark {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-pill);
  background: var(--surface-high);
  color: var(--forest);
  display: grid;
  place-items: center;
  margin: 0 auto;
}

.footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--text-muted);
}
.footer > div {
  display: flex;
  align-items: center;
  gap: 14px;
}
.footer button {
  border: none;
  background: transparent;
  padding: 0;
  color: var(--forest);
  font-weight: 600;
}

/* ==================== TOAST ==================== */

#toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  max-width: 380px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: var(--forest);
  color: #FFFFFF;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow-toast);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
#toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ==================== ADMIN DASHBOARD ==================== */

.adm-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-canvas);
}

.adm-unlock-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.adm-unlock-box {
  width: 100%;
  max-width: 430px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.adm-unlock-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.adm-header {
  position: sticky;
  top: 0;
  z-index: 25;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.adm-header-top {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.adm-brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
}
.adm-brand-group p {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--forest);
}
.adm-brand-group h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.adm-tabs-bar {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 28px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
}
.adm-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.adm-tab-btn:hover {
  color: var(--text);
}
.adm-tab-btn.selected {
  color: var(--forest);
  border-bottom-color: var(--forest);
}

.adm-main {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 26px 28px 64px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.adm-grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}
.col-span-4 { grid-column: span 4; }
.col-span-5 { grid-column: span 5; }
.col-span-6 { grid-column: span 6; }
.col-span-7 { grid-column: span 7; }
.col-span-8 { grid-column: span 8; }
.col-span-12 { grid-column: span 12; }

.adm-metrics-mini {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.adm-metric-box {
  padding: 14px;
  border-radius: 12px;
  background: var(--bg-canvas);
  border: 1px solid var(--border);
}
.adm-metric-box.accent {
  background: var(--surface-high);
  border-color: #C9DFD6;
}
.adm-metric-box span {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
}
.adm-metric-box strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.adm-audit-list {
  max-height: 390px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.adm-audit-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.adm-audit-item:first-child { padding-top: 0; }
.adm-audit-item:last-child { padding-bottom: 0; border-bottom: none; }

.adm-queue-card {
  padding: 16px;
  border-radius: 12px;
  background: var(--bg-canvas);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.adm-queue-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.adm-transfer-box {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-high);
  border: 1px solid #C9DFD6;
  font-size: 13px;
  color: var(--forest);
}
.adm-inline-form {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.adm-inline-form input {
  flex: 1;
  min-width: 180px;
}

.adm-clawback-alert {
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  background: var(--danger-bg);
  border: 1px solid #FCA5A5;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.adm-settings-details {
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--bg-canvas);
  border: 1px solid var(--border);
}
.adm-settings-details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--forest);
  font-size: 14px;
}

.adm-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
  cursor: pointer;
}
.adm-check-row input {
  width: auto;
}

.adm-two-col-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.adm-actions-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: var(--shadow-modal);
  }
  .sidebar-close {
    display: inline-grid;
  }
  .main-shell {
    margin-left: 0;
  }
  .mobile-menu {
    display: inline-grid;
  }
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .overview-split,
  .wallet-layout,
  .guide-columns {
    grid-template-columns: 1fr;
  }
  .journey-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .col-span-4, .col-span-5, .col-span-6, .col-span-7, .col-span-8 {
    grid-column: span 12;
  }
}

@media (max-width: 640px) {
  .topbar {
    padding: 0 16px;
  }
  .main-container,
  .adm-main,
  .adm-header-top,
  .adm-tabs-bar {
    padding-left: 16px;
    padding-right: 16px;
  }
  .stats-grid,
  .journey-grid,
  .adm-two-col-fields,
  .wallet-card-bottom,
  .order-modal-stats {
    grid-template-columns: 1fr;
  }
  .url-input-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
  }
  .url-input-bar .icon {
    display: none;
  }
  .wallet-amount {
    font-size: 28px;
    line-height: 36px;
  }
  .user-pill-name {
    display: none;
  }
}

.adm-vietqr-box {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid #C9DFD6;
  flex-wrap: wrap;
}
.adm-vietqr-img {
  width: 168px;
  height: 168px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #FFFFFF;
  flex-shrink: 0;
}
.adm-vietqr-meta {
  flex: 1;
  min-width: 210px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.adm-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.adm-filter-bar select {
  width: auto;
  min-width: 170px;
}

