:root {
  --gold: #d4a843;
  --gold-dim: #b8922e;
  --bg: #0f1419;
  --bg2: #1a2030;
  --bg3: #232d3f;
  --text: #e8e6e3;
  --text-dim: #9ca3af;
  --red: #ef4444;
  --green: #22c55e;
  --blue: #3b82f6;
  --orange: #f59e0b;
  --purple: #a855f7;
  --nav-h: 56px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--text); }

/* ─── Navigation ─── */
.portal-nav {
  background: linear-gradient(135deg, var(--bg2), var(--bg3));
  border-bottom: 2px solid var(--gold-dim);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
  position: sticky;
  top: 0;
  z-index: 200;
}
.nav-logo {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 1px;
  white-space: nowrap;
}
.nav-links { display: flex; gap: 0; align-items: center; }
.nav-links a {
  padding: .9rem 1.2rem;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-dim);
  transition: all .15s;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--text); background: rgba(255,255,255,.03); }
.nav-links a.active { color: var(--gold); border-bottom-color: var(--gold); }
.lang-btn {
  background: transparent; border: 1px solid var(--gold-dim); color: var(--gold);
  padding: .3rem .6rem; border-radius: 4px; font-size: .75rem; font-weight: 700;
  cursor: pointer; letter-spacing: .5px; margin-left: .5rem; transition: all .15s;
}
.lang-btn:hover { background: var(--gold); color: var(--bg); }

.hamburger {
  display: none;
  background: none; border: none; cursor: pointer; padding: .4rem;
  flex-direction: column; gap: 5px;
}
.hamburger span {
  display: block; width: 22px; height: 2px; background: var(--gold);
  border-radius: 2px; transition: all .2s;
}

/* ─── Breadcrumbs ─── */
.breadcrumbs {
  max-width: 1100px; margin: 0 auto; padding: .6rem 1rem 0;
  font-size: .78rem; color: var(--text-dim); display: flex; align-items: center; gap: .3rem;
}
.breadcrumbs a { color: var(--text-dim); }
.breadcrumbs a:hover { color: var(--gold); }
.breadcrumbs .sep { opacity: .4; }
.breadcrumbs .current { color: var(--gold); font-weight: 600; }

/* ─── Layout ─── */
.container { max-width: 1100px; margin: 0 auto; padding: 2rem 1rem; }
.page-content { flex: 1; }
.page-title { font-size: 1.6rem; color: var(--gold); margin-bottom: .4rem; }
.page-subtitle { color: var(--text-dim); font-size: .9rem; margin-bottom: 2rem; }

/* ─── Cards ─── */
.card {
  background: var(--bg2);
  border: 1px solid var(--bg3);
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: border-color .15s;
}
.card h2 {
  color: var(--gold);
  font-size: 1.1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--bg3);
  padding-bottom: .5rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.card h2 .badge {
  font-size: .7rem;
  background: var(--bg3);
  color: var(--text-dim);
  padding: .15rem .5rem;
  border-radius: 4px;
  font-weight: 400;
}

