/* ============================================================
   Swayn Admin — Shared Styles
   Extracted from duplicated CSS across all admin pages.
   Every page links this as: <link rel="stylesheet" href="shared.css" />
   ============================================================ */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Body ── */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #0d0d0d;
  color: #e0e0e0;
  min-height: 100vh;
}

/* ── Nav ── */
.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 10px 16px;
  background: #111;
  border-bottom: 1px solid #222;
  overflow: visible;
  white-space: nowrap;
  position: relative;
  z-index: 1000;
}
.nav-brand {
  font-size: 15px;
  font-weight: 800;
  color: #6366f1;
  letter-spacing: -0.5px;
  margin-right: 12px;
  text-decoration: none;
}
.nav-section {
  position: relative;
  display: inline-flex;
}
.nav-section-btn {
  background: none;
  border: none;
  color: #888;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s, color .15s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.nav-section-btn:hover,
.nav-section.open .nav-section-btn,
.nav-section-btn.has-active {
  background: #1e1e1e;
  color: #e0e0e0;
}
.nav-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 6px;
  min-width: 200px;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
.nav-section.open .nav-dropdown {
  display: block;
}
.nav-dropdown a {
  display: block;
  color: #aaa;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 6px;
  transition: background .12s, color .12s;
}
.nav-dropdown a:hover {
  background: #252525;
  color: #e0e0e0;
}
.nav-dropdown a.active {
  background: #6366f1;
  color: #fff;
}
.nav-sep {
  width: 1px;
  height: 20px;
  background: #2a2a2a;
  margin: 0 6px;
  flex-shrink: 0;
}
.nav-role-picker {
  background: #1a1a1a;
  color: #f59e0b;
  border: 1px solid #333;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  margin-left: auto;
  cursor: pointer;
  font-family: inherit;
}
.nav-role-picker:focus { outline: none; border-color: #f59e0b; }
.nav-signout {
  background: none;
  border: none;
  color: #555;
  font-size: 12px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
}
.nav-signout:hover {
  background: #1e1e1e;
  color: #e0e0e0;
}
.nav-badge {
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 8px;
  margin-left: 4px;
  vertical-align: top;
  display: inline-block;
  min-width: 14px;
  text-align: center;
}
.nav-badge.warn {
  background: #f59e0b;
  color: #000;
}

/* ── Login ── */
.login {
  max-width: 400px;
  margin: 80px auto;
  background: #1a1a1a;
  border-radius: 16px;
  padding: 32px;
  border: 1px solid #2a2a2a;
}
.login h2 { font-size: 18px; margin-bottom: 20px; }
.login input {
  width: 100%;
  background: #111;
  color: #e0e0e0;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  margin-bottom: 12px;
  font-family: inherit;
}
.login button {
  width: 100%;
  background: #6366f1;
  color: #fff;
  padding: 10px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.remember-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #aaa;
  margin-bottom: 14px;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}
.remember-row input[type="checkbox"] {
  accent-color: #6366f1;
  width: 16px;
  height: 16px;
  cursor: pointer;
}
.err { color: #ef4444; font-size: 13px; margin-top: 8px; }

/* ── Shared page layout ── */
.page {
  padding: 24px;
  max-width: 1200px;
  margin: 0 auto;
}
h1 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.subtitle { color: #777; font-size: 13px; margin-bottom: 24px; }

/* ── Shared components ── */
.badge {
  display: inline-block;
  background: #f97316;
  color: #000;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  padding: 1px 7px;
  margin-left: 8px;
  vertical-align: middle;
}

/* ── Modal ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: #1a1a1a;
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 440px;
  border: 1px solid #333;
}
.modal-box h2 { font-size: 16px; margin-bottom: 12px; }

/* ── Shared form elements ── */
select, textarea {
  width: 100%;
  background: #111;
  color: #e0e0e0;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 10px;
  font-size: 13px;
  margin-bottom: 12px;
  font-family: inherit;
  resize: vertical;
}

/* ── Status indicators ── */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}
.status-dot.green  { background: #22c55e; }
.status-dot.amber  { background: #f59e0b; }
.status-dot.red    { background: #ef4444; }
.status-dot.grey   { background: #555; }

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid #222;
  padding-bottom: 8px;
}
.tab-btn {
  background: none;
  border: none;
  color: #888;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.tab-btn:hover { background: #1e1e1e; color: #e0e0e0; }
.tab-btn.active { background: #6366f1; color: #fff; }

/* ── Table ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  text-align: left;
  padding: 8px 12px;
  color: #888;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #2a2a2a;
}
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #1a1a1a;
  vertical-align: top;
}
.data-table tr:hover td {
  background: #151515;
}

/* ── Cards ── */
.card {
  background: #1a1a1a;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #2a2a2a;
}

/* ── Action buttons ── */
.btn {
  padding: 6px 14px;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s;
}
.btn:hover { opacity: .85; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-approve { background: #22c55e; color: #000; }
.btn-reject  { background: #ef4444; color: #fff; }
.btn-warn    { background: #f59e0b; color: #000; }
.btn-muted   { background: #333; color: #e0e0e0; }
.btn-primary { background: #6366f1; color: #fff; }

/* ── Utility ── */
.text-muted { color: #888; }
.text-dim   { color: #555; }
.text-sm    { font-size: 12px; }
.text-xs    { font-size: 11px; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.hidden { display: none !important; }
.flex { display: flex; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.items-center { align-items: center; }
.justify-end { justify-content: flex-end; }
.flex-wrap { flex-wrap: wrap; }
.empty { color: #555; font-size: 14px; padding: 40px 0; text-align: center; }

/* ── Realtime indicators ─────────────────────────────── */
.rt-fade-out { transition: opacity 0.4s ease, transform 0.4s ease; opacity: 0; transform: scale(0.95); pointer-events: none; }
.rt-highlight { animation: rt-pulse 2s ease; }
@keyframes rt-pulse { 0% { background: #1a2a1a; } 100% { background: transparent; } }
.conflict-banner { background: #451a03; border: 1px solid #92400e; color: #fbbf24; padding: 10px 16px; border-radius: 8px; margin-bottom: 12px; font-size: 13px; display: flex; align-items: center; gap: 12px; }
.claim-badge { font-size: 10px; color: #f59e0b; font-weight: 700; }
.rt-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-left: 8px; vertical-align: middle; }
.rt-dot.connected { background: #22c55e; }
.rt-dot.disconnected { background: #ef4444; }
