@import url('https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300&family=Syne:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #0a0a0f;
  --bg2: #111118;
  --bg3: #1a1a24;
  --border: #2a2a38;
  --text: #e8e8f0;
  --muted: #6b6b80;
  --accent: #7c6af5;
  --accent2: #f0a05a;
  --accent3: #5af0c8;
  --danger: #f05a5a;
  --success: #5af07a;
  --card-shadow: 0 4px 24px rgba(0,0,0,0.4);
  --radius: 12px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Mono', monospace;
  min-height: 100vh;
  line-height: 1.6;
}

/* NAV */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(10,10,15,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 0;
  height: 56px;
}

.nav-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--accent);
  text-decoration: none;
  margin-right: 2rem;
  letter-spacing: -0.02em;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0 1rem;
  height: 56px;
  display: flex;
  align-items: center;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

nav a:hover { color: var(--text); }
nav a.active {
  color: var(--bg);
  background: var(--accent);
  border-bottom-color: transparent;
  border-radius: 6px;
  margin: 0 0.2rem;
  padding: 0 0.9rem;
  height: 32px;
  font-weight: 500;
}

/* MAIN LAYOUT */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 80px 2rem 4rem;
}

/* PAGE HEADER */
.page-header {
  margin-bottom: 2.5rem;
}

.page-header h1 {
  font-family: 'Syne', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.page-header p {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.4rem;
}

/* CARDS */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
}

.card-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

/* BUTTONS */
.btn {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1.1rem;
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.02em;
}

.btn:hover { opacity: 0.85; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--muted); }
.btn-danger { background: var(--danger); }
.btn-success { background: var(--success); color: #0a0a0f; }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.72rem; }

/* INPUTS */
input, textarea, select {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: 'DM Mono', monospace;
  font-size: 0.82rem;
  padding: 0.55rem 0.9rem;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
select option { background: var(--bg3); }

.form-row {
  display: grid;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 0.3rem;
}

/* TAGS / BADGES */
.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 20px;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
}
.badge-purple { background: rgba(124,106,245,0.2); color: var(--accent); }
.badge-orange { background: rgba(240,160,90,0.2); color: var(--accent2); }
.badge-green  { background: rgba(90,240,122,0.15); color: var(--success); }
.badge-red    { background: rgba(240,90,90,0.15); color: var(--danger); }
.badge-cyan   { background: rgba(90,240,200,0.15); color: var(--accent3); }
.badge-muted  { background: var(--bg3); color: var(--muted); }

/* TABLES */
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 0 0.8rem 0.8rem;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 0.8rem;
  font-size: 0.82rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

/* PROGRESS BAR */
.progress-bar {
  height: 6px;
  background: var(--bg3);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.4s ease;
}

/* STAT GRID */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
}

.stat-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.stat-value {
  font-family: 'Syne', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

/* EMPTY STATE */
.empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
  font-size: 0.82rem;
}

/* MODAL */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.modal h2 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}
.modal-actions {
  display: flex;
  gap: 0.8rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

/* ANIMATIONS */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.4s ease forwards; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* RESPONSIVE */
@media (max-width: 700px) {
  nav { padding: 0 1rem; gap: 0; overflow-x: auto; }
  nav a { padding: 0 0.6rem; font-size: 0.65rem; }
  main { padding: 72px 1rem 3rem; }
  .form-row.cols-2, .form-row.cols-3 { grid-template-columns: 1fr; }
}

/* SYNC BAR */
.sync-bar {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 0.4rem 1rem;
  font-size: 0.72rem;
  z-index: 50;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

#sync-status {
  font-size: 0.72rem;
  min-width: 60px;
}

.nav-logout {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--muted);
  cursor: pointer;
  padding: 0 0.8rem;
  height: 56px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}
.nav-logout:hover { color: var(--danger); }