/* ─── Buttons ─── */
.btn {
  display: inline-block;
  background: var(--gold);
  color: var(--bg);
  font-weight: 700;
  padding: .65rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: .9rem;
  cursor: pointer;
  transition: background .2s, transform .1s;
}
.btn:hover { background: var(--gold-dim); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-secondary {
  background: var(--bg3);
  color: var(--text);
  border: 1px solid rgba(255,255,255,.1);
}
.btn-secondary:hover { background: rgba(255,255,255,.1); }

/* ─── Forms ─── */
.input {
  background: var(--bg3);
  border: 1px solid rgba(255,255,255,.1);
  color: var(--text);
  padding: .65rem 1rem;
  border-radius: 8px;
  font-size: .9rem;
  width: 100%;
  outline: none;
  transition: border-color .15s;
}
.input:focus { border-color: var(--gold); }
.input::placeholder { color: var(--text-dim); }

/* ─── Tabs ─── */
.tabs { display: flex; gap: .4rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tab {
  padding: .4rem .75rem;
  border-radius: 6px;
  font-size: .8rem;
  cursor: pointer;
  background: var(--bg3);
  color: var(--text-dim);
  border: 1px solid transparent;
  transition: all .15s;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--gold); color: var(--bg); }

/* ─── Loader ─── */
.loader { display: none; text-align: center; padding: 3rem; }
.loader.active { display: block; }
.spinner {
  width: 48px; height: 48px;
  border: 4px solid var(--bg3);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader p { color: var(--text-dim); }

/* ─── Empty State ─── */
.empty-state {
  text-align: center; padding: 3rem 1rem;
  color: var(--text-dim); font-size: .9rem;
}
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: .75rem; opacity: .5; }

/* ─── Error State ─── */
.error-state {
  text-align: center; padding: 2rem 1rem;
  color: var(--red); font-size: .9rem;
  background: rgba(239,68,68,.05); border: 1px solid rgba(239,68,68,.15);
  border-radius: 10px;
}

/* ─── Tags ─── */
.tag {
  display: inline-block;
  padding: .15rem .5rem;
  border-radius: 4px;
  font-size: .7rem;
  font-weight: 600;
  background: rgba(212,168,67,.15);
  color: var(--gold);
}
.tag-blue { background: rgba(59,130,246,.15); color: var(--blue); }
.tag-green { background: rgba(34,197,94,.15); color: var(--green); }
.tag-red { background: rgba(239,68,68,.15); color: var(--red); }
.tag-purple { background: rgba(168,85,247,.15); color: var(--purple); }

/* ─── Table ─── */
.stat-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.stat-table th {
  text-align: left;
  color: var(--text-dim);
  font-weight: 600;
  padding: .4rem .5rem;
  border-bottom: 1px solid var(--bg3);
  font-size: .7rem;
  text-transform: uppercase;
}
.stat-table td { padding: .4rem .5rem; border-bottom: 1px solid rgba(255,255,255,.03); }
.stat-table tr:hover { background: rgba(255,255,255,.02); }

/* ─── Footer ─── */
.site-footer {
  background: var(--bg2);
  border-top: 1px solid var(--bg3);
  padding: 1.5rem 1rem;
  margin-top: auto;
}
.footer-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem;
}
.footer-brand { font-size: .8rem; color: var(--text-dim); }
.footer-brand strong { color: var(--gold); font-weight: 700; }
.footer-links { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.footer-links a {
  font-size: .78rem; color: var(--text-dim); transition: color .15s;
}
.footer-links a:hover { color: var(--gold); }
.footer-support {
  display: flex; align-items: center; justify-content: center; gap: .6rem;
  width: 100%; margin-top: .6rem; padding-top: .6rem;
  border-top: 1px solid rgba(255,255,255,.05);
}
.footer-support span { font-size: .78rem; color: var(--text-dim); }
.kofi-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .4rem .85rem; border-radius: 6px;
  background: rgba(255,97,85,.1); border: 1px solid rgba(255,97,85,.25);
  color: #ff6155; font-size: .78rem; font-weight: 700;
  transition: all .15s; text-decoration: none;
}
.kofi-btn:hover { background: rgba(255,97,85,.18); border-color: rgba(255,97,85,.45); color: #ff6155; }
.kofi-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.footer-note { font-size: .7rem; color: rgba(255,255,255,.25); width: 100%; text-align: center; margin-top: .5rem; }

/* ─── Mobile Nav Overlay ─── */
.nav-overlay {
  display: none; position: fixed; inset: 0; z-index: 150;
  background: rgba(0,0,0,.6); backdrop-filter: blur(2px);
}
.nav-overlay.open { display: block; }
.nav-drawer {
  position: fixed; top: 0; right: 0; width: 260px; height: 100%;
  background: var(--bg2); border-left: 2px solid var(--gold-dim);
  z-index: 151; padding: 1.5rem; display: flex; flex-direction: column; gap: .5rem;
  transform: translateX(100%); transition: transform .25s ease;
}
.nav-overlay.open .nav-drawer { transform: translateX(0); }
.nav-drawer a {
  display: block; padding: .8rem .5rem; font-size: .95rem; color: var(--text-dim);
  border-bottom: 1px solid rgba(255,255,255,.05); font-weight: 600;
}
.nav-drawer a:hover { color: var(--gold); }
.nav-drawer a.active { color: var(--gold); }
.drawer-close {
  background: none; border: none; color: var(--text-dim); font-size: 1.3rem;
  cursor: pointer; align-self: flex-end; margin-bottom: .5rem; padding: .25rem .5rem;
}
.drawer-close:hover { color: var(--gold); }

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .portal-nav { padding: 0 .75rem; }
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .container { padding: 1.5rem .75rem; }
  .breadcrumbs { padding: .5rem .75rem 0; }
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-links { justify-content: center; }
}
