/* ── MUTINY Staff Hub — shared theme & shell ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0f1117;
  --sidebar-bg: #151821;
  --surface: #1a1f2e;
  --surface-2: #1f2535;
  --surface-3: #252b3b;
  --border: rgba(255,255,255,0.06);
  --border-hover: rgba(255,255,255,0.12);
  --text: #e8eaf0;
  --muted: #6b7280;
  --accent: #00b4d8;
  --accent-dim: rgba(0,180,216,0.12);
  --green: #10b981;
  --green-dim: rgba(16,185,129,0.12);
  --purple: #8b5cf6;
  --purple-dim: rgba(139,92,246,0.12);
  --amber: #f59e0b;
  --amber-dim: rgba(245,158,11,0.12);
  --red: #ef4444;
  --sidebar-w: 220px;
}
html { scroll-behavior: smooth; }

/* ── Scrollbars ── */
* { scrollbar-width: thin; scrollbar-color: #2c3447 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2c3447; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #3a4459; }
::-webkit-scrollbar-corner { background: transparent; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  min-height: 100vh;
  display: flex;
}

/* ── Permanent Sidebar ── */
.sidebar {
  position: fixed; top: 0; left: 0;
  width: var(--sidebar-w); height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 100;
}
.sidebar-brand {
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-brand img { height: 36px; width: auto; border-radius: 8px; }
.sidebar-collapse { margin-left: auto; background: none; border: none; cursor: pointer; color: var(--muted); display: flex; padding: 4px; border-radius: 6px; }
.sidebar-collapse:hover { color: var(--text); background: var(--surface-2); }
.sidebar-collapse svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-reopen { position: fixed; top: 14px; left: 14px; z-index: 300; display: none; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px; background: var(--sidebar-bg); border: 1px solid var(--border); color: var(--muted); cursor: pointer; }
.sidebar-reopen:hover { color: var(--text); border-color: var(--border-hover); }
.sidebar-reopen svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
body.sidebar-collapsed .sidebar-reopen { display: flex; }
.sidebar-brand-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 16px; letter-spacing: 0.06em; color: var(--text); line-height: 1.1;
}
.sidebar-brand-name span { color: var(--accent); }
.sidebar-brand-sub { font-size: 10px; color: var(--muted); letter-spacing: 0.04em; }

.sidebar-nav { padding: 12px 10px; flex: 1; overflow-y: auto; }
.sidebar-nav-label { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding: 8px 8px 4px; }
.sidebar-sep { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 12px 0 4px; padding: 12px 8px 4px; border-top: 1px solid var(--border); }

.sidebar-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 8px;
  text-decoration: none; color: var(--muted);
  font-size: 13px; margin-bottom: 2px;
  transition: background 0.15s, color 0.15s;
  cursor: pointer; border: none; background: none; width: 100%; text-align: left;
}
.sidebar-nav-item:hover { background: var(--surface-2); color: var(--text); }
.sidebar-nav-item.active { background: var(--surface-2); color: var(--accent); }
.sidebar-nav-item svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.nav-badge { margin-left: auto; background: var(--red); color: #fff; border-radius: 99px; font-size: 10px; font-weight: 600; padding: 1px 7px; line-height: 1.4; }

/* User profile at bottom */
.sidebar-user {
  border-top: 1px solid var(--border);
  padding: 12px 14px;
  display: flex; align-items: center; gap: 10px;
}
.sidebar-user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface-2); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--muted); overflow: hidden;
}
.sidebar-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 12px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 10px; color: var(--muted); }
.sidebar-logout {
  width: 26px; height: 26px; border-radius: 6px;
  background: none; border: 1px solid var(--border);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--muted); transition: color 0.15s, border-color 0.15s; flex-shrink: 0;
}
.sidebar-logout:hover { color: var(--red); border-color: rgba(239,68,68,0.3); }
.sidebar-logout svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Online indicator */
.online-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); display: inline-block; margin-right: 5px; }

