/* ============= 1. SYSTEM RESET & VARIABLES ============= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Elegant deep dark blue for the main page backgrounds */
  --page-bg: #0b111e;
  
  /* Standard content cards remain clean white */
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-strong: #f1f5f9;
  
  /* Legible typography values for light content surfaces */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --primary: #3b82f6;
  --primary-deep: #1d4ed8;
  --primary-soft: rgba(59, 130, 246, 0.08);
  --shadow: rgba(15, 23, 42, 0.06);
  --shadow-strong: rgba(15, 23, 42, 0.1);
}

body {
  background: radial-gradient(circle at top left, rgba(59, 130, 246, 0.12), transparent 35%),
              linear-gradient(180deg, #0b111e 0%, #0f172a 50%, #070a12 100%);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text-primary);
  min-height: 100vh;
}

/* ============= 2. PERSISTENT CORE NAV HEADER ============= */
.main-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-link {
  text-decoration: none;
  color: var(--text-primary);
}

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

.profile-container {
  position: relative;
}

.main-header .profile-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 20px;
  transition: background 0.2s;
  color: var(--text-primary);
}

.main-header .profile-trigger:hover {
  background: var(--surface-soft);
}

.profile-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 200px;
  box-shadow: 0 10px 25px var(--shadow-strong);
  padding: 8px 0;
  display: flex;
  flex-direction: column;
}

.dropdown-item {
  padding: 10px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: background 0.2s;
}

.dropdown-item:hover {
  background: var(--surface-soft);
  color: var(--text-primary);
}

.dropdown-item.logout {
  color: #ef4444;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 6px 0;
}

/* ============= 3. DASHBOARD STRUCTURAL LAYOUT ============= */
.dashboard-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 110px 0 0;
}

.section-white {
  background: transparent;
  padding: 28px 24px;
}

.section-offwhite {
  background: transparent;
  padding: 24px 24px;
}

.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 0 24px;
}

/* Welcome Box Banner */
.dashboard-header {
  background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 100%);
  color: #ffffff;
  padding: 32px;
  border-radius: 20px;
  margin-bottom: 24px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.dashboard-header h1 {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 6px;
}

.dashboard-subtitle {
  font-size: 15px;
  opacity: 0.9;
}

/* Balance Metrics Grid Rows */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 15px var(--shadow);
}

/* HARD INTERCEPT: KEEP COUNTDOWN CARD UNIQUE AND DARK BLUE */
.stats-row .stat-card[style*="border-left"] {
  background: #0f172a !important; 
  border-color: #ef4444 !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4) !important;
}

.stats-row .stat-card[style*="border-left"] .stat-label {
  color: #94a3b8 !important;
}

.stats-row .stat-card[style*="border-left"] .stat-value {
  color: #ffffff !important;
}

.stats-row [id="countdown-timer"] {
  color: #fca5a5 !important;
}

.stat-icon {
  font-size: 28px;
  background: var(--surface-soft);
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Action Shortcut Buttons */
.action-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.action-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 4px 10px var(--shadow);
}

.action-btn:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

/* Two-Column Grid Alignment Split */
.main-content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 40px;
}

.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 15px var(--shadow);
  margin-bottom: 32px;
}

.section-card:last-child {
  margin-bottom: 0;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.section-header h2 {
  font-size: 18px;
  font-weight: 600;
}

/* Ledger Transaction History Logs Table Styles */
.transactions-list {
  display: flex;
  flex-direction: column;
}

.transaction-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--surface-soft);
}

.transaction-item:last-child {
  border-bottom: none;
}

