/* ============================================================
   Investor Portal - Main Stylesheet
   Color scheme: July Ventures (dark navy, gold, deep blue)
   ============================================================ */

:root {
  --bg-primary:     #0a0e1a;
  --bg-secondary:   #111827;
  --bg-card:        #0d1525;
  --bg-elevated:    #162033;
  --border:         #1e3a5f;
  --border-light:   #243b55;
  --text-primary:   #e2e8f0;
  --text-secondary: #8ba3c4;
  --text-muted:     #bbc7d9;
  --gold:           #92D050;
  --gold-light:     #C0E697;
  --gold-dark:      #72A83E;
  --blue-accent:    #2563eb;
  --blue-bright:    #3b82f6;
  --danger:         #ef4444;
  --success:        #22c55e;
  --warning:        #f59e0b;
  --radius:         8px;
  --radius-lg:      12px;
  --shadow:         0 4px 24px rgba(0,0,0,0.4);
  --shadow-gold:    0 0 20px rgba(201,168,76,0.15);
  --transition:     all 0.2s ease;
}

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

html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }

.text-gold { color: var(--gold); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }

/* ============================================================
   LAYOUT
   ============================================================ */
.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  min-height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
}

.main-content {
  margin-left: 240px;
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.page-content {
  padding: 32px;
  flex: 1;
}

/* ============================================================
   LOGO / BRAND
   ============================================================ */
.brand {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
}
.brand-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.brand-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-top: 2px;
}
.brand-badge {
  display: inline-block;
  background: rgba(201,168,76,0.15);
  border: 1px solid rgba(201,168,76,0.3);
  color: var(--gold);
  font-size: 0.8rem;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 1px;
  margin-top: 4px;
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.nav {
  flex: 1;
  padding: 16px 0;
  overflow-y: auto;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
  border-left: 3px solid transparent;
  cursor: pointer;
}
.nav-item:hover {
  background: rgba(201,168,76,0.05);
  color: var(--text-primary);
  border-left-color: rgba(201,168,76,0.3);
}
.nav-item.active {
  background: rgba(201,168,76,0.1);
  color: var(--gold);
  border-left-color: var(--gold);
}
.nav-icon {
  width: 18px;
  height: 18px;
  opacity: 0.7;
  flex-shrink: 0;
}
.nav-item.active .nav-icon,
.nav-item:hover .nav-icon { opacity: 1; }

.nav-section-title {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 16px 20px 6px;
}
.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 16px;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  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);
}
.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}
.card-gold {
  border-top: 2px solid var(--gold);
}

/* ============================================================
   STAT CARDS
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
}
.stat-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
}
.stat-change {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.5;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, #1e3a5f, #0d2240);
  color: var(--gold);
  border: 1px solid var(--gold-dark);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #243d63, #102a4d);
  box-shadow: var(--shadow-gold);
}
.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #0a0e1a;
  font-weight: 600;
}
.btn-gold:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  box-shadow: 0 4px 12px rgba(201,168,76,0.3);
}
.btn-danger {
  background: rgba(239,68,68,0.1);
  color: var(--danger);
  border: 1px solid rgba(239,68,68,0.3);
}
.btn-danger:hover:not(:disabled) { background: rgba(239,68,68,0.2); }
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) { background: var(--bg-elevated); color: var(--text-primary); }
.btn-sm { padding: 5px 10px; font-size: 0.75rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }
.btn-icon { padding: 8px; }
.btn-block { width: 100%; justify-content: center; }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
}
.form-control {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--gold-dark);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.1);
}
.form-control::placeholder { color: var(--text-muted); }
select.form-control { cursor: pointer; }
.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 0.75rem; color: var(--danger); margin-top: 4px; }

/* ============================================================
   TABLE
   ============================================================ */
.table-responsive { overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.table th {
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.table th:hover { color: var(--text-secondary); }
.table th.sorted { color: var(--gold); }
.table th .sort-icon { margin-left: 4px; opacity: 0.5; }
.table th.sorted .sort-icon { opacity: 1; }
.table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(30,58,95,0.4);
  color: var(--text-primary);
  vertical-align: middle;
}
.table tr:hover td { background: rgba(201,168,76,0.03); }
.table tr:last-child td { border-bottom: none; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert-success { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.3); color: #86efac; }
.alert-danger { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; }
.alert-warning { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.3); color: #fde68a; }
.alert-info { background: rgba(59,130,246,0.1); border: 1px solid rgba(59,130,246,0.3); color: #93c5fd; }

/* ============================================================
   BADGE / CHIP
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.badge-gold { background: rgba(201,168,76,0.15); color: var(--gold); border: 1px solid rgba(201,168,76,0.3); }
.badge-blue { background: rgba(37,99,235,0.15); color: #93c5fd; border: 1px solid rgba(37,99,235,0.3); }
.badge-green { background: rgba(34,197,94,0.1); color: #86efac; border: 1px solid rgba(34,197,94,0.3); }
.badge-red { background: rgba(239,68,68,0.1); color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); }
.badge-gray { background: rgba(100,116,139,0.15); color: #94a3b8; border: 1px solid rgba(100,116,139,0.3); }

/* ============================================================
   DRAG & DROP UPLOAD
   ============================================================ */
.dropzone {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: rgba(30,58,95,0.05);
}
.dropzone:hover, .dropzone.drag-over {
  border-color: var(--gold-dark);
  background: rgba(201,168,76,0.05);
}
.dropzone-icon { font-size: 2.5rem; margin-bottom: 12px; }
.dropzone-title { font-size: 1rem; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.dropzone-hint { font-size: 0.8rem; color: var(--text-muted); }
.upload-list { margin-top: 16px; text-align: left; }
.upload-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 6px;
  font-size: 0.8rem;
}
.upload-item-name { flex: 1; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; }
.upload-item-size { color: var(--text-muted); white-space: nowrap; }
.upload-progress {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 4px;
  overflow: hidden;
}
.upload-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  transition: width 0.3s ease;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform 0.2s;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 1rem; font-weight: 600; color: var(--text-primary); }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ============================================================
   LOGIN PAGES
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 30% 20%, rgba(30,58,95,0.3) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 80%, rgba(201,168,76,0.05) 0%, transparent 50%),
              var(--bg-primary);
  padding: 20px;
}
.login-card {
  width: 100%;
  max-width: 500px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}
