@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #070b14;
  --surface: #0d1117;
  --surface-2: #161b22;
  --border: #21262d;
  --text: #e6edf3;
  --text-muted: #7d8590;
  --accent: #58a6ff;
  --green: #3fb950;
  --red: #f85149;
  --orange: #d29922;
  --blue: #58a6ff;
  --purple: #bc8cff;
}

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

body {
  font-family: 'Outfit', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

.upload-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 24px;
}

.upload-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 48px;
  max-width: 520px;
  width: 100%;
}

.upload-card h1 { font-size: 24px; font-weight: 600; margin-bottom: 8px; }
.upload-card .subtitle { color: var(--text-muted); font-size: 14px; margin-bottom: 32px; }

.form-group { margin-bottom: 20px; }
.form-group label {
  display: block; font-size: 13px; font-weight: 500; color: var(--text-muted);
  margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px;
}
.form-group input[type="text"] {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 14px; color: var(--text);
  font-family: inherit; font-size: 14px; outline: none;
}
.form-group input[type="text"]:focus { border-color: var(--accent); }

.dropzone {
  border: 2px dashed var(--border); border-radius: 12px;
  padding: 48px 24px; text-align: center; cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--accent); background: rgba(88, 166, 255, 0.05); }
.dropzone .icon { font-size: 36px; margin-bottom: 12px; }
.dropzone .label { font-size: 14px; color: var(--text-muted); }
.dropzone .filename { font-size: 14px; color: var(--green); margin-top: 8px; font-family: 'JetBrains Mono', monospace; }

.btn {
  display: inline-block; padding: 12px 28px; border: none; border-radius: 8px;
  font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: opacity 0.2s;
}
.btn:hover { opacity: 0.85; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #000; width: 100%; margin-top: 8px; }
.btn-green { background: var(--green); color: #000; }
.btn-red { background: var(--red); color: #fff; }
.btn-orange { background: var(--orange); color: #000; }
.btn-small { padding: 6px 14px; font-size: 12px; }

.error-msg { color: var(--red); font-size: 13px; margin-top: 12px; }
.loading { color: var(--text-muted); font-size: 13px; margin-top: 12px; }

.recent-reports { max-width: 520px; width: 100%; margin-top: 32px; }
.recent-reports h3 {
  font-size: 14px; color: var(--text-muted); margin-bottom: 12px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.report-link {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; margin-bottom: 8px; text-decoration: none; color: var(--text);
  transition: border-color 0.2s;
}
.report-link:hover { border-color: var(--accent); }
.report-link .meta { font-size: 12px; color: var(--text-muted); }

.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface); border-bottom: 1px solid var(--border); padding: 12px 0;
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.nav h1 { font-size: 16px; font-weight: 600; }
.stats { display: flex; gap: 20px; font-size: 13px; }
.stat-value { font-weight: 700; font-family: 'JetBrains Mono', monospace; }
.stat-label { color: var(--text-muted); font-size: 11px; text-transform: uppercase; }

.progress-bar { width: 100%; height: 4px; background: var(--surface-2); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--green); border-radius: 2px; transition: width 0.3s; }

.filter-bar { display: flex; gap: 8px; padding: 16px 0; flex-wrap: wrap; }
.filter-pill {
  padding: 6px 16px; border: 1px solid var(--border); border-radius: 20px;
  background: transparent; color: var(--text-muted); font-family: inherit;
  font-size: 13px; cursor: pointer; transition: all 0.2s;
}
.filter-pill:hover { border-color: var(--text-muted); }
.filter-pill.active { background: var(--accent); color: #000; border-color: var(--accent); }

.legend { display: flex; gap: 20px; padding: 8px 0 16px; font-size: 12px; color: var(--text-muted); }
.legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }

.group-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 0 8px; border-bottom: 1px solid var(--border); margin-top: 24px;
}
.group-header h2 { font-size: 18px; font-weight: 600; }
.group-header .total { font-family: 'JetBrains Mono', monospace; font-size: 18px; font-weight: 600; }

.txn-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  margin: 8px 0; overflow: hidden; transition: border-color 0.2s;
  border-left: 4px solid transparent;
}
.txn-card.approved { border-left-color: var(--green); background: rgba(63, 185, 80, 0.04); }
.txn-card.rejected { border-left-color: var(--red); background: rgba(248, 81, 73, 0.04); }
.txn-card.investigating { border-left-color: var(--orange); background: rgba(210, 153, 34, 0.04); }

.txn-main {
  display: grid; grid-template-columns: 110px 1fr 170px 90px 100px 210px;
  align-items: center; padding: 14px 16px; gap: 14px; font-size: 13px;
}
.txn-date { color: var(--text-muted); font-size: 12px; }
.txn-id { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-muted); }
.txn-merchant { font-weight: 500; }
.txn-location { font-size: 11px; color: var(--text-muted); }
.txn-amount { font-family: 'JetBrains Mono', monospace; font-weight: 600; text-align: right; }
.txn-receipt { text-align: center; font-size: 12px; white-space: nowrap; }

.flag-pill { display: inline-block; font-size: 10px; padding: 2px 6px; border-radius: 3px; margin-left: 4px; font-weight: 500; }
.flag-no_receipt { background: var(--red); color: #fff; }
.flag-out_of_region { background: var(--orange); color: #000; }
.flag-unusual_category { background: var(--purple); color: #fff; }
.flag-high_value { background: var(--blue); color: #000; }

.tier-label { font-size: 10px; padding: 2px 6px; border-radius: 3px; margin-left: 6px; }
.tier-elevated { background: rgba(210, 153, 34, 0.2); color: var(--orange); }
.tier-high { background: rgba(88, 166, 255, 0.2); color: var(--blue); }

.actions { display: flex; gap: 6px; justify-content: flex-end; }

.txn-expand { border-top: 1px solid var(--border); padding: 16px; display: none; }
.txn-card.expanded .txn-expand { display: block; }

.notes-thread { margin-bottom: 12px; }
.note-item { padding: 8px 12px; background: var(--surface-2); border-left: 3px solid var(--border); border-radius: 4px; margin-bottom: 8px; }
.note-item .note-time { font-size: 11px; color: var(--text-muted); }
.note-item .note-text { margin-top: 4px; font-size: 13px; }

.note-input { display: flex; gap: 8px; margin-bottom: 12px; }
.note-input textarea {
  flex: 1; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px; color: var(--text); font-family: inherit;
  font-size: 13px; resize: vertical; min-height: 60px; outline: none;
}
.note-input textarea:focus { border-color: var(--accent); }

.sent-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--green); margin-left: 8px; }

.toast {
  position: fixed; bottom: 24px; right: 24px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; padding: 12px 20px;
  font-size: 13px; z-index: 1000; transform: translateY(100px); opacity: 0;
  transition: all 0.3s;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { border-color: var(--red); }