.tx-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tx-icon-wrapper {
  font-size: 18px;
  width: 40px;
  height: 40px;
  background: var(--surface-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.tx-details {
  display: flex;
  flex-direction: column;
}

.tx-title {
  font-size: 14px;
  font-weight: 600;
}

.tx-date {
  font-size: 12px;
  color: var(--text-muted);
}

.tx-right {
  text-align: right;
}

.tx-amount {
  font-size: 14px;
  font-weight: 600;
}

.tx-amount.positive {
  color: #10b981;
}

.tx-amount.negative {
  color: #ef4444;
}

.tx-status {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  margin-top: 2px;
}

.tx-status.completed {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.tx-status.pending {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

/* Chart block canvas structure */
.chart-container {
  position: relative;
  width: 100%;
  height: 24px;
  background: var(--surface-soft);
  border-radius: 12px;
  overflow: hidden;
  margin: 16px 0;
}

.chart-bar {
  height: 100%;
  background: var(--primary);
  width: 0%;
  transition: width 1s ease-out;
}

.recovery-chart {
  width: 100% !important;
  height: auto !important;
  display: block;
  border-radius: 8px;
}

/* ============= 4. TELEGRAM CHAT & ACCOUNT AGENT INTERFACE ============= */
.agent-status-box {
  background: var(--surface-soft);
  padding: 20px;
  border-radius: 14px;
  border: 1px solid var(--border);
  margin-top: 12px;
}

.agent-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.agent-avatar-wrapper {
  position: relative;
}

.agent-avatar {
  font-size: 26px;
  background: var(--surface);
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  box-shadow: 0 2px 4px var(--shadow);
}

.agent-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.agent-table {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.agent-left {
  flex-shrink: 0;
}

.agent-right {
  text-align: center;
}

.agent-avatar-img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.agent-text h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 1px;
  color: var(--text-primary);
}

.agent-title {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 1px;
}

.agent-status {
  font-size: 10px;
  color: #10b981;
  font-weight: 500;
}

.agent-actions {
  margin-top: 0;
  width: 100%;
}

.status-indicator {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  background: #10b981;
  border: 2px solid var(--surface);
  border-radius: 50%;
}

.agent-meta {
  display: flex;
  flex-direction: column;
}

.agent-meta strong {
  font-size: 15px;
  color: var(--text-primary);
  font-weight: 600;
}

.agent-meta span {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 1px;
}

.chat-btn {
  width: 100%;
  padding: 14px;
  background: #0088cc;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  transition: background-color 0.2s, transform 0.1s;
}

.chat-btn:hover {
  background-color: #0077b5;
}

.chat-btn:active {
  transform: scale(0.99);
}

/* ============= 5. TESTIMONIAL SHOWCASE ============= */
.testimonial-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 32px;
  box-shadow: 0 4px 15px var(--shadow);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.testimonial-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 20px;
}

.testimonial-author-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.testimonial-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  overflow: hidden;
}

.testimonial-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.testimonial-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}

.testimonial-stars {
  font-size: 15px;
  color: #f59e0b;
  letter-spacing: 2px;
  margin-bottom: 2px;
}

.testimonial-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.testimonial-dot {
  width: 8px;
  height: 8px;
  background: #cbd5e1;
  border-radius: 50%;
  cursor: pointer;
}

.testimonial-dot.active {
  background: #3b82f6;
  width: 24px;
  border-radius: 4px;
}

/* ============= 6. COMPLIANCE FOOTER & BADGES ============= */
.dashboard-footer {
  margin-top: 40px;
  border-top: 1px solid var(--border);
  padding-top: 32px;
}

.verification-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.verification-badge {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.badge-icon {
  font-size: 18px;
  margin-top: 2px;
}

.verification-badge strong {
  display: block;
  font-size: 13px;
  color: #ffffff; /* Keep legible against dark blue layout background */
  margin-bottom: 2px;
}

.verification-badge p {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.4;
}

.footer-links {
  text-align: center;
  font-size: 13px;
  color: #64748b;
}

.footer-links a {
  color: #94a3b8;
  text-decoration: none;
  margin: 0 4px;
}

.footer-links a:hover {
  text-decoration: underline;
  color: #ffffff;
}

.site-footer {
  text-align: center;
  padding: 24px 24px 32px;
  background: transparent;
  color: #64748b;
}

/* ============= 6B. ACCOUNT SETTINGS PANEL ============= */
.settings-card {
  padding: 32px !important;
}

.settings-section {
  margin-bottom: 8px;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.setting-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.setting-item:last-child {
  border-bottom: none;
}

.setting-item > label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-bottom: 8px;
  display: block;
}

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

.setting-display > span {
  font-size: 15px;
  color: var(--text-primary);
  font-weight: 500;
}

.password-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.password-field input {
  width: 180px;
  padding: 8px 12px;
  font-size: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  outline: none;
}

.toggle-password-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.toggle-password-btn:hover {
  background: var(--surface-soft);
  color: var(--primary);
}

.edit-btn {
  background: var(--primary-soft);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.edit-btn:hover:not(:disabled) {
  background: var(--primary);
  color: #fff;
}

.edit-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ============= 7. AUTHENTICATION & VERIFICATION PANELS ============= */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 100px 24px 40px;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 10px 25px var(--shadow-strong);
  text-align: center;
}

.auth-card h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.verification-subtext {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}

.verification-timer {
  font-size: 13px;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.05);
  padding: 8px 12px;
  border-radius: 8px;
  display: inline-block;
  margin-bottom: 24px;
  font-weight: 500;
}

.code-inputs {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.digit-input {
  width: 56px;
  height: 56px;
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  background: var(--surface-soft);
  border: 2px solid var(--border);
  border-radius: 12px;
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s ease;
  padding: 0;
}

.digit-input:focus {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.resend-container {
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-secondary);
}

.resend-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-size: 14px;
}

.resend-btn:hover {
  color: var(--primary-deep);
  text-decoration: underline;
}

/* ============= 8. COMMON INTERFACE COMPONENTS ============= */
.withdraw-content {
  padding: 120px 24px 60px;
  display: flex;
  justify-content: center;
}

.withdraw-container {
  width: 100%;
  max-width: 600px;
}

.withdraw-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 10px 25px var(--shadow-strong);
}

