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

:root {
  --bg: #0b1120;
  --bg2: #111b2e;
  --bg3: #182340;
  --bg4: #1e2d50;
  --accent: #22c55e;
  --accent2: #16a34a;
  --accent-dim: rgba(34,197,94,0.12);
  --danger: #ef4444;
  --danger-dim: rgba(239,68,68,0.12);
  --warn: #f59e0b;
  --warn-dim: rgba(245,158,11,0.12);
  --info: #3b82f6;
  --info-dim: rgba(59,130,246,0.12);
  --text: #e2e8f0;
  --text2: #94a3b8;
  --text3: #64748b;
  --border: #1e293b;
  --border2: #334155;
  --radius: 10px;
  --shadow: 0 4px 24px rgba(0,0,0,0.25);
}

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

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.wrap { max-width: 960px; margin: 0 auto; padding: 1.5rem; }

/* Navbar */
.navbar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar .logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar .logo span { color: var(--accent); }

.navbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
}

.navbar-right .balance {
  background: var(--accent-dim);
  color: var(--accent);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.82rem;
}

.navbar-right .user-name {
  color: var(--text2);
}

.navbar-right a {
  color: var(--text2);
  font-size: 0.85rem;
}

/* Cards */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.card-header {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Forms */
.form-group { margin-bottom: 1rem; }

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-control {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-control:focus { border-color: var(--accent); }

textarea.form-control { resize: vertical; min-height: 80px; }

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
}

.btn-primary:hover { box-shadow: 0 4px 20px rgba(34,197,94,0.3); transform: translateY(-1px); text-decoration:none; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { box-shadow: 0 4px 20px rgba(239,68,68,0.3); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--text2);
}

.btn-outline:hover { border-color: var(--accent); color: var(--accent); text-decoration:none; }

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Tables */
.table-wrap { overflow-x: auto; }

table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

table.tbl th, table.tbl td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

table.tbl th {
  color: var(--text3);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

table.tbl tr:hover td { background: var(--bg3); }

/* Tags */
.tag {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.tag-success { background: var(--accent-dim); color: var(--accent); }
.tag-danger { background: var(--danger-dim); color: var(--danger); }
.tag-warn { background: var(--warn-dim); color: var(--warn); }
.tag-info { background: var(--info-dim); color: var(--info); }

/* Alert */
.alert {
  padding: 0.8rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.88rem;
}

.alert-success { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(34,197,94,0.2); }
.alert-danger { background: var(--danger-dim); color: #fca5a5; border: 1px solid rgba(239,68,68,0.2); }
.alert-info { background: var(--info-dim); color: #93c5fd; border: 1px solid rgba(59,130,246,0.2); }

/* Score circle */
.score-wrap { display: flex; justify-content: center; margin: 1.5rem 0; }

.score-circle {
  width: 140px; height: 140px;
  position: relative;
}

.score-circle svg {
  transform: rotate(-90deg);
  width: 140px; height: 140px;
}

.score-circle .bg-ring { fill: none; stroke: var(--border); stroke-width: 8; }

.score-circle .fg-ring {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 377;
  transition: stroke-dashoffset 1s ease;
}

.score-val {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.score-val .num { font-size: 2rem; font-weight: 700; line-height: 1; }
.score-val .lbl { font-size: 0.65rem; color: var(--text3); text-transform: uppercase; letter-spacing: 0.1em; margin-top: 0.2rem; }

/* Metrics */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.metric {
  background: var(--bg3);
  border-radius: 8px;
  padding: 1rem;
}

.metric .m-label { font-size: 0.72rem; color: var(--text3); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.4rem; }
.metric .m-val { font-size: 1.3rem; font-weight: 700; }
.metric .m-bar { height: 3px; background: var(--border); border-radius: 2px; margin-top: 0.6rem; overflow: hidden; }
.metric .m-bar-fill { height: 100%; border-radius: 2px; }

/* Upload area */
.upload-zone {
  border: 2px dashed var(--border2);
  border-radius: 12px;
  padding: 2.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
}

.upload-zone:hover, .upload-zone.drag { border-color: var(--accent); background: var(--accent-dim); }
.upload-zone .icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.upload-zone h3 { font-size: 1rem; margin-bottom: 0.3rem; }
.upload-zone p { color: var(--text3); font-size: 0.85rem; }

/* Report sections */
.rsection {
  background: var(--bg3);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.rsection-head {
  padding: 0.8rem 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 0.9rem;
}

.rsection-head:hover { background: var(--bg4); }

.rsection-body {
  padding: 0 1rem 1rem;
  display: none;
  font-size: 0.88rem;
  color: var(--text2);
  line-height: 1.7;
}

.rsection.open .rsection-body { display: block; }

/* Auth pages */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.auth-box {
  width: 100%;
  max-width: 400px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem;
}

.auth-box .logo-big {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.auth-box .logo-big span { color: var(--accent); }

/* Grid helpers */
.row { display: flex; gap: 1rem; flex-wrap: wrap; }
.col { flex: 1; min-width: 0; }

/* Responsive */
@media (max-width: 640px) {
  .wrap { padding: 1rem; }
  .navbar { padding: 0 1rem; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .row { flex-direction: column; }
}

/* Tabs */
.tabs { display: flex; gap: 0.25rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.tab {
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text3);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.tab:hover, .tab.active { color: var(--accent); border-bottom-color: var(--accent); text-decoration: none; }

/* Payment info box */
.pay-info {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 1rem;
  white-space: pre-line;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--text2);
}

/* Progress */
.progress-bar {
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin: 1rem 0;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #34d399);
  border-radius: 3px;
  transition: width 0.5s;
}

/* Misc */
.text-center { text-align: center; }
.text-muted { color: var(--text3); }
.text-sm { font-size: 0.82rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.gap-sm { gap: 0.5rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
