/* ============================================================
   WebTrade v5 — Main Stylesheet
   Mobile-first, fully responsive
   ============================================================ */

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --bg-base:        #0b0f17;
  --bg-surface:     #111827;
  --bg-card:        #161e2e;
  --bg-input:       #1a2236;
  --sidebar-bg:     #0d1220;
  --sidebar-w:      240px;
  --topbar-h:       60px;
  --ticker-h:       38px;
  --brand-bar-h:    0px;   /* diisi oleh mobile media query */

  --blue:           #2563eb;
  --blue-hover:     #1d4ed8;
  --blue-dim:       rgba(37,99,235,.15);
  --green:          #22c55e;
  --green-hover:    #16a34a;
  --green-dim:      rgba(34,197,94,.14);
  --red:            #ef4444;
  --red-dim:        rgba(239,68,68,.14);
  --yellow:         #eab308;
  --yellow-dim:     rgba(234,179,8,.14);
  --cyan:           #06b6d4;
  --cyan-dim:       rgba(6,182,212,.14);

  --text-1:         #f1f5f9;
  --text-2:         #a8bbd0;
  --text-3:         #6b7f96;
  --border:         #243349;

  --radius-sm:      6px;
  --radius-md:      10px;
  --radius-lg:      14px;
  --radius-xl:      18px;
  --radius-full:    9999px;

  --shadow-sm:      0 1px 4px rgba(0,0,0,.4);
  --shadow-md:      0 4px 16px rgba(0,0,0,.5);
  --shadow-lg:      0 8px 32px rgba(0,0,0,.6);

  --transition:     .2s ease;
  --font:           'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text-1);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a3a52; border-radius: var(--radius-full); }

/* ============================================================
   MOBILE BRAND BAR
   Hanya tampil di mobile — logo di tengah, di atas topbar
   ============================================================ */
.mobile-brand-bar {
  display: none; /* desktop: tersembunyi */
}

/* ============================================================
   TICKER BAR
   ============================================================ */
.ticker-bar {
  background: #080d14;
  border-bottom: 1px solid var(--border);
  height: var(--ticker-h);
  overflow: hidden;
  position: sticky;
  top: var(--topbar-h);   /* desktop: tepat di bawah topbar */
  z-index: 1049;
}
.ticker-wrapper {
  display: flex;
  align-items: center;
  height: 100%;
  overflow: hidden;
}
.ticker-scroll {
  display: flex;
  align-items: center;
  white-space: nowrap;
  animation: ticker 80s linear infinite;
  gap: 0;
}
.ticker-scroll:hover { animation-play-state: paused; }
@keyframes ticker {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 18px;
  height: var(--ticker-h);
  border-right: 1px solid #1a2436;
  cursor: pointer;
  transition: background var(--transition);
  flex-shrink: 0;
}
.ticker-item:hover { background: rgba(255,255,255,.03); }
.ticker-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ticker-symbol { font-size: 12px; color: var(--text-1); font-weight: 700; }
.ticker-price  { font-size: 12px; color: var(--text-1); font-weight: 700; }
.ticker-change { font-size: 11px; font-weight: 600; }
.ticker-change.up   { color: var(--green); }
.ticker-change.down { color: var(--red); }
.ticker-warn { font-size: 9px; color: var(--red); }

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 1050;
  height: var(--topbar-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.3px;
  user-select: none;
  flex-shrink: 0;
}
.topbar-brand .word-money   { color: var(--text-1); }
.topbar-brand .word-control {
  background: var(--green);
  color: #000;
  padding: 1px 7px;
  border-radius: var(--radius-sm);
  font-size: 15px;
}
.topbar-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-2);
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  flex-shrink: 0;
}
.topbar-menu-btn:hover { color: var(--text-1); background: var(--bg-input); }

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.balance-chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-1);
  white-space: nowrap;
}
.chip-free {
  background: var(--green);
  color: #000;
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  border: none;
  transition: background var(--transition);
}
.chip-free:hover { background: var(--green-hover); }
.chip-actype-real { background: var(--blue) !important; color: #fff !important; }
.chip-actype-real:hover { background: var(--blue-hover, #1d4ed8) !important; }

/* Notif wrapper — visible on desktop, hidden on mobile via media query */
.topbar-notif { display: flex; position: relative; }

/* Icon buttons in topbar */
.topbar-icon {
  position: relative;
  background: none;
  border: none;
  color: var(--text-2);
  font-size: 20px;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition), background var(--transition);
}
.topbar-icon:hover { color: var(--text-1); background: var(--bg-input); }
.topbar-icon .notif-dot {
  position: absolute;
  top: 4px; right: 4px;
  width: 7px; height: 7px;
  background: var(--red);
  border-radius: 50%;
  border: 2px solid var(--bg-surface);
}

/* Dropdown base */
.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  overflow: hidden;
  min-width: 200px;
  animation: fadeDown .15s ease;
}
.dropdown-menu.open { display: block; }
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.dropdown-header {
  padding: 11px 16px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-1);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  border-bottom: 1px solid var(--border);
}
.dropdown-item:last-child { border-bottom: none; }
.dropdown-item:hover { background: var(--bg-input); color: var(--text-1); }
.dropdown-item.danger { color: var(--red); }
.dropdown-item.danger:hover { background: var(--red-dim); }
.dropdown-notif-empty { padding: 18px 16px; text-align: center; color: var(--text-3); font-size: 12px; }