.withdraw-card h2 {
  font-size: 24px;
  margin-bottom: 8px;
}

.withdraw-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 32px;
}

.form-group {
  margin-bottom: 24px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

input, select {
  width: 100%;
  padding: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s;
}

input:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.submit-btn {
  width: 100%;
  padding: 16px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 16px;
  transition: background 0.2s;
}

.submit-btn:hover {
  background: var(--primary-deep);
}

.withdraw-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 12px;
  text-align: center;
}

/* ============= 9. FIXED FLOATING MODAL CONTAINERS ============= */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal.hidden {
  display: none !important;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(7, 10, 18, 0.4);
  backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  width: 92%;
  max-width: 520px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
  z-index: 10;
}

.modal-card h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.modal-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
}

.modal-cancel-btn {
  width: 100%;
  padding: 16px;
  background: var(--surface-soft);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.modal-cancel-btn:hover {
  background: var(--surface-strong);
  color: var(--text-primary);
}

.confirm-details {
  background: var(--surface-soft);
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 12px;
}

.confirm-details p {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  color: var(--text-primary);
}

.confirm-details p:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.confirm-details strong {
  color: var(--text-secondary);
  font-weight: 500;
}

.error-message {
  background: #fef2f2;
  color: #ef4444;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  border: 1px solid #fca5a5;
  text-align: left;
}

.success-message {
  background: #f0fdf4;
  color: #15803d;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  border: 1px solid #bbf7d0;
}

.hidden {
  display: none !important;
}

/* ============= 10. RESPONSIVE MEDIA QUERIES ============= */
@media (max-width: 992px) {
  .main-content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .header-inner {
    padding: 16px;
  }
  
  .dashboard-content {
    padding: 90px 16px 0;
  }
  
  .section-white {
    padding: 20px 16px;
  }
  
  .section-offwhite {
    padding: 20px 16px;
  }

  .stats-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .action-buttons {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .verification-row {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .withdraw-content {
    padding: 90px 16px 40px;
  }

  .withdraw-card, .auth-card {
    padding: 24px;
  }
}