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

  :root {
    --font: 'Plus Jakarta Sans', sans-serif;
    --primary: #16c7a4;
    --primary-dark: #0d9e82;
    --primary-light: #e6faf6;
    --primary-mid: #4dd9c0;
    --sidebar-w: 240px;
    --surface: #ffffff;
    --surface-2: #f8fffe;
    --surface-3: #f0fdf9;
    --bg: #f0fdf9;
    --border: #c8ddd7;
    --border-2: #b0cec6;
    --text-1: #1a2e2b;
    --text-2: #4b6b64;
    --text-3: #8fa9a3;
    --green: #0d9e82;
    --green-bg: #e6faf6;
    --red: #dc2626;
    --red-bg: #fef2f2;
    --amber: #d97706;
    --amber-bg: #fffbeb;
    --blue: #2563eb;
    --blue-bg: #eff6ff;
    --pink: #db2777;
    --pink-bg: #fdf2f8;
    --r: 12px;
    --r-lg: 16px;
    --r-xl: 20px;
    --shadow: 0 1px 4px rgba(22,199,164,0.06), 0 4px 20px rgba(22,199,164,0.08);
    --shadow-md: 0 4px 16px rgba(22,199,164,0.12), 0 1px 4px rgba(0,0,0,0.04);
  }

  body { font-family: var(--font); background: var(--bg); color: var(--text-1); display: flex; min-height: 100vh; font-size: 14px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
  a { text-decoration: none; }

  /* ── LOGIN ── */
  #login-page { position: fixed; inset: 0; background: var(--bg); display: flex; align-items: center; justify-content: center; z-index: 1000; }
  #login-page.hidden { display: none; }
  .login-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 48px 40px; width: 420px; box-shadow: var(--shadow); }
  .login-brand { font-size: 28px; font-weight: 800; color: var(--primary-dark); letter-spacing: -0.8px; margin-bottom: 4px; }
  .login-subtitle { color: var(--text-3); font-size: 13px; margin-bottom: 32px; font-weight: 400; }
  .login-label { display: block; text-align: left; color: var(--text-2); font-size: 12px; font-weight: 600; letter-spacing: 0.3px; margin-bottom: 6px; }
  .login-input { width: 100%; background: var(--surface-3); border: 1.5px solid var(--border); border-radius: var(--r); padding: 11px 14px; color: var(--text-1); font-family: var(--font); font-size: 13px; outline: none; transition: all 0.2s; margin-bottom: 14px; }
  .login-input:focus { border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 3px rgba(22,199,164,0.15); }
  .login-btn { width: 100%; background: var(--primary); color: #fff; border: none; border-radius: var(--r); padding: 12px; font-family: var(--font); font-size: 14px; font-weight: 700; cursor: pointer; transition: background 0.2s; margin-top: 6px; letter-spacing: 0.2px; }
  .login-btn:hover { background: var(--primary-dark); }
  .login-hint { color: var(--text-3); font-size: 12px; margin-top: 18px; text-align: center; }
  .login-hint span { color: var(--primary-dark); font-weight: 600; }

  /* ── SIDEBAR ── */
  #sidebar { width: var(--sidebar-w); background: var(--surface); display: flex; flex-direction: column; position: fixed; left: 0; top: 0; bottom: 0; z-index: 100; border-right: 1.5px solid var(--border); transition: transform 0.28s cubic-bezier(.4,0,.2,1); }
  .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 99; }
  .sidebar-overlay.open { display: block; }
  .sidebar-brand { padding: 22px 20px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
  .brand-icon { width: 34px; height: 34px; background: var(--primary); border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .brand-icon svg { width: 18px; height: 18px; stroke: white; }
  .brand-name { font-size: 16px; font-weight: 800; color: var(--text-1); letter-spacing: -0.4px; line-height: 1.1; }
  .brand-tag { font-size: 9.5px; color: var(--text-3); font-weight: 500; letter-spacing: 0.3px; }
  .sidebar-nav { flex: 1; padding: 14px 12px; overflow-y: auto; }
  .nav-section-label { font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text-3); padding: 12px 10px 6px; }
  .nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r); color: var(--text-2); font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.15s; margin-bottom: 2px; border: none; background: none; width: 100%; text-align: left; }
  .nav-item:hover { background: var(--primary-light); color: var(--primary-dark); }
  .nav-item.active { background: var(--primary-light); color: var(--primary-dark); font-weight: 700; }
  .nav-item.active .nav-icon { color: var(--primary); }
  .nav-icon { width: 16px; height: 16px; flex-shrink: 0; color: var(--text-3); transition: color 0.15s; }
  .nav-item:hover .nav-icon { color: var(--primary); }
  .nav-item.active::before { content: ''; width: 3px; height: 20px; background: var(--primary); border-radius: 2px; margin-right: 2px; margin-left: -4px; flex-shrink: 0; }
  .sidebar-footer { padding: 14px 12px; border-top: 1px solid var(--border); }
  .sidebar-version { font-size: 10.5px; color: var(--text-3); margin-bottom: 8px; padding: 0 4px; font-weight: 500; }
  .signout-btn { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 12px; border-radius: var(--r); color: var(--text-3); font-size: 12.5px; font-weight: 500; border: none; background: none; cursor: pointer; transition: all 0.15s; font-family: var(--font); }
  .signout-btn:hover { background: var(--red-bg); color: var(--red); }

  /* ── TOPBAR ── */
  #app { display: none; flex: 1; flex-direction: column; margin-left: var(--sidebar-w); }
  #app.visible { display: flex; }
  .topbar { background: var(--surface); border-bottom: 1.5px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 28px; height: 64px; position: sticky; top: 0; z-index: 50; gap: 12px; }
  .hamburger-btn { display: none; width: 38px; height: 38px; border-radius: 10px; border: 1.5px solid var(--border); background: none; cursor: pointer; align-items: center; justify-content: center; color: var(--text-2); flex-shrink: 0; transition: all 0.15s; }
  .hamburger-btn:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary-dark); }
  .topbar-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
  .topbar-search { display: flex; align-items: center; gap: 8px; background: var(--surface-3); border: 1.5px solid var(--border); border-radius: var(--r); padding: 8px 14px; font-size: 13px; color: var(--text-3); font-family: var(--font); cursor: text; min-width: 220px; }
  .tier-badge { background: var(--primary-light); border: 1px solid rgba(22,199,164,0.25); color: var(--primary-dark); font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 20px; letter-spacing: 0.2px; }
  .topbar-right { display: flex; align-items: center; gap: 12px; }
  .notif-btn { width: 38px; height: 38px; border-radius: 10px; border: 1.5px solid var(--border); background: none; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text-2); transition: all 0.15s; position: relative; }
  .notif-btn:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
  .notif-dot { width: 8px; height: 8px; background: var(--primary); border-radius: 50%; position: absolute; top: 6px; right: 6px; border: 2px solid white; }
  .user-info { text-align: right; }
  .user-name { font-size: 13px; font-weight: 700; color: var(--text-1); }
  .user-email { font-size: 11px; color: var(--text-3); font-weight: 400; }
  .avatar { width: 38px; height: 38px; border-radius: 10px; background: var(--primary); color: #fff; font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; letter-spacing: 0.5px; }

  /* ── MAIN ── */
  .main-content { flex: 1; padding: 28px 28px 40px; overflow-y: auto; }
  .page { display: none; animation: fadeIn 0.2s ease; }
  .page.active { display: block; }
  @keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

  /* ── PAGE HEADER ── */
  .page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; }
  .page-title { font-size: 22px; font-weight: 800; color: var(--text-1); letter-spacing: -0.5px; line-height: 1.2; }
  .page-subtitle { font-size: 13px; color: var(--text-3); margin-top: 3px; font-weight: 400; }
  .header-actions { display: flex; gap: 10px; margin-top: 4px; }

  /* ── BUTTONS ── */
  .btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: var(--r); font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.15s; border: none; font-family: var(--font); white-space: nowrap; letter-spacing: 0.1px; }
  .btn-primary { background: var(--primary); color: #fff; }
  .btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 12px rgba(22,199,164,0.35); }
  .btn-outline { background: var(--surface); color: var(--text-2); border: 1.5px solid var(--border); }
  .btn-outline:hover { border-color: var(--primary); color: var(--primary-dark); background: var(--primary-light); }
  .btn-ghost { background: none; color: var(--text-2); border: 1.5px solid var(--border); }
  .btn-ghost:hover { background: var(--primary-light); color: var(--primary-dark); }
  .btn-green { background: var(--primary); color: #fff; }
  .btn-green:hover { background: var(--primary-dark); }
  .btn-accent { background: var(--primary); color: #fff; }
  .btn-sm { padding: 6px 12px; font-size: 12px; }

  /* ── CARDS ── */
  .card { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow); }
  .card-title { font-size: 11px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-3); margin-bottom: 10px; }

  /* ── STAT CARDS ── */
  .stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
  .stats-grid-2 { grid-template-columns: repeat(2, 1fr); }
  .stats-grid-4 { grid-template-columns: repeat(4, 1fr); }
  .stat-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--r-lg); padding: 20px 22px; box-shadow: var(--shadow); display: flex; align-items: center; justify-content: space-between; gap: 16px; transition: box-shadow 0.2s; }
  .stat-card:hover { box-shadow: var(--shadow-md); }
  .stat-card-left { flex: 1; }
  .stat-label { font-size: 12px; font-weight: 600; color: var(--text-3); margin-bottom: 6px; letter-spacing: 0.2px; }
  .stat-value { font-size: 26px; font-weight: 800; color: var(--text-1); letter-spacing: -0.8px; line-height: 1; }
  .stat-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 20px; margin-top: 8px; }
  .badge-green { background: var(--green-bg); color: var(--green); }
  .badge-amber { background: var(--amber-bg); color: var(--amber); }
  .badge-gray { background: var(--surface-3); color: var(--text-3); }
  .badge-blue { background: var(--blue-bg); color: var(--blue); }
  .badge-red { background: var(--red-bg); color: var(--red); }
  .badge-pink { background: var(--pink-bg); color: var(--pink); }
  .badge-accent { background: var(--primary-light); color: var(--primary-dark); }
  /* mini donut for stat cards */
  .stat-donut { width: 56px; height: 56px; flex-shrink: 0; }
  .stat-donut-track { fill: none; stroke: var(--border-2); stroke-width: 6; }
  .stat-donut-fill { fill: none; stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset 0.8s ease; }

  /* ── TABLE ── */
  .table-wrap { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
  .table-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; border-bottom: 1px solid var(--border); }
  .table-title { font-size: 14px; font-weight: 700; color: var(--text-1); }
  table { width: 100%; border-collapse: collapse; }
  th { text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: 0.4px; color: var(--text-3); padding: 11px 22px; border-bottom: 1px solid var(--border); background: var(--surface-3); }
  td { padding: 13px 22px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text-1); font-weight: 500; }
  tr:last-child td { border-bottom: none; }
  tr:hover td { background: var(--surface-3); }
  .table-footer { padding: 12px 22px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; background: var(--surface-3); }
  .table-count { font-size: 12px; color: var(--text-3); font-weight: 500; }

  /* ── TIER CARD ── */
  .tier-card { background: linear-gradient(135deg, #064e3b 0%, #065f46 55%, #0d7a65 100%); border-radius: var(--r-xl); padding: 28px 32px; box-shadow: 0 8px 32px rgba(6,78,59,0.4); margin-bottom: 22px; display: flex; align-items: center; gap: 32px; position: relative; overflow: hidden; }
  .tier-card::after { content: ''; position: absolute; top: -40px; right: -40px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255,255,255,0.06); }
  .tier-card::before { content: ''; position: absolute; bottom: -30px; right: 80px; width: 100px; height: 100px; border-radius: 50%; background: rgba(255,255,255,0.04); }
  .tier-ring-wrap { flex-shrink: 0; position: relative; width: 110px; height: 110px; z-index: 1; }
  .tier-ring-wrap svg { transform: rotate(-90deg); }
  .tier-ring-track { fill: none; stroke: rgba(255,255,255,0.2); stroke-width: 7; }
  .tier-ring-fill { fill: none; stroke: #ffffff; stroke-width: 7; stroke-linecap: round; stroke-dasharray: 283; stroke-dashoffset: 272; transition: stroke-dashoffset 1.2s cubic-bezier(.4,0,.2,1); }
  .tier-ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
  .tier-ring-name { font-size: 15px; font-weight: 800; color: #fff; letter-spacing: 0.3px; }
  .tier-ring-sub { font-size: 9px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: rgba(255,255,255,0.6); margin-top: 2px; }
  .tier-info { flex: 1; z-index: 1; }
  .tier-rate { font-size: 30px; font-weight: 800; color: #fff; line-height: 1.1; letter-spacing: -1px; }
  .tier-desc { font-size: 12.5px; color: rgba(255,255,255,0.65); margin-top: 5px; margin-bottom: 18px; font-weight: 400; }
  .tier-progress-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; }
  .tier-progress-label { font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.6); letter-spacing: 0.2px; }
  .tier-progress-val { font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.85); }
  .progress-bar-bg { background: rgba(255,255,255,0.2); border-radius: 20px; height: 5px; width: 100%; }
  .progress-bar { background: #ffffff; height: 5px; border-radius: 20px; width: 1.2%; transition: width 1.2s cubic-bezier(.4,0,.2,1); }
  .tier-milestones { display: flex; gap: 18px; margin-top: 10px; }
  .tier-milestone { font-size: 10.5px; color: rgba(255,255,255,0.5); font-weight: 400; }
  .tier-milestone strong { color: rgba(255,255,255,0.8); font-weight: 700; }

  /* ── CHART ── */
  .chart-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--r-lg); padding: 20px 22px; box-shadow: var(--shadow); margin-bottom: 20px; }
  .chart-title { font-size: 14px; font-weight: 700; margin-bottom: 16px; color: var(--text-1); }
  .chart-area { height: 130px; display: flex; align-items: flex-end; gap: 12px; padding: 0 4px; border-bottom: 1.5px solid var(--border); }
  .chart-bar { flex: 1; border-radius: 6px 6px 0 0; background: var(--primary-light); min-height: 6px; transition: background 0.2s; cursor: pointer; }
  .chart-bar:hover { background: var(--primary); }
  .chart-labels { display: flex; gap: 12px; padding: 8px 4px 0; }
  .chart-label { flex: 1; text-align: center; font-size: 11px; color: var(--text-3); font-weight: 500; }

  /* ── QUICK ACTIONS ── */
  .quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
  .quick-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--r-lg); padding: 18px; cursor: pointer; transition: all 0.2s; box-shadow: var(--shadow); }
  .quick-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-md); }
  .quick-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--primary-light); display: flex; align-items: center; justify-content: center; margin-bottom: 12px; color: var(--primary); }
  .quick-title { font-size: 13px; font-weight: 700; color: var(--text-1); margin-bottom: 3px; }
  .quick-desc { font-size: 11.5px; color: var(--text-3); font-weight: 400; }

  /* ── CREATE ORDER LAYOUT ── */
  .aff-create-grid { display: grid; grid-template-columns: 1fr 340px; gap: 20px; }
  .aff-create-summary { position: sticky; top: 80px; }
  .product-line-row { display: grid; grid-template-columns: 1fr 90px 90px 32px; gap: 8px; margin-bottom: 8px; align-items: center; }

  /* ── FORMS ── */
  .form-group { margin-bottom: 18px; }
  .form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; letter-spacing: 0.2px; }
  .form-input, .form-select, .form-textarea { width: 100%; padding: 10px 13px; border: 1.5px solid var(--border); border-radius: var(--r); font-family: var(--font); font-size: 13px; color: var(--text-1); background: var(--surface); outline: none; transition: all 0.2s; font-weight: 500; }
  .form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(22,199,164,0.12); }
  .form-textarea { min-height: 90px; resize: vertical; }
  .form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .form-section-title { font-size: 13px; font-weight: 700; color: var(--text-1); margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1.5px solid var(--border); }
  .search-input { flex: 1; padding: 9px 13px; border: 1.5px solid var(--border); border-radius: var(--r); font-family: var(--font); font-size: 13px; outline: none; background: var(--surface); color: var(--text-1); font-weight: 500; }
  .search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(22,199,164,0.12); }
  .filter-row { display: flex; gap: 10px; margin-bottom: 18px; }

  /* ── RADIO ── */
  .radio-option { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 1.5px solid var(--border); border-radius: var(--r); cursor: pointer; margin-bottom: 10px; transition: all 0.15s; }
  .radio-option.selected { border-color: var(--primary); background: var(--primary-light); }
  .radio-option input[type=radio] { margin-top: 3px; accent-color: var(--primary); }
  .radio-title { font-size: 13px; font-weight: 600; color: var(--text-1); }
  .radio-desc { font-size: 12px; color: var(--text-3); margin-top: 2px; font-weight: 400; }

  /* ── ORDER SUMMARY ── */
  .summary-row { display: flex; justify-content: space-between; font-size: 13px; padding: 9px 0; border-bottom: 1px solid var(--border); color: var(--text-2); font-weight: 500; }
  .summary-row.total { font-weight: 800; color: var(--text-1); font-size: 15px; border-bottom: none; padding-top: 12px; }

  /* ── PRODUCTS ── */
  .products-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .product-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); transition: box-shadow 0.2s; }
  .product-card:hover { box-shadow: var(--shadow-md); }
  .product-img { height: 160px; background: linear-gradient(135deg, var(--surface-3) 0%, var(--primary-light) 100%); position: relative; display: flex; align-items: center; justify-content: center; }
  .product-img-placeholder { font-size: 42px; opacity: 0.5; }
  .product-comm-badge { position: absolute; top: 10px; right: 10px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px; letter-spacing: 0.2px; }
  .product-body { padding: 14px 16px; }
  .product-name { font-size: 14px; font-weight: 700; color: var(--text-1); margin-bottom: 4px; }
  .product-price { font-size: 22px; font-weight: 800; color: var(--text-1); margin-bottom: 12px; letter-spacing: -0.5px; }
  .product-actions { display: flex; gap: 8px; }

  /* ── CREATIVES ── */
  .creatives-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .creative-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
  .creative-img { height: 140px; background: linear-gradient(135deg, var(--surface-3), var(--primary-light)); display: flex; align-items: center; justify-content: center; font-size: 36px; }
  .creative-body { padding: 14px 16px; }
  .creative-platforms { display: flex; gap: 6px; margin-bottom: 8px; }
  .platform-tag { font-size: 10px; font-weight: 700; letter-spacing: 0.3px; padding: 3px 8px; border-radius: 5px; }
  .tag-instagram { background: var(--primary-light); color: var(--primary-dark); }
  .tag-tiktok { background: var(--blue-bg); color: var(--blue); }
  .tag-post, .tag-reel, .tag-story { background: var(--surface-3); color: var(--text-3); }
  .creative-title { font-size: 13px; font-weight: 600; color: var(--text-1); margin-bottom: 10px; }

  /* ── COMPLIANCE ── */
  .compliance-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
  .compliance-item { display: flex; gap: 12px; padding: 14px; border-radius: var(--r); background: var(--surface-3); border: 1px solid var(--border); }
  .compliance-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .tier-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: var(--r); margin-bottom: 8px; }
  .tier-row-a { background: var(--amber-bg); border: 1px solid rgba(217,119,6,0.15); }
  .tier-row-b { background: var(--surface-2); border: 1px solid var(--border); }
  .tier-row-c { background: var(--green); border: 1px solid var(--green); color: #fff; }
  .tier-name { font-size: 13px; font-weight: 700; }
  .tier-range { font-size: 11.5px; color: var(--text-3); margin-top: 1px; font-weight: 400; }
  .tier-comm { font-size: 20px; font-weight: 800; letter-spacing: -0.5px; }

  /* ── PROFILE ── */
  .profile-hero { background: linear-gradient(135deg, #0d7a65, #0d9e82); border-radius: var(--r-xl); padding: 28px; margin-bottom: 16px; display: flex; align-items: center; gap: 20px; }
  .profile-avatar-lg { width: 64px; height: 64px; border-radius: var(--r); background: rgba(255,255,255,0.25); color: #fff; font-size: 22px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
  .profile-name { font-size: 20px; font-weight: 800; color: #fff; letter-spacing: -0.4px; }
  .profile-joined { font-size: 12px; color: rgba(255,255,255,0.55); margin-top: 3px; font-weight: 400; }
  .profile-badges { display: flex; gap: 8px; margin-top: 10px; }
  .profile-stats { display: flex; gap: 28px; margin-left: auto; text-align: center; }
  .profile-stat-val { font-size: 22px; font-weight: 800; color: #fff; letter-spacing: -0.5px; }
  .profile-stat-lbl { font-size: 11px; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
  .kyc-item { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border: 1.5px solid var(--border); border-radius: var(--r); margin-bottom: 10px; }
  .kyc-label { font-size: 13.5px; font-weight: 600; color: var(--text-1); }
  .kyc-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; font-weight: 400; }

  /* ── SHARE ── */
  .share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
  .link-input-row { display: flex; gap: 8px; margin-bottom: 12px; }
  .link-input { flex: 1; padding: 10px 13px; border: 1.5px solid var(--border); border-radius: var(--r); font-size: 13px; color: var(--text-2); background: var(--surface-3); font-weight: 500; }
  .qr-placeholder { width: 140px; height: 140px; margin: 0 auto 14px; background: var(--surface-3); border-radius: var(--r); display: flex; align-items: center; justify-content: center; }
  .caption-card { background: var(--surface-3); border: 1.5px solid var(--border); border-radius: var(--r); padding: 14px 16px; margin-bottom: 12px; }
  .caption-text { font-size: 13px; color: var(--text-2); line-height: 1.6; margin-bottom: 10px; font-weight: 400; }

  /* ── TICKETS ── */
  .ticket-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
  .ticket-stat { text-align: center; }
  .ticket-stat-val { font-size: 30px; font-weight: 800; letter-spacing: -0.8px; }

  /* ── PAYOUT ── */
  .payout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
  .payout-amount { font-size: 34px; font-weight: 800; color: var(--text-1); margin-bottom: 4px; letter-spacing: -1px; }
  .payout-method-row { display: flex; align-items: center; gap: 10px; padding: 12px; background: var(--surface-3); border-radius: var(--r); border: 1.5px solid var(--border); margin-bottom: 14px; }
  .payout-info-box { background: var(--blue-bg); border: 1.5px solid rgba(37,99,235,0.15); border-radius: var(--r); padding: 12px 14px; margin-top: 14px; }
  .payout-info-title { font-size: 11px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--blue); margin-bottom: 5px; }
  .payout-info-text { font-size: 12.5px; color: var(--text-2); line-height: 1.5; font-weight: 400; }

  /* ── WARN BANNER ── */
  .warn-banner { background: var(--amber-bg); border: 1.5px solid rgba(217,119,6,0.2); border-radius: var(--r); padding: 12px 16px; margin-bottom: 20px; display: flex; gap: 10px; align-items: flex-start; }
  .warn-icon { font-size: 16px; flex-shrink: 0; }
  .warn-title { font-size: 12px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; color: var(--amber); margin-bottom: 3px; }
  .warn-text { font-size: 12.5px; color: var(--text-2); font-weight: 400; }

  /* ── RTO CARD ── */
  .rto-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow); }
  .rto-title { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 700; margin-bottom: 12px; }
  .rto-text { font-size: 13px; color: var(--text-2); line-height: 1.65; font-weight: 400; }

  /* ── EARNINGS SUMMARY ── */
  .earnings-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); margin-bottom: 22px; }
  .earnings-col { padding: 22px; text-align: center; border-right: 1px solid var(--border); }
  .earnings-col:last-child { border-right: none; }
  .earnings-col.highlight { border-top: 3px solid var(--primary); }
  .earnings-col-label { font-size: 11px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-3); margin-bottom: 8px; }
  .earnings-col-val { font-size: 26px; font-weight: 800; letter-spacing: -0.8px; }
  .earnings-col.highlight .earnings-col-val { color: var(--primary-dark); }

  /* ── DIVIDER ── */
  .divider { height: 1.5px; background: var(--border); margin: 20px 0; }

  /* ── TOAST ── */
  .toast { position: fixed; bottom: 24px; right: 24px; z-index: 9999; background: var(--text-1); color: #fff; padding: 12px 18px; border-radius: var(--r); font-size: 13px; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,0.15); display: flex; align-items: center; gap: 8px; animation: slideUp 0.3s ease; opacity: 1; transition: opacity 0.3s; }
  @keyframes slideUp { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

  /* ── ORDER CARDS ── */
  .order-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--r-lg); cursor: pointer; transition: all 0.2s; box-shadow: var(--shadow); overflow: hidden; }
  .order-card:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow-md); }
  .order-card-main { display: grid; grid-template-columns: 90px 130px 1fr 120px 110px 110px 24px; gap: 12px; align-items: center; padding: 16px 20px; }
  .order-card-products { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
  .order-card-arrow { font-size: 18px; color: var(--text-3); text-align: right; transition: all 0.15s; }
  .order-card:hover .order-card-arrow { transform: translateX(3px); color: var(--primary); }

  /* ── TIMELINE ── */
  .timeline-item { display: flex; gap: 14px; position: relative; padding-bottom: 20px; }
  .timeline-item:last-child { padding-bottom: 0; }
  .timeline-dot { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 2px; position: relative; z-index: 1; }
  .timeline-line { position: absolute; left: 13px; top: 30px; bottom: 0; width: 1.5px; background: var(--border); }
  .timeline-content { flex: 1; padding-top: 4px; }
  .timeline-title { font-size: 13px; font-weight: 700; color: var(--text-1); margin-bottom: 3px; }
  .timeline-body { font-size: 12.5px; color: var(--text-2); line-height: 1.55; font-weight: 400; }
  .timeline-time { font-size: 11px; color: var(--text-3); margin-top: 4px; font-weight: 500; }

  /* ── RESPONSIVE ── */
  @media (max-width: 768px) {
    #sidebar { transform: translateX(-100%); }
    #sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,0.18); }
    #app { margin-left: 0; }

    .hamburger-btn { display: flex; }
    .topbar { padding: 0 14px; }
    .topbar-search { display: none; }
    .tier-badge { display: none; }
    .user-info { display: none; }

    .main-content { padding: 18px 14px 36px; }

    .page-header { flex-direction: column; gap: 12px; align-items: flex-start; }
    .header-actions { margin-top: 0; }

    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .stats-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .stat-value { font-size: 22px; }

    .quick-grid { grid-template-columns: repeat(2, 1fr); }

    .products-grid, .creatives-grid, .compliance-grid, .share-grid, .payout-grid { grid-template-columns: 1fr; }

    .form-grid-2 { grid-template-columns: 1fr; }

    .filter-row { flex-wrap: wrap; }
    .filter-row .form-select { min-width: unset; flex: 1; }

    .order-card { overflow-x: unset; }
    .order-card-main {
      grid-template-columns: 1fr auto;
      grid-template-rows: auto auto auto;
      min-width: unset;
      gap: 4px 10px;
      padding: 14px 16px;
    }
    .order-card-main > *:nth-child(1) { grid-column: 1; grid-row: 1; }
    .order-card-main > *:nth-child(2) { grid-column: 1; grid-row: 2; }
    .order-card-products { grid-column: 1 / -1; grid-row: 3; margin-top: 4px; }
    .order-card-main > *:nth-child(4) { grid-column: 2; grid-row: 1; text-align: right; align-self: start; }
    .order-card-main > *:nth-child(5) { grid-column: 2; grid-row: 2; text-align: right; }
    .order-card-arrow { display: none; }

    .tier-card { flex-direction: column; align-items: flex-start; gap: 20px; padding: 22px 20px; }
    .tier-milestones { flex-wrap: wrap; gap: 10px; }

    .profile-hero { flex-direction: column; gap: 16px; padding: 22px 18px; align-items: flex-start; }
    .profile-stats { margin-left: 0; gap: 20px; }

    .earnings-summary { grid-template-columns: 1fr; }
    .earnings-col { border-right: none; border-bottom: 1px solid var(--border); }
    .earnings-col:last-child { border-bottom: none; }

    .table-wrap { border-radius: var(--r); }
    .table-header { padding: 12px 14px; flex-wrap: wrap; gap: 8px; }
    th, td { padding: 10px 14px; }

    .verify-stepper { flex-direction: column; gap: 4px; padding: 14px; }
    .verify-step { padding: 8px 10px; }
    .verify-step + .verify-step::before { display: none; }
    .verify-main { padding: 18px 14px 40px; }
    .verify-topbar { padding: 14px 16px; }
    .verify-hero h1 { font-size: 20px; }

    .platform-radio-row { grid-template-columns: 1fr; }

    .login-card { width: calc(100vw - 32px); padding: 32px 22px; }

    .aff-create-grid { grid-template-columns: 1fr; }
    .aff-create-summary { position: static; top: auto; }
    .product-line-row { grid-template-columns: 1fr 72px 32px; }
    .product-line-price-display { display: none; }
  }

  /* ── VERIFICATION SHELL ── */
  .verify-shell { min-height: 100vh; width: 100%; display: flex; flex-direction: column; background: var(--bg); }
  .verify-topbar { display: flex; align-items: center; justify-content: space-between; padding: 18px 28px; background: var(--surface); border-bottom: 1.5px solid var(--border); }
  .verify-topbar-brand { font-size: 18px; font-weight: 800; color: var(--primary-dark); letter-spacing: -0.4px; }
  .verify-topbar-tag { font-size: 10px; color: var(--text-3); font-weight: 600; letter-spacing: 1px; text-transform: uppercase; margin-top: 2px; }
  .verify-signout { background: none; border: 1.5px solid var(--border); color: var(--text-2); border-radius: var(--r); padding: 8px 14px; font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: var(--font); }
  .verify-signout:hover { background: var(--red-bg); color: var(--red); border-color: var(--red); }
  .verify-main { flex: 1; display: flex; justify-content: center; padding: 32px 24px 48px; }
  .verify-container { width: 100%; max-width: 760px; }
  .verify-hero { margin-bottom: 24px; }
  .verify-hero h1 { font-size: 24px; font-weight: 800; color: var(--text-1); letter-spacing: -0.6px; margin-bottom: 6px; }
  .verify-hero p { font-size: 13.5px; color: var(--text-3); font-weight: 400; line-height: 1.5; }

  /* ── STEPPER ── */
  .verify-stepper { display: flex; gap: 0; background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--r-lg); padding: 16px; margin-bottom: 22px; box-shadow: var(--shadow); }
  .verify-step { flex: 1; display: flex; align-items: center; gap: 12px; position: relative; padding: 4px 12px; }
  .verify-step + .verify-step::before { content: ''; position: absolute; left: 0; top: 50%; width: 1px; height: 30px; background: var(--border); transform: translateY(-50%); }
  .verify-step-num { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-3); border: 1.5px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; color: var(--text-3); flex-shrink: 0; }
  .verify-step-num.active { background: var(--primary); border-color: var(--primary); color: #fff; }
  .verify-step-num.done { background: var(--green); border-color: var(--green); color: #fff; }
  .verify-step-num.pending { background: var(--amber-bg); border-color: var(--amber); color: var(--amber); }
  .verify-step-num.rejected { background: var(--red-bg); border-color: var(--red); color: var(--red); }
  .verify-step-text { flex: 1; min-width: 0; }
  .verify-step-name { font-size: 13px; font-weight: 700; color: var(--text-1); }
  .verify-step-status { font-size: 11px; color: var(--text-3); font-weight: 500; margin-top: 2px; }

  /* ── STATE CARDS ── */
  .verify-state-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--r-lg); padding: 22px 24px; box-shadow: var(--shadow); margin-bottom: 16px; }
  .verify-state-card.pending { border-color: rgba(217,119,6,0.3); background: linear-gradient(180deg, var(--amber-bg), var(--surface) 40%); }
  .verify-state-card.approved { border-color: rgba(13,158,130,0.3); background: linear-gradient(180deg, var(--green-bg), var(--surface) 40%); }
  .verify-state-card.rejected { border-color: rgba(220,38,38,0.3); background: linear-gradient(180deg, var(--red-bg), var(--surface) 40%); }
  .verify-state-title { font-size: 14px; font-weight: 800; letter-spacing: 0.2px; color: var(--text-1); display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
  .verify-state-body { font-size: 13px; color: var(--text-2); line-height: 1.55; }

  /* ── PLATFORM CHIPS ── */
  .platform-radio-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
  .platform-radio { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1.5px solid var(--border); border-radius: var(--r); cursor: pointer; transition: all 0.15s; background: var(--surface); }
  .platform-radio input { display: none; }
  .platform-radio.selected, .platform-radio:has(input:checked) { border-color: var(--primary); background: var(--primary-light); }
  .platform-radio-ic { width: 32px; height: 32px; border-radius: 8px; background: var(--surface-3); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .platform-radio.selected .platform-radio-ic, .platform-radio:has(input:checked) .platform-radio-ic { background: var(--surface); }
  .platform-radio-name { font-size: 13.5px; font-weight: 700; color: var(--text-1); }
  .platform-radio-hint { font-size: 11.5px; color: var(--text-3); font-weight: 500; margin-top: 1px; }

  /* ── DOC LIST ── */
  .doc-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
  .doc-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: var(--r); background: var(--surface-3); }
  .doc-row-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
  .doc-row-icon { width: 34px; height: 34px; border-radius: 8px; background: var(--primary-light); color: var(--primary-dark); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .doc-row-text { min-width: 0; }
  .doc-row-name { font-size: 13px; font-weight: 700; color: var(--text-1); }
  .doc-row-meta { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

  /* ── TERMS BODY ── */
  .terms-doc { max-height: 380px; overflow-y: auto; border: 1.5px solid var(--border); border-radius: var(--r); padding: 20px 22px; background: var(--surface-3); font-size: 13.5px; line-height: 1.7; color: var(--text-2); margin-bottom: 18px; white-space: pre-wrap; word-break: break-word; }
  .terms-version-tag { font-size: 11px; color: var(--text-3); font-weight: 600; letter-spacing: 0.3px; text-transform: uppercase; margin-bottom: 12px; }
  .terms-agree-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 18px; padding: 14px 16px; border: 1.5px solid var(--primary); background: var(--primary-light); border-radius: var(--r); }
  .terms-agree-row input { margin-top: 2px; accent-color: var(--primary); width: 16px; height: 16px; }
  .terms-agree-row label { font-size: 13px; font-weight: 600; color: var(--primary-dark); line-height: 1.5; }

  /* ── INLINE ERR ── */
  .field-error { font-size: 12px; color: var(--red); margin-top: 5px; font-weight: 500; }

  /* ── INFO BAR ── */
  .info-bar { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; background: var(--blue-bg); border: 1.5px solid rgba(37,99,235,0.15); border-radius: var(--r); margin-bottom: 16px; }
  .info-bar-icon { color: var(--blue); flex-shrink: 0; margin-top: 1px; }
  .info-bar-text { font-size: 12.5px; color: var(--text-2); line-height: 1.5; font-weight: 500; }

  /* ── HELPER GRID CLASSES (so inline-style grids can be overridden in media queries) ── */
  .aff-earnings-row { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 14px; margin-bottom: 16px; }

  /* ════════════════════════════════════════════════════════════
     MOBILE LAYOUT — two layers working together:
       1. CONTENT-FITTING: every wide element (buttons, tables, long
          words, grids) compresses to fit its allotted width — so
          nothing actually overflows.
       2. SAFETY NET: html / body / #app / main-content also clip any
          stray overflow with overflow-x:hidden. This catches edge
          cases without clipping anything visible (layer 1 already
          made everything fit).
     Tables live in .table-wrap which has its OWN internal horizontal
     scroll — wide tables don't widen the page, the user swipes inside
     the table card.
  ════════════════════════════════════════════════════════════ */

  /* Grid children must not blow past their cell. Applies at all widths. */
  .stats-grid > *, .stats-grid-2 > *, .stats-grid-4 > *,
  .ticket-stats > *, .payout-grid > *, .share-grid > *,
  .compliance-grid > *, .products-grid > *, .creatives-grid > *,
  .form-grid-2 > *, .quick-grid > *, .aff-earnings-row > * { min-width: 0; }

  /* Wrappers must not have content escape them. min-width: 0 is critical
     for flex/grid children so they CAN shrink below their content's natural
     width (default min-width is 'auto' which equals content min-width). */
  #app, .main-content, .page, .card, .stat-card, .table-wrap, .ticket-stat,
  .aff-earnings-row > div { min-width: 0; max-width: 100%; }

  /* Page-level safety net — body/main can never scroll horizontally.
     This is harmless: layer 1 (the rules below) already makes content fit
     within the viewport, so there's nothing to actually clip. */
  html, body { max-width: 100%; overflow-x: hidden; }
  #app { max-width: 100%; overflow-x: hidden; }
  .main-content { overflow-x: hidden; }

  @media (max-width: 768px) {
    /* Page header — title block + actions row stack and FILL THE WIDTH
       so long subtitle text wraps naturally instead of getting clipped. */
    .page-header { flex-direction: column; align-items: stretch; gap: 12px; }
    .page-header > div { width: 100%; min-width: 0; }
    .page-title { word-break: break-word; overflow-wrap: anywhere; }
    .page-subtitle { white-space: normal; overflow-wrap: anywhere; }

    /* Header-action buttons — vertical stack at small width so each one
       is its own full-width row (was clipping when side-by-side). */
    .header-actions {
      width: 100%;
      flex-direction: column;
      align-items: stretch;
      gap: 8px;
      margin-top: 0;
    }
    .header-actions .btn,
    .header-actions a.btn {
      width: 100%;
      min-width: 0;
      justify-content: center;
      min-height: 42px;
      white-space: normal;
    }

    /* Tables — scroll INSIDE the wrapper, never the page */
    .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .table-wrap table { min-width: 560px; }

    /* Helper-class grids collapse */
    .aff-earnings-row { grid-template-columns: 1fr; gap: 12px; }

    /* Ticket stats — drop from 3-col to 2-col on tablet/mobile */
    .ticket-stats { grid-template-columns: repeat(2, 1fr); gap: 12px; }

    /* Long Rs amounts should wrap instead of widening the card */
    .stat-value, .ticket-stat-val, .payout-amount, .earnings-col-val,
    .tier-rate, .profile-stat-val { overflow-wrap: anywhere; word-break: break-word; }

    /* Tier-card body — ring on top, info below, everything stretches */
    .tier-card { flex-direction: column; align-items: stretch; gap: 16px; padding: 22px 18px; }
    .tier-ring-wrap { align-self: center; }
    .tier-progress-row { flex-wrap: wrap; row-gap: 4px; }
    .tier-milestones { flex-wrap: wrap; gap: 8px 12px; }
    .tier-milestone { font-size: 11px; }

    /* Stat cards — donut shrinks so long Rs amounts have room */
    .stat-card { padding: 16px 18px; gap: 12px; }
    .stat-card-left { min-width: 0; flex: 1; }
    .stat-donut { width: 44px; height: 44px; }

    /* Card-internal flex toolbars wrap instead of pushing wider */
    .card [style*="display:flex"], .card [style*="display: flex"],
    .table-header { flex-wrap: wrap; }

    /* Form inputs at least 16px to prevent iOS zoom-on-focus */
    .form-input, .form-select, .form-textarea, .search-input, .login-input,
    .link-input { font-size: 16px; max-width: 100%; }

    /* Filter row stacks */
    .filter-row { flex-wrap: wrap; gap: 8px; }
    .filter-row > * { width: 100%; }

    /* Profile hero stretches */
    .profile-hero { flex-direction: column; align-items: stretch; gap: 16px; }
    .profile-stats { margin-left: 0; gap: 16px; flex-wrap: wrap; }

    /* Earnings summary single column */
    .earnings-summary { grid-template-columns: 1fr; }
    .earnings-col { border-right: none; border-bottom: 1px solid var(--border); }
    .earnings-col:last-child { border-bottom: none; }

    /* Charts — bars should resize, not push wider */
    .chart-area, .chart-labels { gap: 4px; }
    .chart-area { min-width: 0; }

    /* SVGs (donuts, etc.) shouldn't force a minimum width */
    .stat-donut, .stat-card svg, .chart-area svg { max-width: 100%; }
  }

  @media (max-width: 480px) {
    /* Single-column everything that still has 2 cols */
    .stats-grid, .stats-grid-2, .stats-grid-4,
    .ticket-stats, .quick-grid { grid-template-columns: 1fr; gap: 10px; }

    .main-content { padding: 14px 12px 32px; }
    .stat-card { padding: 14px 16px; }
    .stat-value { font-size: 20px; }
    .payout-amount { font-size: 26px; }
    .tier-rate { font-size: 22px; }
    .ticket-stat-val { font-size: 24px; }
    .earnings-col-val { font-size: 22px; }
    .page-title { font-size: 19px; }
    .page-subtitle { font-size: 12.5px; }

    /* Tier-card progress info wraps and shrinks */
    .tier-progress-val { font-size: 10.5px; }
    .tier-info { min-width: 0; }
  }