/* User avatar trigger */
.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-1);
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.topbar-user:hover { background: var(--bg-input); }
.topbar-user img {
  width: 30px; height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--blue);
}
.topbar-user .uname {
  font-size: 12px;
  font-weight: 600;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-user ion-icon { font-size: 13px; color: var(--text-3); }

/* ============================================================
   LAYOUT
   ============================================================ */
.app-layout {
  display: flex;
  min-height: calc(100vh - var(--brand-bar-h) - var(--topbar-h) - var(--ticker-h));
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 1040;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.open { display: block; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: calc(var(--topbar-h) + var(--ticker-h));
  height: calc(100vh - var(--topbar-h) - var(--ticker-h));
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform var(--transition);
}

/* Sidebar user card */
.sidebar-user {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px 16px 16px;
  border-bottom: 1px solid var(--border);
  text-align: center;
  flex-shrink: 0;
}
.sidebar-user-avatar {
  width: 54px; height: 54px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--blue);
  margin-bottom: 10px;
}
.sidebar-user-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.3;
}
.sidebar-user-handle {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}

/* Nav */
.sidebar-nav {
  padding: 10px 0 20px;
  flex: 1;
}
.nav-section-label {
  padding: 10px 16px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-3);
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 7px 14px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-left: 3px solid transparent;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  transition: color var(--transition), background var(--transition), border-color var(--transition);
  user-select: none;
}
/* Icon container — kotak dengan background warna */
.nav-link .nav-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 17px;
  background: rgba(255,255,255,.06);
  color: var(--text-2);
  transition: background var(--transition), color var(--transition);
}
.nav-link:hover {
  color: var(--text-1);
  background: rgba(255,255,255,.04);
}
.nav-link:hover .nav-icon {
  background: rgba(255,255,255,.1);
  color: var(--text-1);
}

.nav-link.active {
  color: var(--blue);
  background: var(--blue-dim);
  border-left-color: var(--blue);
  font-weight: 600;
}
.nav-link.active .nav-icon {
  background: var(--blue);
  color: #fff;
}

.nav-link .nav-arrow {
  margin-left: auto;
  font-size: 14px;
  transition: transform var(--transition);
  flex-shrink: 0;
  color: var(--text-3);
}
.nav-link.sub-open .nav-arrow { transform: rotate(180deg); }

/* ── Submenu ── */
.nav-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease;
  background: rgba(0,0,0,.15);
}
.nav-submenu.open { max-height: 500px; }
.nav-submenu .nav-link {
  padding: 6px 14px 6px 20px;
  font-size: 12px;
  border-left: none;
  border-radius: 0;
}
.nav-submenu .nav-link .nav-icon {
  width: 26px;
  height: 26px;
  font-size: 14px;
  border-radius: 6px;
}
.nav-submenu .nav-link.active .nav-icon {
  background: var(--blue);
  color: #fff;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  flex: 1;
  min-width: 0;
  padding: 24px;
  overflow-x: hidden;
}