.login-header {
  background: linear-gradient(180deg, #3a4656 0%, #0b0b0c 100%);
  padding: 32px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.login-title { font-size: 1.25rem; font-weight: 700; color: var(--gold); letter-spacing: 2px; text-transform: uppercase; }
.login-subtitle { font-size: 0.75rem; color: var(--text-muted); margin-top: 6px; letter-spacing: 1px; }
.login-body { padding: 32px; }

/* ============================================================
   OTP INPUT
   ============================================================ */
.otp-inputs {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 20px 0;
}
.otp-input {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--bg-primary);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--gold);
  outline: none;
  transition: var(--transition);
}
.otp-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,168,76,0.2); }

/* ============================================================
   FUND BUTTONS (User portal)
   ============================================================ */
.fund-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 24px;
}
.fund-button {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  text-decoration: none;
  color: var(--text-primary);
  display: block;
  position: relative;
  overflow: hidden;
}
.fund-button::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}
.fund-button:hover::before { transform: scaleX(1); }
.fund-button:hover {
  border-color: var(--border-light);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-gold);
}
.fund-number { font-size: 0.7rem; color: var(--text-muted); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 8px; }
.fund-name { font-size: 1.15rem; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }
.fund-arrow { color: var(--gold); font-size: 1.2rem; margin-top: 12px; display: block; }

/* ============================================================
   FILE LIST
   ============================================================ */
.file-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(30,58,95,0.4);
  transition: var(--transition);
}
.file-item:hover { background: rgba(201,168,76,0.03); }
.file-item:last-child { border-bottom: none; }
.file-icon { font-size: 1.5rem; flex-shrink: 0; width: 32px; text-align: center; }
.file-info { flex: 1; min-width: 0; }
.file-name {
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.file-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ============================================================
   SEARCH & FILTER BAR
   ============================================================ */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.search-input {
  flex: 1;
  min-width: 200px;
  max-width: 360px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px 8px 36px;
  color: var(--text-primary);
  font-size: 0.875rem;
  outline: none;
  transition: var(--transition);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%234a6080' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.099zm-5.44 1.406a5.5 5.5 0 1 1 0-11 5.5 5.5 0 0 1 0 11z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 10px center;
}
.search-input:focus { border-color: var(--gold-dark); }
.filter-select {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  outline: none;
  cursor: pointer;
}
.filter-select:focus { border-color: var(--gold-dark); }

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
  margin-bottom: 24px;
}
.page-title { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); }
.page-subtitle { font-size: 0.875rem; color: var(--text-muted); margin-top: 4px; }
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.breadcrumb a { color: var(--gold-dark); text-decoration: none; }
.breadcrumb a:hover { color: var(--gold); }
.breadcrumb-sep { color: var(--text-muted); }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 20px;
  justify-content: flex-end;
}
.page-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  font-size: 0.8rem;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  transition: var(--transition);
  text-decoration: none;
}
.page-item:hover { border-color: var(--gold-dark); color: var(--gold); }
.page-item.active { background: rgba(201,168,76,0.1); border-color: var(--gold-dark); color: var(--gold); font-weight: 600; }
.page-item.disabled { opacity: 0.4; cursor: not-allowed; }

/* ============================================================
   AVATAR / INITIALS
   ============================================================ */
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(201,168,76,0.15);
  border: 1px solid rgba(201,168,76,0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  flex-shrink: 0;
}

/* ============================================================
   UTILITIES
   ============================================================ */
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.hidden { display: none !important; }
.w-full { width: 100%; }

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

/* ============================================================
   SPINNER / LOADING
   ============================================================ */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .page-content { padding: 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .fund-grid { grid-template-columns: 1fr; }
  .otp-inputs { gap: 6px; }
  .otp-input { width: 40px; height: 48px; font-size: 1.2rem; }
}
