/* ============================================
   TRO - The Real Orbit - Global Styles
   Clean White + Soft Light Theme
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Instrument+Serif:ital@0;1&display=swap');

:root {
  --primary: #1A6B4A;
  --primary-light: #22875D;
  --primary-soft: #E8F5EF;
  --accent: #F0A500;
  --accent-soft: #FEF3CD;
  --danger: #DC3545;
  --danger-soft: #FDECEA;
  --info: #0D6EFD;
  --info-soft: #E8F0FE;
  --warn: #F59E0B;
  --warn-soft: #FFFBEB;
  --success: #10B981;
  --success-soft: #D1FAE5;

  --bg: #F7F9FC;
  --bg-white: #FFFFFF;
  --bg-card: #FFFFFF;
  --border: #E5EBF2;
  --border-light: #F0F4F8;

  --text-dark: #0F1923;
  --text-main: #2D3748;
  --text-muted: #718096;
  --text-light: #A0AEC0;

  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shadow: 0 2px 16px rgba(0,0,0,0.07);
  --shadow-md: 0 4px 28px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.13);

  --sidebar-w: 260px;
  --font: 'Plus Jakarta Sans', sans-serif;
  --font-serif: 'Instrument Serif', serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-main);
  min-height: 100vh;
  font-size: 14.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 14px; font-weight: 600;
  border: none; cursor: pointer; transition: all 0.2s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(26,107,74,0.3); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary-soft); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.1); }
.btn-sm { padding: 7px 16px; font-size: 13px; }
.btn-lg { padding: 14px 32px; font-size: 15px; border-radius: var(--radius); }
.btn-full { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }

/* ---- Cards ---- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 24px;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}
.card-header h3 { font-size: 16px; font-weight: 700; color: var(--text-dark); }

/* ---- Form ---- */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-main); margin-bottom: 6px; }
.form-control {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-family: var(--font); font-size: 14px;
  color: var(--text-dark); background: var(--bg-white); transition: all 0.2s;
  outline: none;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,107,74,0.1); }
.form-control::placeholder { color: var(--text-light); }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }

/* ---- Alerts ---- */
.alert {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 18px; border-radius: var(--radius-sm);
  font-size: 14px; margin-bottom: 16px;
}
.alert-icon { font-size: 18px; margin-top: 1px; flex-shrink: 0; }
.alert-warn { background: var(--warn-soft); border: 1px solid #FCD34D; color: #92400E; }
.alert-success { background: var(--success-soft); border: 1px solid #6EE7B7; color: #065F46; }
.alert-danger { background: var(--danger-soft); border: 1px solid #FCA5A5; color: #991B1B; }
.alert-info { background: var(--info-soft); border: 1px solid #93C5FD; color: #1E40AF; }

/* ---- KYC Warning Banner ---- */
.kyc-banner {
  background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
  border: 1px solid #FCD34D;
  border-left: 4px solid var(--warn);
  border-radius: var(--radius);
  padding: 18px 22px;
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 24px;
}
.kyc-banner-icon { font-size: 32px; flex-shrink: 0; }
.kyc-banner-content h4 { font-size: 15px; font-weight: 700; color: #92400E; margin-bottom: 4px; }
.kyc-banner-content p { font-size: 13px; color: #B45309; line-height: 1.5; }
.kyc-banner-actions { margin-left: auto; }

/* ---- Stat Cards ---- */
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; position: relative; overflow: hidden;
}
.stat-card::after {
  content: ''; position: absolute; top: -20px; right: -20px;
  width: 80px; height: 80px; border-radius: 50%;
  background: currentColor; opacity: 0.06;
}
.stat-card .stat-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.6px; }
.stat-card .stat-value { font-size: 26px; font-weight: 800; color: var(--text-dark); margin: 6px 0 4px; }
.stat-card .stat-sub { font-size: 12px; color: var(--text-muted); }
.stat-card .stat-icon { font-size: 28px; margin-bottom: 12px; }

/* ---- Tables ---- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.6px; background: var(--bg); border-bottom: 1px solid var(--border); }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--border-light); font-size: 13.5px; vertical-align: middle; }
.tbl tr:hover td { background: var(--bg); }
.tbl tr:last-child td { border-bottom: none; }

/* ---- Badge ---- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 600; }
.badge-success { background: var(--success-soft); color: #065F46; }
.badge-warn { background: var(--warn-soft); color: #92400E; }
.badge-danger { background: var(--danger-soft); color: #991B1B; }
.badge-info { background: var(--info-soft); color: #1E40AF; }
.badge-muted { background: #F3F4F6; color: var(--text-muted); }

/* ---- Sidebar Layout ---- */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); background: var(--bg-white);
  border-right: 1px solid var(--border); position: fixed;
  top: 0; left: 0; height: 100vh; overflow-y: auto;
  z-index: 100; display: flex; flex-direction: column;
}
.sidebar-logo {
  padding: 24px 22px 20px; border-bottom: 1px solid var(--border-light);
}
.sidebar-logo .logo-text { font-family: var(--font-serif); font-size: 22px; color: var(--primary); font-style: italic; }
.sidebar-logo .logo-sub { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

.sidebar-nav { padding: 16px 12px; flex: 1; }
.nav-section-label { font-size: 10px; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: 1px; padding: 8px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: 14px; font-weight: 500;
  margin-bottom: 2px; transition: all 0.15s; position: relative;
}
.nav-item:hover { background: var(--bg); color: var(--text-dark); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-item .nav-icon { font-size: 17px; width: 22px; text-align: center; }
.nav-item .nav-badge { margin-left: auto; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 10px; }

.sidebar-bottom { padding: 16px 12px; border-top: 1px solid var(--border-light); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); }
.sidebar-avatar { width: 36px; height: 36px; background: var(--primary-soft); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--primary); font-weight: 700; font-size: 14px; }
.sidebar-user-info .name { font-size: 13px; font-weight: 600; color: var(--text-dark); }
.sidebar-user-info .role { font-size: 11px; color: var(--text-muted); }

.main-content { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  background: var(--bg-white); border-bottom: 1px solid var(--border);
  padding: 0 28px; height: 64px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 17px; font-weight: 700; color: var(--text-dark); }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-notif { position: relative; cursor: pointer; font-size: 20px; color: var(--text-muted); }
.notif-dot { position: absolute; top: -2px; right: -2px; width: 8px; height: 8px; background: var(--danger); border-radius: 50%; border: 2px solid white; }

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

/* ---- KYC Steps ---- */
.kyc-steps { display: flex; gap: 0; margin-bottom: 32px; }
.kyc-step {
  flex: 1; display: flex; align-items: center; gap: 0;
}
.kyc-step-circle {
  width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; flex-shrink: 0; transition: all 0.3s;
}
.kyc-step.done .kyc-step-circle { background: var(--primary); color: #fff; }
.kyc-step.active .kyc-step-circle { background: var(--accent); color: #fff; box-shadow: 0 0 0 4px var(--accent-soft); }
.kyc-step.todo .kyc-step-circle { background: var(--bg); color: var(--text-muted); border: 2px solid var(--border); }
.kyc-step-line { flex: 1; height: 2px; background: var(--border); margin: 0 8px; }
.kyc-step.done .kyc-step-line { background: var(--primary); }
.kyc-step-label { font-size: 11px; font-weight: 600; color: var(--text-muted); margin-top: 6px; }

/* ---- Progress / Verify ---- */
.verify-progress { position: relative; height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; margin: 10px 0; }
.verify-bar { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 4px; transition: width 1s linear; }

/* ---- Investment Card ---- */
.invest-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: var(--radius-lg); padding: 32px; color: #fff; position: relative; overflow: hidden;
}
.invest-card::before {
  content: ''; position: absolute; top: -40px; right: -40px;
  width: 160px; height: 160px; border-radius: 50%; background: rgba(255,255,255,0.08);
}
.invest-card::after {
  content: ''; position: absolute; bottom: -60px; left: 40px;
  width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,0.05);
}

/* ---- TRX Verify Box ---- */
.trx-box {
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
  border-radius: var(--radius); padding: 24px; color: #fff;
}
.trx-address {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-sm); padding: 12px 16px;
  font-family: monospace; font-size: 14px; color: #7DD3FC;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  word-break: break-all;
}
.copy-btn { cursor: pointer; color: #94A3B8; font-size: 16px; flex-shrink: 0; transition: color 0.2s; }
.copy-btn:hover { color: #fff; }

/* ---- Referral Link ---- */
.ref-box {
  background: var(--primary-soft); border: 1px dashed var(--primary);
  border-radius: var(--radius-sm); padding: 12px 16px;
  display: flex; align-items: center; gap: 10px; overflow: hidden;
}
.ref-link { font-size: 13px; color: var(--primary); font-weight: 500; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Modal ---- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  z-index: 999; display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px); opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.modal-overlay.show { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-white); border-radius: var(--radius-lg);
  padding: 32px; max-width: 480px; width: 92%; box-shadow: var(--shadow-lg);
  transform: scale(0.95) translateY(20px); transition: all 0.25s ease;
}
.modal-overlay.show .modal { transform: scale(1) translateY(0); }
.modal-header { text-align: center; margin-bottom: 24px; }
.modal-icon { font-size: 48px; margin-bottom: 12px; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .page-body { padding: 18px; }
  .topbar { padding: 0 18px; }
}

/* ---- Misc ---- */
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.text-primary { color: var(--primary); }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12.5px; }
.text-xs { font-size: 11.5px; }
.fw-bold { font-weight: 700; }
.fw-600 { font-weight: 600; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.flex { display: flex; } .flex-center { display: flex; align-items: center; } .gap-2 { gap: 12px; }
.justify-between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 900px) { .grid-4 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.spinner { display: inline-block; width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pulse { animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.6; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeInUp 0.4s ease forwards; }

/* Auth Pages */
.auth-bg {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #F0FDF4 0%, #ECFDF5 40%, #F0F9FF 100%);
  padding: 20px;
}
.auth-card {
  background: var(--bg-white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 40px; width: 100%; max-width: 440px;
  border: 1px solid var(--border);
}
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo .brand { font-family: var(--font-serif); font-size: 28px; color: var(--primary); font-style: italic; }
.auth-logo .tagline { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-light); }