/* ============================================================
   PAGE HEADER / BREADCRUMB
   ============================================================ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.page-header h4 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-1);
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-2);
}
.breadcrumb a { color: var(--text-3); transition: color var(--transition); }
.breadcrumb a:hover { color: var(--blue); }
.breadcrumb span { color: var(--text-2); }

/* ============================================================
   REFERRAL BAR
   ============================================================ */
.referral-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  margin-bottom: 22px;
}
.referral-bar input {
  flex: 1;
  min-width: 0;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  padding: 8px 12px;
  font-size: 12px;
  transition: border-color var(--transition);
}
.referral-bar input:focus { outline: none; border-color: var(--blue); }
.btn-copy {
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 18px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background var(--transition);
}
.btn-copy:hover { background: var(--blue-hover); }
.btn-copy.copied { background: var(--green); color: #000; }

/* ============================================================
   STAT / DASHBOARD CARDS
   ============================================================ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 18px 0;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color var(--transition), transform var(--transition);
}
.stat-card:hover { border-color: #2a3f60; transform: translateY(-2px); }

.stat-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  /* pastikan teks tidak tertutup sparkline */
  position: relative;
  z-index: 1;
  padding-bottom: 14px;
}
.stat-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  flex-shrink: 0;
}
.stat-icon.blue   { background: var(--blue-dim);   color: var(--blue); }
.stat-icon.green  { background: var(--green-dim);  color: var(--green); }
.stat-icon.yellow { background: var(--yellow-dim); color: var(--yellow); }
.stat-icon.cyan   { background: var(--cyan-dim);   color: var(--cyan); }

.stat-card-link {
  font-size: 11px;
  color: var(--blue);
  white-space: nowrap;
  flex-shrink: 0;
  transition: color var(--transition);
}
.stat-card-link:hover { color: var(--text-1); }

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-top: 12px;
}
.stat-subtitle {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 2px;
}
.stat-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-1);
  margin-top: 4px;
  line-height: 1.2;
}

/* sparkline berada di bawah teks, BUKAN absolute overlap */
.sparkline-wrap {
  width: 100%;
  height: 56px;
  flex-shrink: 0;
  /* geser ke luar padding kiri-kanan card agar full-width */
  margin-left: -18px;
  margin-right: -18px;
  width: calc(100% + 36px);
  pointer-events: none;
  display: block;
  overflow: hidden;
}
.sparkline-wrap canvas {
  display: block;
  width: 100% !important;
  height: 56px !important;
}

/* ============================================================
   SECTION CARD (news, notifications, tables wrapper)
   ============================================================ */
.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 18px;
}
.section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
}
.section-head ion-icon { color: var(--blue); font-size: 17px; }

/* ============================================================
   NEWS / NOTIFICATION ITEMS
   ============================================================ */
.news-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.news-item:last-child { border-bottom: none; }
.news-item:hover { background: rgba(255,255,255,.025); }
.news-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: var(--blue-dim);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  margin-top: 1px;
}
.news-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 3px;
}
.news-item-date {
  font-size: 12px;
  color: var(--text-2);
}
.news-item-msg {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 2px;
}
.empty-state {
  padding: 28px 18px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}
.empty-state ion-icon {
  font-size: 36px;
  display: block;
  margin: 0 auto 8px;
  opacity: .4;
}

/* ============================================================
   WELCOME BOX
   ============================================================ */
.welcome-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}
.welcome-box h5 {
  font-size: 15px;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 8px;
}
.welcome-box p {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.65;
  margin-bottom: 6px;
}
.welcome-box a { color: var(--yellow); }
.welcome-box a:hover { text-decoration: underline; }

/* ============================================================
   TWO-COLUMN GRID
   ============================================================ */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}
.three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}
.four-col {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.form-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
}
.form-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.form-section-title ion-icon { color: var(--blue); font-size: 17px; }

.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 6px;
  letter-spacing: .2px;
}
.form-label .req { color: var(--red); margin-left: 2px; }

.form-control {
  display: block;
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  padding: 9px 13px;
  font-size: 13px;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  -webkit-appearance: none;
}
.form-control:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
  background: #1c2840;
}
.form-control::placeholder { color: var(--text-3); }
.form-control[readonly], .form-control:disabled {
  opacity: .55;
  cursor: not-allowed;
}
select.form-control { cursor: pointer; }
select.form-control option { background: var(--bg-card); color: var(--text-1); }

