/* ============================================================
   XRP VAULT — Design System
   Authentic XRP/Ripple brand color palette
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* XRP Brand Palette — Deep navy with electric blue */
  --xrp-blue: #0085FF;
  --xrp-blue-light: #38A3FF;
  --xrp-blue-dark: #0066CC;
  --xrp-blue-glow: rgba(0,133,255,0.15);
  --xrp-blue-subtle: rgba(0,133,255,0.06);

  /* Backgrounds — Deep navy-black tones */
  --bg-deepest: #06080F;
  --bg-dark: #0B1120;
  --bg-card: #111827;
  --bg-card-hover: #162030;
  --bg-surface: #1A2332;
  --bg-elevated: #1E293B;

  /* Borders */
  --border: #1E293B;
  --border-light: #2A3A50;

  /* Text */
  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --text-faint: #475569;

  /* Status */
  --success: #10B981;
  --success-bg: rgba(16,185,129,0.1);
  --danger: #EF4444;
  --danger-bg: rgba(239,68,68,0.1);
  --warning: #F59E0B;
  --warning-bg: rgba(245,158,11,0.1);
  --info: #0085FF;
  --info-bg: rgba(0,133,255,0.1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-deepest);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: rgba(0,133,255,0.3); color: #fff; }

/* Scrollbar — XRP themed */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--xrp-blue); }

/* ============================================================
   GLASS CARDS
   ============================================================ */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: all 0.35s cubic-bezier(0.25,0.46,0.45,0.94);
}
.glass-card:hover {
  border-color: rgba(0,133,255,0.15);
  box-shadow: 0 8px 32px -8px rgba(0,0,0,0.4);
}

/* ============================================================
   XRP ACCENT UTILITIES
   ============================================================ */
.xrp-gradient { background: linear-gradient(135deg, var(--xrp-blue), var(--xrp-blue-dark)); }
.xrp-gradient-light { background: linear-gradient(135deg, var(--xrp-blue), var(--xrp-blue-light)); }
.xrp-text { color: var(--xrp-blue); }
.xrp-glow { box-shadow: 0 0 30px var(--xrp-blue-glow), 0 0 60px rgba(0,133,255,0.05); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
  background: linear-gradient(135deg, var(--xrp-blue), var(--xrp-blue-dark));
  color: #fff;
  padding: 10px 24px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  box-shadow: 0 2px 12px rgba(0,133,255,0.2);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(0,133,255,0.35);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  padding: 10px 24px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 14px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-secondary:hover { background: var(--bg-elevated); border-color: var(--xrp-blue); color: var(--xrp-blue); }

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  padding: 10px 24px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 14px;
  border: 1px solid rgba(239,68,68,0.2);
  cursor: pointer;
  transition: all 0.3s;
}
.btn-danger:hover { background: rgba(239,68,68,0.2); }

.btn-sm { padding: 7px 16px; font-size: 12px; border-radius: 8px; }
.btn-xs { padding: 4px 12px; font-size: 11px; border-radius: 6px; }

/* ============================================================
   FORM INPUTS
   ============================================================ */
.form-input {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: 10px;
  width: 100%;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.25s ease;
  outline: none;
}
.form-input:focus {
  border-color: var(--xrp-blue);
  box-shadow: 0 0 0 3px var(--xrp-blue-glow);
}
.form-input::placeholder { color: var(--text-muted); }
select.form-input { appearance: auto; }
textarea.form-input { min-height: 100px; resize: vertical; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ============================================================
   DATA TABLES
   ============================================================ */
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
  background: var(--bg-dark);
}
.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(30,41,59,0.5);
  color: var(--text-primary);
}
.data-table tr:hover td { background: var(--xrp-blue-subtle); }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info { background: var(--info-bg); color: var(--xrp-blue); }
.badge-neutral { background: rgba(100,116,139,0.12); color: var(--text-muted); }

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  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(--xrp-blue), transparent);
}
.stat-value {
  font-size: 26px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-primary);
  line-height: 1.2;
}
.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: 260px;
  background: var(--bg-dark);
  border-right: 1px solid var(--border);
  height: 100vh !important;
  height: 100dvh !important;
  position: fixed;
  top: 0; left: 0;
  z-index: 50;
  transition: transform 0.3s cubic-bezier(0.25,0.46,0.45,0.94);
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}
.sidebar-header {
  flex: 0 0 auto !important;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}
.sidebar-nav {
  flex: 1 1 0% !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior-y: contain;
  padding: 4px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  -webkit-overflow-scrolling: touch;
}
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: var(--xrp-blue); }
.sidebar-footer {
  flex: 0 0 auto !important;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-dark);
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
  margin: 1px 0;
}
.sidebar-link:hover, .sidebar-link.active {
  color: var(--xrp-blue);
  background: var(--xrp-blue-subtle);
  border-left-color: var(--xrp-blue);
}
.sidebar-section {
  padding: 8px 20px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 18px;
}
.main-content {
  margin-left: 260px;
  padding: 24px;
  min-height: 100vh;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(6,8,15,0.7);
  z-index: 40;
  backdrop-filter: blur(4px);
}

@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar.open + .sidebar-overlay { display: block; }
  .main-content { margin-left: 0; }
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6,8,15,0.8);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.25s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================================
   NOTIFICATION BELL + DROPDOWN
   ============================================================ */
.notif-bell { position: relative; cursor: pointer; }
.notif-badge {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 18px; height: 18px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 2px 8px rgba(239,68,68,0.4);
}
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: -8px;
  width: 360px;
  max-height: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
  overflow: hidden;
  display: none;
  z-index: 200;
  animation: modalIn 0.2s ease;
}
.notif-dropdown.open { display: block; }
.notif-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(30,41,59,0.4);
  transition: background 0.15s;
  cursor: pointer;
}
.notif-item:hover { background: var(--xrp-blue-subtle); }
.notif-item.unread { background: rgba(0,133,255,0.04); }
.notif-item.unread::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 3px;
  background: var(--xrp-blue);
  margin-top: 6px;
  flex-shrink: 0;
}

/* Toast notifications */
.toast-container {
  position: fixed;
  top: 80px; right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  animation: toastIn 0.4s ease, toastOut 0.3s ease 4s forwards;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  max-width: 380px;
}
.toast-success { background: linear-gradient(135deg, #059669, #10B981); }
.toast-error { background: linear-gradient(135deg, #DC2626, #EF4444); }
.toast-info { background: linear-gradient(135deg, var(--xrp-blue-dark), var(--xrp-blue)); }
.toast-warning { background: linear-gradient(135deg, #D97706, #F59E0B); }
@keyframes toastIn { from { opacity:0; transform:translateX(60px); } to { opacity:1; transform:translateX(0); } }
@keyframes toastOut { from { opacity:1; } to { opacity:0; transform:translateX(60px); } }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fadeUp { animation: fadeUp 0.6s ease forwards; }

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 5px var(--xrp-blue-glow); }
  50% { box-shadow: 0 0 20px var(--xrp-blue-glow); }
}
.pulse-glow { animation: pulseGlow 3s ease-in-out infinite; }

.flash-msg { animation: fadeUp 0.3s ease; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
  .stat-value { font-size: 20px; }
  .stat-card { padding: 14px; }
  .glass-card { border-radius: 12px; }
  .main-content { padding: 16px; }
}

@media print {
  .sidebar, .no-print { display: none !important; }
  .main-content { margin-left: 0 !important; }
}
