@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=DM+Sans:wght@300;400;500&display=swap');

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

:root {
  --bg: #0a0a1a;
  --bg2: #0d1225;
  --surface: rgba(255,255,255,0.04);
  --border: rgba(255,255,255,0.08);
  --teal: #1D9E75;
  --teal-light: #5DCAA5;
  --purple: #7F77DD;
  --amber: #EF9F27;
  --red: #E24B4A;
  --text: #ffffff;
  --text-muted: rgba(255,255,255,0.45);
  --sidebar-w: 220px;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 0.5px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 28px 20px;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 36px;
}
.brand-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 12px rgba(29,158,117,0.7);
}
.brand-name {
  font-family: 'Playfair Display', serif;
  font-size: 18px; font-weight: 700;
  color: var(--text);
}

nav { display: flex; flex-direction: column; gap: 4px; }
.nav-link {
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
  transition: all 0.2s;
}
.nav-link:hover { background: var(--surface); color: var(--text); }
.nav-link.active { background: rgba(29,158,117,0.12); color: var(--teal-light); font-weight: 500; }

.sidebar-footer {
  margin-top: auto;
  font-size: 11px;
  color: rgba(255,255,255,0.2);
}

/* MAIN */
.main {
  margin-left: var(--sidebar-w);
  padding: 32px 36px;
  flex: 1;
  min-height: 100vh;
}

.topbar {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 28px;
}
.topbar h1 {
  font-family: 'Playfair Display', serif;
  font-size: 28px; font-weight: 900;
}
.subtitle { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

.live-badge {
  background: rgba(29,158,117,0.15);
  border: 0.5px solid rgba(29,158,117,0.4);
  color: var(--teal-light);
  font-size: 11px; font-weight: 500;
  padding: 6px 14px; border-radius: 20px;
  letter-spacing: 1px;
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.6} }

/* METRICS */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.metric-card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}
.metric-card.danger { border-color: rgba(226,75,74,0.3); background: rgba(226,75,74,0.06); }
.metric-label { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 1px; }
.metric-value { font-size: 28px; font-weight: 700; font-family: 'Playfair Display', serif; margin-bottom: 6px; }
.metric-change { font-size: 12px; }
.metric-change.positive { color: var(--teal-light); }
.metric-change.negative { color: #E24B4A; }

/* CHARTS */
.charts-row { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; margin-bottom: 24px; }
.card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 14px;
  padding: 24px;
}
.card h2 { font-size: 15px; font-weight: 500; margin-bottom: 16px; color: rgba(255,255,255,0.8); }

/* TABLE */
.tx-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tx-table thead th {
  text-align: left; padding: 10px 12px;
  color: var(--text-muted); font-weight: 500;
  border-bottom: 0.5px solid var(--border);
  font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
}
.tx-table tbody td { padding: 12px 12px; border-bottom: 0.5px solid rgba(255,255,255,0.04); }
.tx-table tbody tr:hover td { background: rgba(255,255,255,0.02); }

.risk { font-weight: 600; font-size: 12px; padding: 3px 8px; border-radius: 6px; }
.risk.high { background: rgba(226,75,74,0.15); color: #F09595; }
.risk.medium { background: rgba(239,159,39,0.15); color: #FAC775; }
.risk.low { background: rgba(29,158,117,0.15); color: #5DCAA5; }

.badge { font-size: 11px; font-weight: 500; padding: 4px 10px; border-radius: 20px; }
.badge.danger { background: rgba(226,75,74,0.15); color: #F09595; }
.badge.safe { background: rgba(29,158,117,0.15); color: #5DCAA5; }
.badge.warning { background: rgba(239,159,39,0.15); color: #FAC775; }

/* FORM (predict page) */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.form-group input, .form-group select {
  width: 100%; padding: 10px 14px;
  background: rgba(255,255,255,0.05);
  border: 0.5px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus { border-color: var(--teal); }

.btn {
  background: var(--teal);
  color: #fff;
  border: none;
  padding: 12px 28px;
  border-radius: 30px;
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: background 0.2s, transform 0.15s;
}
.btn:hover { background: var(--teal-light); transform: translateY(-1px); }

.result-box {
  margin-top: 24px;
  padding: 20px;
  border-radius: 12px;
  display: none;
}
.result-box.fraud { background: rgba(226,75,74,0.1); border: 1px solid rgba(226,75,74,0.3); }
.result-box.safe { background: rgba(29,158,117,0.1); border: 1px solid rgba(29,158,117,0.3); }
.result-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.result-fraud { color: #F09595; }
.result-safe { color: #5DCAA5; }
.result-desc { font-size: 13px; color: var(--text-muted); }

/* RESPONSIVE */
@media(max-width:900px){
  .metrics-grid{ grid-template-columns: repeat(2,1fr); }
  .charts-row{ grid-template-columns: 1fr; }
  .sidebar{ width:180px; }
  .main{ margin-left:180px; }
}