textarea.form-control { resize: vertical; min-height: 90px; }

.form-hint {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 4px;
  display: block;
}

/* Input with icon */
.input-wrap { position: relative; }
.input-wrap .form-control { padding-right: 38px; }
.input-wrap .input-icon {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  font-size: 17px;
  cursor: pointer;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  transition: color var(--transition);
}
.input-wrap .input-icon:hover { color: var(--text-1); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  white-space: nowrap;
  text-align: center;
}
.btn:active { transform: scale(.97); }
.btn-full { width: 100%; }
.btn ion-icon { font-size: 16px; }

.btn-primary { background: var(--blue);  color: #fff; }
.btn-primary:hover { background: var(--blue-hover); box-shadow: 0 4px 12px rgba(37,99,235,.35); }

.btn-success { background: var(--green); color: #000; font-weight: 700; }
.btn-success:hover { background: var(--green-hover); box-shadow: 0 4px 12px rgba(34,197,94,.3); }

.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #dc2626; }

.btn-warning { background: var(--yellow); color: #000; font-weight: 700; }
.btn-warning:hover { background: #ca8a04; }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-2);
}
.btn-outline:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-dim); }

.btn-outline-primary {
  background: transparent;
  border: 1px solid var(--blue);
  color: var(--blue);
}
.btn-outline-primary:hover { background: var(--blue); color: #fff; }

.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 12px 28px; font-size: 14px; }

/* ============================================================
   BADGES / STATUS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.badge-active, .badge-approved, .badge-completed {
  background: var(--green-dim); color: var(--green);
}
.badge-pending {
  background: var(--yellow-dim); color: var(--yellow);
}
.badge-rejected, .badge-suspended, .badge-cancelled {
  background: var(--red-dim); color: var(--red);
}
.badge-inactive, .badge-not_submitted {
  background: rgba(100,116,139,.15); color: #64748b;
}
.badge-info { background: var(--blue-dim); color: var(--blue); }

/* Invoice button in table rows */
.btn-invoice {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-3);
  font-size: 15px; transition: all .15s; text-decoration: none;
}
.btn-invoice:hover {
  background: var(--blue-dim); border-color: var(--blue); color: var(--blue);
}

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 500px;
}
.data-table thead tr {
  background: var(--bg-surface);
}
.data-table th {
  padding: 11px 16px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .5px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 13px 16px;
  font-size: 13px;
  color: var(--text-1);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: rgba(255,255,255,.02); }
.data-table .td-main { font-weight: 600; color: var(--text-1); }

/* ============================================================
   INVESTMENT PLAN CARDS
   ============================================================ */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}