/* ── Main content ── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1; position: relative; z-index: 1;
  padding: 32px 32px 60px;
  min-height: 100vh;
  transition: margin-left 0.2s ease;
}
.sidebar { transition: transform 0.2s ease; }
body.sidebar-collapsed .sidebar { transform: translateX(-100%); }
body.sidebar-collapsed .main { margin-left: 0; }

header { padding-bottom: 24px; border-bottom: 1px solid var(--border); margin-bottom: 28px; }
header img { max-width: 240px; width: 100%; height: auto; margin-bottom: 12px; display: block; }
h1 { font-family: 'Bebas Neue', sans-serif; font-size: clamp(32px,4vw,48px); letter-spacing: 0.02em; line-height: 1; color: var(--text); }
h1 span { color: var(--accent); }
.header-sub { font-size: 13px; color: var(--muted); margin-top: 6px; }

.section-label { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; }

/* ── Empty-state placeholder for not-yet-built tabs ── */
.page-content { animation: fadeUp 0.4s ease both; }
.page-placeholder {
  background: var(--surface); border: 1px dashed var(--border-hover); border-radius: 12px;
  padding: 64px 40px; text-align: center;
}
.page-placeholder svg { width: 40px; height: 40px; stroke: var(--muted); fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 16px; opacity: 0.6; }
.page-placeholder-title { font-family: 'Bebas Neue', sans-serif; font-size: 22px; letter-spacing: 0.04em; color: var(--text); margin-bottom: 6px; }
.page-placeholder-text { font-size: 13px; color: var(--muted); }

footer { border-top: 1px solid var(--border); padding: 20px 0; display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 40px; flex-wrap: wrap; gap: 8px; }

@keyframes fadeUp { from{opacity:0;transform:translateY(12px)} to{opacity:1;transform:translateY(0)} }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.4;transform:scale(0.7)} }

/* ── Shared dialog (replaces native confirm/alert/prompt) ── */
.hub-modal-back { position: fixed; inset: 0; background: rgba(0,0,0,0.62); z-index: 9999; display: none; align-items: center; justify-content: center; padding: 20px; }
.hub-modal-back.open { display: flex; animation: fadeUp 0.15s ease; }
.hub-modal { background: var(--surface); border: 1px solid var(--border-hover); border-radius: 14px; padding: 24px 26px; width: 400px; max-width: 100%; box-shadow: 0 24px 60px rgba(0,0,0,0.5); }
.hub-modal-msg { font-size: 14px; color: var(--text); line-height: 1.6; margin-bottom: 18px; white-space: pre-wrap; }
.hub-modal-input { width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; color: var(--text); font-family: 'DM Sans', sans-serif; font-size: 13px; outline: none; margin-bottom: 18px; }
.hub-modal-input:focus { border-color: var(--accent); }
.hub-modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
.hub-btn { border-radius: 8px; padding: 9px 18px; font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 500; cursor: pointer; border: 1px solid transparent; }
.hub-btn-cancel { background: rgba(255,255,255,0.05); border-color: var(--border); color: var(--muted); }
.hub-btn-cancel:hover { background: var(--surface-2); color: var(--text); }
.hub-btn-ok { background: var(--accent-dim); border-color: rgba(0,180,216,0.3); color: var(--accent); }
.hub-btn-ok:hover { background: rgba(0,180,216,0.2); }
.hub-btn-ok.danger { background: rgba(239,68,68,0.12); border-color: rgba(239,68,68,0.3); color: var(--red); }
.hub-btn-ok.danger:hover { background: rgba(239,68,68,0.2); }

/* Any wide table can scroll horizontally instead of breaking the layout. */
.table-wrap { max-width: 100%; overflow-x: auto; }

/* "Copied!" indicator shown when a Steam ID is clicked. */
.copy-toast {
  position: fixed; z-index: 10000; transform: translate(-50%, -100%);
  background: var(--accent); color: #06212a; font-family: 'DM Sans', sans-serif;
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 6px;
  pointer-events: none; opacity: 0; transition: opacity .15s, transform .15s; white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}
.copy-toast.show { opacity: 1; transform: translate(-50%, -130%); }

/* Backdrop shown behind the sidebar when it overlays on small screens. */
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 90; }

/* ── Responsive scaling ── */
@media (max-width: 1200px) {
  .main { padding: 28px 26px 56px; }
}
@media (max-width: 1024px) {
  :root { --sidebar-w: 200px; }
  .main { padding: 24px 20px 50px; }
}
@media (max-width: 768px) {
  /* Sidebar overlays the content; content uses the full width. */
  .main { margin-left: 0; padding: 16px 14px 40px; }
  .sidebar { box-shadow: 8px 0 40px rgba(0,0,0,0.55); }
  .sidebar-reopen { display: flex; }                          /* hamburger always available */
  body:not(.sidebar-collapsed) .sidebar-reopen { display: none; }
  body:not(.sidebar-collapsed) .sidebar-backdrop { display: block; }
  header img { max-width: 180px; }
  footer { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 480px) {
  .main { padding: 14px 11px 36px; }
}
