@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

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

/* ─── DESIGN TOKENS ──────────────────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg:         #080808;
  --bg-2:       #0e0e0e;
  --surface:    #131313;
  --surface-2:  #181818;

  /* Borders */
  --border:     #1e1e1e;
  --border-2:   #262626;
  --border-3:   #303030;

  /* Text */
  --text:       #f2f2f2;
  --text-2:     #a3a3a3;
  --text-3:     #525252;

  /* Accent — green */
  --green:      #22c55e;
  --green-2:    #16a34a;
  --green-dim:  rgba(34, 197, 94, 0.07);
  --green-dim2: rgba(34, 197, 94, 0.12);
  --green-bdr:  rgba(34, 197, 94, 0.2);
  --green-glow: 0 0 32px rgba(34, 197, 94, 0.12);

  /* Danger */
  --red:        #f87171;
  --red-dim:    rgba(248, 113, 113, 0.08);
  --red-bdr:    rgba(248, 113, 113, 0.25);

  /* Warning */
  --yellow:     #fbbf24;
  --yellow-dim: rgba(251, 191, 36, 0.08);
  --yellow-bdr: rgba(251, 191, 36, 0.2);

  /* Radius */
  --r-sm:   6px;
  --r-md:   10px;
  --r-lg:   14px;
  --r-xl:   20px;
  --r-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.6);

  /* Transitions */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ─── BASE ───────────────────────────────────────────────────────────────── */
html { scroll-behavior: smooth; height: 100%; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }
a  { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ─── TYPOGRAPHY ─────────────────────────────────────────────────────────── */
h1 { font-size: clamp(1.6rem, 4vw, 2.1rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.25rem, 3vw, 1.6rem); font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; }
h3 { font-size: 0.95rem; font-weight: 600; line-height: 1.35; }
p  { color: var(--text-2); line-height: 1.7; }

.green { color: var(--green); }
.muted { color: var(--text-2); }
.dim   { color: var(--text-3); }

.label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--green);
  margin-bottom: 0.5rem;
}

/* ─── NAV ────────────────────────────────────────────────────────────────── */
.rp-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
  height: 60px;
  background: rgba(8, 8, 8, 0.85);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 200;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.rp-logo {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.04em;
}
.rp-logo span { color: var(--green); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ─── BUTTONS ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--r-md);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.18s var(--ease);
  white-space: nowrap;
  letter-spacing: -0.01em;
  line-height: 1;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }

.btn-primary {
  background: var(--green);
  color: #000;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(34,197,94,0.25);
}
.btn-primary:hover { background: #16c553; box-shadow: 0 4px 16px rgba(34,197,94,0.35); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border-2);
}
.btn-ghost:hover { border-color: var(--border-3); color: var(--text); background: var(--surface); }

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid var(--red-bdr);
}
.btn-danger:hover { background: rgba(248,113,113,0.15); }

.btn-sm  { padding: 0.45rem 0.9rem; font-size: 0.8rem; border-radius: var(--r-sm); }
.btn-lg  { padding: 0.8rem 1.75rem; font-size: 1rem; border-radius: var(--r-lg); }
.btn-full { width: 100%; }

/* ─── CARDS ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem;
}
.card-sm { padding: 1rem 1.25rem; }
.card-lg { padding: 2rem 2.25rem; }

/* ─── FORM ELEMENTS ──────────────────────────────────────────────────────── */
.field { margin-bottom: 1.1rem; }

label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 0.4rem;
}

input,
select,
textarea {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  color: var(--text);
  padding: 0.7rem 1rem;
  border-radius: var(--r-md);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
  appearance: none;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(34,197,94,0.1);
}
input::placeholder,
textarea::placeholder { color: var(--text-3); }

/* ─── ALERTS ─────────────────────────────────────────────────────────────── */
.alert {
  padding: 0.7rem 1rem;
  border-radius: var(--r-md);
  font-size: 0.82rem;
  line-height: 1.5;
  margin-bottom: 1rem;
  display: none;
  font-weight: 500;
}
.alert.show { display: block; }
.alert-success { background: var(--green-dim); border: 1px solid var(--green-bdr); color: var(--green); }
.alert-error   { background: var(--red-dim);   border: 1px solid var(--red-bdr);   color: var(--red); }
.alert-warning { background: var(--yellow-dim); border: 1px solid var(--yellow-bdr); color: var(--yellow); }

/* ─── BADGES ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.7rem;
  border-radius: var(--r-full);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.badge-green  { background: var(--green-dim2); border: 1px solid var(--green-bdr);  color: var(--green); }
.badge-red    { background: var(--red-dim);    border: 1px solid var(--red-bdr);    color: var(--red); }
.badge-yellow { background: var(--yellow-dim); border: 1px solid var(--yellow-bdr); color: var(--yellow); }
.badge-dim    { background: var(--surface-2);  border: 1px solid var(--border-2);   color: var(--text-3); }
.badge-purple {
  background: rgba(139,92,246,0.1);
  border: 1px solid rgba(139,92,246,0.25);
  color: #a78bfa;
}

/* ─── TABLE ──────────────────────────────────────────────────────────────── */
.rp-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.rp-table th {
  text-align: left;
  color: var(--text-3);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
}
.rp-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  vertical-align: middle;
}
.rp-table tr:last-child td { border-bottom: none; }
.rp-table tr:hover td { background: var(--surface-2); }
.table-wrap { overflow-x: auto; border-radius: var(--r-lg); }

/* ─── STAT CARDS ─────────────────────────────────────────────────────────── */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.25rem 1.5rem;
}
.stat-icon { font-size: 1.3rem; margin-bottom: 0.75rem; }
.stat-label { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); margin-bottom: 0.5rem; }
.stat-value { font-size: 2rem; font-weight: 800; color: var(--text); line-height: 1; letter-spacing: -0.03em; }
.stat-value.green  { color: var(--green); }
.stat-value.yellow { color: var(--yellow); }
.stat-sub { font-size: 0.72rem; color: var(--text-3); margin-top: 0.3rem; }

/* ─── SPINNER ────────────────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  opacity: 0.7;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── EMPTY STATE ────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
}
.empty-state .es-icon { font-size: 2.25rem; margin-bottom: 0.75rem; opacity: 0.4; }
.empty-state h4 { font-size: 0.95rem; font-weight: 600; color: var(--text-2); margin-bottom: 0.35rem; }
.empty-state p  { font-size: 0.82rem; color: var(--text-3); max-width: 36ch; margin: 0 auto; }

/* ─── DIVIDER ────────────────────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}
.divider-or {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-3);
  font-size: 0.78rem;
  margin: 1.25rem 0;
}
.divider-or::before,
.divider-or::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ─── GRID ───────────────────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ─── PROGRESS BAR ───────────────────────────────────────────────────────── */
.progress-bar { height: 5px; background: var(--border-2); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--green); border-radius: 99px; transition: width 0.5s var(--ease); }

/* ─── SCROLLBAR ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ─── UTILITIES ──────────────────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.mt-1 { margin-top: 0.5rem; }   .mt-2 { margin-top: 1rem; }   .mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.hidden { display: none !important; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

/* ─── MOBILE ─────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .rp-nav { padding: 0 1.25rem; }
}