.plan-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.plan-card:hover {
  border-color: var(--blue);
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}
.plan-card.featured { border-color: var(--green); }
.plan-card.featured:hover { border-color: var(--green); box-shadow: 0 8px 28px rgba(34,197,94,.15); }
.plan-badge {
  position: absolute;
  top: 14px; right: -22px;
  background: var(--green);
  color: #000;
  font-size: 9px;
  font-weight: 800;
  padding: 4px 32px;
  transform: rotate(45deg);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.plan-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-1);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.plan-roi {
  font-size: 38px;
  font-weight: 900;
  color: var(--green);
  line-height: 1;
  margin: 12px 0 4px;
}
.plan-roi small { font-size: 13px; color: var(--text-3); font-weight: 500; }
.plan-range {
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 16px;
}
.plan-features {
  list-style: none;
  margin-bottom: 20px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.plan-features li {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 0;
  font-size: 13px;
  color: var(--text-1);
  border-bottom: 1px solid var(--border);
}
.plan-features li:last-child { border-bottom: none; }
.plan-features li ion-icon { color: var(--green); font-size: 14px; flex-shrink: 0; }

/* ============================================================
   WALLET CARDS
   ============================================================ */
.wallet-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}
.wallet-card {
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, var(--bg-card), var(--bg-base));
}
.wallet-card::after {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,.03);
}
.wallet-curr   { font-size: 12px; color: var(--text-2); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.wallet-amount { font-size: 26px; font-weight: 800; color: var(--text-1); line-height: 1.1; margin-bottom: 4px; }
.wallet-label  { font-size: 13px; color: var(--text-2); }
.wallet-actions { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ============================================================
   KYC UPLOAD AREA
   ============================================================ */
.upload-area {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  overflow: hidden;
}
.upload-area:hover { border-color: var(--blue); background: var(--blue-dim); }
.upload-area input[type="file"] {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer;
  width: 100%; height: 100%;
}
.upload-area ion-icon { font-size: 32px; color: var(--text-3); display: block; margin-bottom: 8px; }
.upload-area p { font-size: 12px; color: var(--text-3); }
.upload-area .upload-hint { font-size: 11px; color: var(--text-3); margin-top: 4px; }

/* ============================================================
   FLASH ALERTS
   ============================================================ */
.flash {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 500;
  animation: fadeIn .3s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.flash ion-icon { font-size: 18px; flex-shrink: 0; }
.flash-success { background: var(--green-dim);  border: 1px solid rgba(34,197,94,.3);  color: var(--green); }
.flash-error   { background: var(--red-dim);    border: 1px solid rgba(239,68,68,.3);  color: var(--red); }
.flash-info    { background: var(--blue-dim);   border: 1px solid rgba(37,99,235,.3);  color: #60a5fa; }
.flash-warning { background: var(--yellow-dim); border: 1px solid rgba(234,179,8,.3);  color: var(--yellow); }

/* ============================================================
   ALERT / NOTICE BOX
   ============================================================ */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 15px;
  border-radius: var(--radius-md);
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 14px;
}
.notice ion-icon { font-size: 17px; flex-shrink: 0; margin-top: 1px; }
.notice-warning { background: var(--yellow-dim); border: 1px solid rgba(234,179,8,.25); color: var(--yellow); }
.notice-danger  { background: var(--red-dim);    border: 1px solid rgba(239,68,68,.25); color: var(--red); }
.notice-info    { background: var(--blue-dim);   border: 1px solid rgba(37,99,235,.25); color: #93c5fd; }

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-wrap {
  height: 6px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 8px;
}
.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--blue), var(--green));
  transition: width 1s ease, background .3s;
}

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background: radial-gradient(ellipse at 50% 0%, #0f1e38 0%, var(--bg-base) 65%);
}
.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
}
.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}
.auth-logo-text {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.3px;
}
.auth-logo-text .c {
  background: var(--green);
  color: #000;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  margin-left: 3px;
}
.auth-logo-sub { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.auth-title    { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.auth-subtitle { font-size: 13px; color: var(--text-3); margin-bottom: 24px; }
.auth-divider {
  position: relative;
  text-align: center;
  margin: 20px 0;
  font-size: 12px;
  color: var(--text-3);
}
.auth-divider::before, .auth-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 42%;
  height: 1px;
  background: var(--border);
}
.auth-divider::before { left: 0; }
.auth-divider::after  { right: 0; }
.auth-footer {
  text-align: center;
  font-size: 13px;
  color: var(--text-2);
  margin-top: 20px;
}
.auth-footer a { color: var(--blue); font-weight: 600; }
.auth-footer a:hover { text-decoration: underline; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.72);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s, visibility .2s;
  backdrop-filter: blur(3px);
}
.modal-backdrop.open { opacity: 1; visibility: visible; }
.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 26px;
  width: 100%;
  max-width: 460px;
  transform: translateY(-16px) scale(.97);
  transition: transform .25s;
  box-shadow: var(--shadow-lg);
}
.modal-backdrop.open .modal-box { transform: translateY(0) scale(1); }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-header h5 { font-size: 16px; font-weight: 700; }
.modal-close {
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: color var(--transition);
}
.modal-close:hover { color: var(--red); }

/* ============================================================
   KYC STATUS BANNER
   ============================================================ */
.kyc-status-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 22px;
}
.kyc-status-icon {
  width: 50px; height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.kyc-status-title { font-size: 15px; font-weight: 700; margin-bottom: 3px; }
.kyc-status-desc  { font-size: 12px; color: var(--text-2); }

/* ============================================================
   QUICK STATS LIST
   ============================================================ */
.stats-list { display: grid; gap: 0; }
.stats-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-1);
}
.stats-list-item:last-child { border-bottom: none; }
.stats-list-label { color: var(--text-2); font-size: 13px; }

/* ============================================================
   DEPOSIT WALLET SELECTOR
   ============================================================ */
.wallet-option {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 13px 15px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  margin-bottom: 10px;
}
.wallet-option:hover { border-color: var(--blue); background: var(--bg-input); }
.wallet-option.selected { border-color: var(--blue); background: var(--blue-dim); }
.wallet-option-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.wallet-option-name { font-weight: 700; font-size: 13px; }
.wallet-option-network { font-size: 11px; color: var(--text-3); }
.wallet-address-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-base);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
}
.wallet-address-text {
  font-size: 11px;
  color: var(--text-2);
  word-break: break-all;
  flex: 1;
  min-width: 0;
}
.btn-copy-addr {
  background: var(--blue);
  border: none;
  color: #fff;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background var(--transition);
}
.btn-copy-addr:hover { background: var(--blue-hover); }
.btn-copy-addr.copied { background: var(--green); color: #000; }

/* ============================================================
   PROFILE CARD (sidebar style)
   ============================================================ */
/* ── Profile page layout ── */
.profile-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
  align-items: start;
}
.form-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.profile-sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  text-align: center;
}
.profile-sidebar-card img {
  width: 90px; height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--blue);
  margin: 0 auto 12px;
}
.profile-sidebar-name { font-size: 17px; font-weight: 800; margin-bottom: 3px; }
.profile-sidebar-handle { font-size: 12px; color: var(--text-3); margin-bottom: 10px; }

/* ── Dropdown user card (foto + nama saat avatar diklik) ── */
.dropdown-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-input);
}
.dropdown-user-card img {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--blue);
  flex-shrink: 0;
}
.dropdown-user-info { min-width: 0; }
.dropdown-user-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dropdown-user-handle {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 1px;
}

/* ============================================================
   SHARE BUTTONS
   ============================================================ */
.share-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity var(--transition);
  color: #fff;
}
.share-btn:hover { opacity: .85; }
.share-wa   { background: #25d366; color: #000; }
.share-tg   { background: #0088cc; }
.share-tw   { background: #1da1f2; }

/* ============================================================
   TRADINGVIEW CHART CONTAINER
   ============================================================ */
.chart-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  height: 460px;
}

/* ============================================================
   STRENGTH METER
   ============================================================ */
.strength-meter .progress-fill { transition: width .4s, background .4s; }
.strength-text { font-size: 11px; margin-top: 4px; }

/* ============================================================
   CHAT BUBBLE (floating)
   ============================================================ */
.chat-fab {
  position: fixed;
  bottom: 22px; right: 22px;
  width: 48px; height: 48px;
  background: var(--blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(37,99,235,.4);
  z-index: 9999;
  transition: transform var(--transition), box-shadow var(--transition);
  border: none;
  color: #fff;
  font-size: 22px;
}
.chat-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(37,99,235,.5);
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.text-green  { color: var(--green) !important; }
.text-red    { color: var(--red) !important; }
.text-yellow { color: var(--yellow) !important; }
.text-blue   { color: var(--blue) !important; }
.text-muted  { color: var(--text-3) !important; }
.text-sm     { font-size: 12px; }
.text-xs     { font-size: 11px; }
.fw-bold     { font-weight: 700; }
.fw-black    { font-weight: 900; }
.d-flex      { display: flex; }
.align-center{ align-items: center; }
.gap-8       { gap: 8px; }
.gap-12      { gap: 12px; }
.mt-4        { margin-top: 4px; }
.mt-8        { margin-top: 8px; }
.mb-0        { margin-bottom: 0; }
.w-100       { width: 100%; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.word-break  { word-break: break-all; }
.nowrap      { white-space: nowrap; }
.flex-1      { flex: 1; min-width: 0; }
.divider     { height: 1px; background: var(--border); margin: 14px 0; }

/* ============================================================
   RESPONSIVE — Tablet (≤ 1024px)
   ============================================================ */
@media (max-width: 1024px) {
  .four-col { grid-template-columns: repeat(2, 1fr); }
  .plans-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   RESPONSIVE — Mobile (≤ 768px)
   ============================================================ */
@media (max-width: 768px) {
  :root {
    --brand-bar-h: 54px;
    --topbar-h:    64px;
  }

  /* ── Mobile Brand Bar: logo di atas, tengah ── */
  .mobile-brand-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: var(--brand-bar-h);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.3px;
    position: sticky;
    top: 0;
    z-index: 1062;
  }
  .mobile-brand-bar .word-money   { color: var(--text-1); }
  .mobile-brand-bar .word-control {
    background: var(--green);
    color: #000;
    padding: 2px 10px;
    border-radius: var(--radius-sm);
    font-size: 18px;
  }

  /* ── Topbar turun ke bawah brand bar ── */
  .topbar {
    top: var(--brand-bar-h);
    z-index: 1058;
  }
  /* Sembunyikan brand di dalam topbar (digantikan mobile-brand-bar) */
  .topbar-brand { display: none; }

  /* ── Ticker turun ke bawah brand bar + topbar ── */
  .ticker-bar {
    position: sticky;
    top: calc(var(--brand-bar-h) + var(--topbar-h));
    z-index: 1055;
  }

  /* ── Sidebar offset menyesuaikan tiga baris header ── */
  .sidebar {
    position: fixed;
    left: 0;
    top: calc(var(--brand-bar-h) + var(--topbar-h));
    height: calc(100vh - var(--brand-bar-h) - var(--topbar-h));
    z-index: 1056;
    transform: translateX(-100%);
    transition: transform .28s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay {
    top: calc(var(--brand-bar-h) + var(--topbar-h));
    height: calc(100vh - var(--brand-bar-h) - var(--topbar-h));
    z-index: 1047;
  }
  .topbar-menu-btn { display: flex; }

  /* ── Main content full width ── */
  .main-content { padding: 16px 14px; }

  /* ── Teks lebih besar & jelas di mobile ── */
  body                 { font-size: 15px; }
  .stat-label          { font-size: 13px; }
  .stat-value          { font-size: 20px; }
  .stat-subtitle       { font-size: 13px; }
  .page-header h4      { font-size: 20px; }
  .section-head        { font-size: 15px; padding: 14px 16px; }
  .form-label          { font-size: 14px; }
  .form-hint           { font-size: 13px; }
  .form-control        { font-size: 15px; padding: 11px 13px; }
  .breadcrumb          { font-size: 13px; }
  .stats-list-item     { font-size: 14px; padding: 13px 0; }
  .stats-list-label    { font-size: 14px; }
  .data-table th       { font-size: 13px; padding: 12px 14px; }
  .data-table td       { font-size: 14px; padding: 13px 14px; }
  .badge               { font-size: 12px; padding: 4px 10px; }
  .news-item-title     { font-size: 15px; }
  .news-item-msg       { font-size: 13px; }
  .news-item-date      { font-size: 12px; }
  .dropdown-item       { font-size: 15px; padding: 14px 16px; }
  .btn                 { font-size: 14px; padding: 11px 20px; }
  .btn-sm              { font-size: 13px; padding: 8px 14px; }
  .form-section-title  { font-size: 15px; }
  .notice              { font-size: 13px; }
  .flash               { font-size: 14px; }
  .plan-name           { font-size: 17px; }
  .plan-range          { font-size: 13px; }
  .plan-features li    { font-size: 14px; }
  .wallet-curr         { font-size: 13px; }
  .wallet-label        { font-size: 14px; }
  .empty-state         { font-size: 14px; }

  /* Cards */
  .cards-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .two-col    { grid-template-columns: 1fr; }
  .three-col  { grid-template-columns: 1fr; }
  .four-col   { grid-template-columns: 1fr; }

  /* Plan cards */
  .plans-grid { grid-template-columns: 1fr; }

  /* Wallet cards */
  .wallet-cards-grid { grid-template-columns: 1fr; }

  /* Page header */
  .page-header { flex-direction: column; align-items: flex-start; gap: 4px; }

  /* Auth card */
  .auth-card { padding: 24px 18px; }

  /* Topbar mobile: tampilkan notif (icon saja), sembunyikan username */
  .topbar-notif        { display: flex; }
  .topbar-user .uname  { display: none; }
  .topbar-chevron      { display: none; }
  .topbar-user img     { width: 36px; height: 36px; border-width: 2px; }
  .balance-chip        { padding: 7px 12px; font-size: 12px; }
  .chip-free           { padding: 6px 10px; font-size: 12px; font-weight: 800; border-radius: 6px; }
  .topbar-menu-btn     { font-size: 26px; }
  #userDrop            { min-width: 220px; }

  /* ── Sidebar mobile: lebih besar & nyaman disentuh ── */
  .sidebar {
    width: 82vw;
    max-width: 300px;
  }
  .sidebar-user { padding: 20px 16px 16px; }
  .sidebar-user-avatar { width: 62px; height: 62px; margin-bottom: 10px; }
  .sidebar-user-name   { font-size: 14px; }
  .sidebar-user-handle { font-size: 12px; }
  .nav-link {
    padding: 9px 14px;
    font-size: 14px;
    gap: 12px;
  }
  .nav-link .nav-icon {
    width: 36px;
    height: 36px;
    font-size: 19px;
    border-radius: 9px;
  }
  .nav-submenu .nav-link {
    padding: 7px 14px 7px 18px;
    font-size: 13px;
  }
  .nav-submenu .nav-link .nav-icon {
    width: 30px;
    height: 30px;
    font-size: 16px;
  }
  .nav-link .nav-arrow { font-size: 15px; }

  /* ── Profile layout: stack jadi satu kolom ── */
  .profile-layout  { grid-template-columns: 1fr; }
  .form-two-col    { grid-template-columns: 1fr; }

  /* ── Profile sidebar card: horizontal di mobile ── */
  .profile-sidebar-card {
    display: flex;
    align-items: center;
    gap: 16px;
    text-align: left;
    padding: 16px;
    flex-wrap: wrap;
  }
  .avatar-upload-wrap { flex-shrink: 0; margin: 0 !important; }
  .profile-sidebar-card .divider { display: none; }
  .profile-sidebar-card .stats-list { display: none; }
  .profile-sidebar-card p { display: none; }

  /* Referral bar */
  .referral-bar { flex-wrap: wrap; }

  /* Table scroll */
  .data-table { min-width: 420px; }

  /* Stat card sparkline smaller */
  .sparkline-wrap { height: 44px; }
  .sparkline-wrap canvas { height: 44px !important; }
  .stat-value { font-size: 18px; }
}

/* ============================================================
   RESPONSIVE — Small Mobile (≤ 480px)
   ============================================================ */
@media (max-width: 480px) {
  :root {
    --ticker-h:    34px;
    --topbar-h:    58px;
    --brand-bar-h: 48px;
  }
  .cards-grid   { grid-template-columns: 1fr; gap: 10px; }
  .stat-card { padding: 14px 14px 0; }
  .stat-card .stat-card-top { padding-bottom: 10px; }
  .sparkline-wrap { margin-left: -14px; margin-right: -14px; width: calc(100% + 28px); }
  .stat-value   { font-size: 17px; }

  /* Brand bar sedikit lebih kecil dari 768px */
  .mobile-brand-bar { font-size: 19px; }
  .mobile-brand-bar .word-control { font-size: 16px; padding: 2px 8px; }

  /* Topbar */
  .topbar { padding: 0 12px; gap: 8px; }
  .balance-chip { padding: 6px 13px; font-size: 12px; }
  .chip-free    { padding: 5px 11px; font-size: 12px; }
  .topbar-user img { width: 32px; height: 32px; }
  .topbar-menu-btn { font-size: 24px; }

  .main-content { padding: 12px 10px; }
  .form-section { padding: 16px; }
  .auth-card    { padding: 20px 14px; }
  .plan-card    { padding: 18px 14px; }
  .plan-roi     { font-size: 30px; }
  .modal-box    { padding: 20px 16px; }
  .share-btns   { gap: 6px; }
  .share-btn    { padding: 7px 12px; font-size: 12px; }
  /* Teks di layar sangat kecil — sedikit dikecilkan dari 768px tapi tetap terbaca */
  .stat-value   { font-size: 18px; }
  .stat-label   { font-size: 12px; }
  .data-table th { font-size: 12px; }
  .data-table td { font-size: 13px; }

  /* Sidebar lebih lebar di layar kecil */
  .sidebar { width: 88vw; max-width: 280px; }
  .nav-link { padding: 12px 16px; font-size: 13px; }
  .nav-submenu .nav-link { padding: 10px 16px 10px 46px; }

  /* Profile card stack vertikal di layar sangat kecil */
  .profile-sidebar-card { flex-direction: column; align-items: center; text-align: center; }
  .avatar-upload-wrap   { margin: 0 auto !important; }
}
