/* ═══════════════════════════════════════════════════
   SPAIRALLY B2B — Unified with bella/styles.css
   Palette · Typography · Animations · Cards
   BLACK & WHITE THEME
═══════════════════════════════════════════════════ */

/* ── CSS Variables — Black & White Theme ── */
:root {
  --bg:          #000000;
  --bg-1:        #0a0a0a;
  --bg-2:        #111111;
  --bg-3:        #1a1a1a;
  --bg-hover:    #222222;

  /* bella canonical names */
  --text:        #ffffff;
  --text-muted:  #a0a0a0;

  /* fine-grained text scale used in the app */
  --text-1:      #ededed;
  --text-2:      #a1a1aa;
  --text-3:      #71717a;

  --border:      #2a2a2a;
  --border-2:    #333333;

  --accent:      #ffffff;
  --accent-dim:  rgba(255,255,255,0.08);
  --accent-glow: rgba(255,255,255,0.04);

  /* Monochrome status colours */
  --blue:        #ffffff;
  --blue-dim:    rgba(255,255,255,0.1);
  --green:       #ffffff;
  --green-dim:   rgba(255,255,255,0.1);
  --red:         #ffffff;
  --red-dim:     rgba(255,255,255,0.1);
  --purple:      #ffffff;
  --purple-dim:  rgba(255,255,255,0.1);
  --amber:       #ffffff;
  --amber-dim:   rgba(255,255,255,0.1);

  --radius:      8px;
  --radius-lg:   12px;

  --sidebar-w:   240px;
  --topbar-h:    56px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }

body {
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-1);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

a      { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select { font-family: inherit; }

/* ── Grain texture — from bella/styles.css ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.03;
  z-index: 9999;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

/* ── Animations — from bella/styles.css ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0);    }
}
@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}
@keyframes float {
  0%, 100% { transform: translateY(0)     scale(1);    }
  50%       { transform: translateY(-16px) scale(1.04); }
}
@keyframes spin      { to { transform: rotate(360deg); } }
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ══════════════════════════════════════════════════
   AUTH SCREEN
══════════════════════════════════════════════════ */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: var(--bg);
  animation: fadeInUp 0.7s ease-out;
}

/* Radial glow — mirrors bella's .hero-bg */
.auth-bg-grid {
  position: absolute;
  inset: 0;
  opacity: 0.04;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 50%, rgba(255,255,255,0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255,255,255,0.10) 0%, transparent 50%);
  animation: float 20s ease-in-out infinite;
}

.auth-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 0 1.5rem;
}

/* ── Brand logo — same structure as bella/index.html ── */
.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 2.5rem;
}

.app-logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.app-logo-sm {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

.logo-sep {
  color: var(--text-muted);
  opacity: 0.9;
  font-weight: 600;
  margin: 0 0.1rem;
}

.brand-name {
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-1);
  letter-spacing: -0.02em;
}

/* ── Auth tabs ── */
.auth-tabs {
  display: flex;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px;
  margin-bottom: 1.5rem;
}

.auth-tab {
  flex: 1;
  padding: 8px 16px;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-2);
  transition: all 0.15s ease;
}
.auth-tab.active {
  background: var(--bg-3);
  color: var(--text-1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* ── Auth form — bella's .preorder-form card ── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  position: relative;
  overflow: hidden;
}

/* Top accent line — mirrors bella's .feature-card::before */
.auth-form::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--text), var(--text-muted));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}
.auth-form:focus-within::before { transform: scaleX(1); }

.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-2);
  letter-spacing: 0.01em;
}

.input-wrapper { position: relative; }

.input-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  width: 15px; height: 15px;
  color: var(--text-3);
  pointer-events: none;
}

/* ── Form inputs — bella focus style ── */
.form-input {
  width: 100%;
  padding: 10px 12px 10px 36px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-1);
  font-size: 0.875rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}
.form-input::placeholder { color: var(--text-3); }
.form-input:focus {
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.1);
}

.form-error {
  font-size: 0.8rem;
  color: var(--red);
  background: var(--red-dim);
  border: 1px solid rgba(239,68,68,0.25);
  padding: 8px 12px;
  border-radius: var(--radius);
}

/* ── Buttons — bella style ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--text);
  color: var(--bg);
  border: 1px solid var(--text);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  transition: all 0.3s ease;
  cursor: pointer;
}
.btn-primary:hover {
  background: var(--text-muted);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(255,255,255,0.15);
}
.btn-primary:active { transform: scale(0.98); }
.btn-full { width: 100%; margin-top: 4px; }

.btn-spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(0,0,0,0.3);
  border-top-color: var(--bg);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.auth-footer {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-3);
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.auth-footer-link {
  color: var(--text-3);
  border-bottom: none;
  padding-bottom: 0;
  transition: color 0.2s ease;
}
.auth-footer-link:hover {
  color: var(--text-1);
  background: none;
  padding: 0;
  transform: none;
}

.auth-footer-sep {
  color: var(--border-2);
}

.auth-consent {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-3);
  margin-top: 0.85rem;
  line-height: 1.6;
}

.auth-consent-link {
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
  padding-bottom: 1px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.auth-consent-link:hover {
  color: var(--text-1);
  border-color: var(--text-1);
  background: none;
  padding: 0 0 1px;
  transform: none;
}

/* ══════════════════════════════════════════════════
   APP LAYOUT
══════════════════════════════════════════════════ */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform 0.25s ease;
  z-index: 100;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  height: var(--topbar-h);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-brand {
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-1);
  flex: 1;
  letter-spacing: -0.01em;
}

.logo-sep-sm {
  color: var(--text-muted);
  font-weight: 600;
  opacity: 0.7;
}

.sidebar-close {
  display: none;
  color: var(--text-3);
  padding: 4px;
  border-radius: var(--radius);
}
.sidebar-close i { width: 16px; height: 16px; }

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

/* Explicit overrides — prevents bella's global a:hover from breaking nav */
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-2);
  transition: background 0.12s, color 0.12s;
  position: relative;
  border-bottom: none;
}
.nav-item:hover,
.nav-item:focus {
  background: var(--bg-hover);
  color: var(--text-1);
  padding: 8px 12px;
  transform: none;
  border-radius: var(--radius);
}
.nav-item.active {
  background: var(--accent-dim);
  color: var(--text-1);
}

.nav-icon { width: 16px; height: 16px; flex-shrink: 0; }

.nav-badge {
  margin-left: auto;
  background: #ffffff;
  color: #000000;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
  min-width: 18px;
  text-align: center;
  display: none;
}
.nav-badge.show { display: inline-block; }

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 12px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-user { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }

.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #ffffff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; color: #000000; flex-shrink: 0;
}
.user-avatar.xs { width: 26px; height: 26px; font-size: 0.7rem; }

.user-info { display: flex; flex-direction: column; min-width: 0; }

.user-name {
  font-size: 0.8rem; font-weight: 600; color: var(--text-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-institution {
  font-size: 0.7rem; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.btn-ghost-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); flex-shrink: 0;
  transition: background 0.12s, color 0.12s;
}
.btn-ghost-icon:hover { background: var(--bg-hover); color: var(--text-1); }
.btn-ghost-icon i     { width: 16px; height: 16px; }

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 99;
}

/* ── Main wrapper ── */
.main-wrapper { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

/* ── Topbar — slideDown from bella ── */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px;
  flex-shrink: 0;
  animation: slideDown 0.5s ease-out;
}

.topbar-title {
  flex: 1;
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 0.95rem; font-weight: 600; color: var(--text-1);
}

.topbar-right { display: flex; align-items: center; gap: 12px; }

.status-pill {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg-3); border: 1px solid var(--border);
  padding: 4px 10px; border-radius: 99px;
  font-size: 0.75rem; color: var(--text-2);
}

.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.status-dot.live {
  background: #ffffff;
  box-shadow: 0 0 6px rgba(255,255,255,0.6);
  animation: pulse-dot 2s ease-in-out infinite;
}

/* ── Pages — fadeInUp on activation ── */
.page { display: none; flex: 1; overflow-y: auto; padding: 24px 28px; }
.page.active {
  display: block;
  animation: fadeInUp 0.45s ease-out;
}

.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}

.page-title {
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 1.5rem; font-weight: 700; color: var(--text-1);
  letter-spacing: -0.02em; line-height: 1.2;
}

.page-subtitle { font-size: 0.825rem; color: var(--text-3); margin-top: 4px; }

.header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.8rem; font-weight: 500; color: var(--text-2);
  transition: all 0.2s ease;
}
.btn-secondary:hover {
  background: var(--bg-hover); border-color: var(--border-2);
  color: var(--text-1); transform: translateY(-1px);
}
.btn-secondary i { width: 14px; height: 14px; }

/* ── Stats Grid — bella feature-card hover ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex; align-items: center; gap: 14px;
  transition: all 0.3s ease;
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--text), var(--text-muted));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}
.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(255,255,255,0.08);
  border-color: var(--text);
}
.stat-card:hover::before { transform: scaleX(1); }

.stat-icon {
  width: 36px; height: 36px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  background: rgba(255,255,255,0.08);
  color: var(--text-1);
}
.stat-icon i      { width: 18px; height: 18px; }

/* Removed color variants - using monochrome */

.stat-body  { display: flex; flex-direction: column; gap: 2px; }
.stat-label { font-size: 0.75rem; color: var(--text-3); font-weight: 500; }
.stat-value {
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 1.4rem; font-weight: 700; color: var(--text-1); line-height: 1;
}

/* ── Cards — bella feature-card hover + accent line ── */
.card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s ease;
  position: relative;
}
.card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--text), var(--text-muted));
  transform: scaleX(0);
  transition: transform 0.3s ease;
  z-index: 1;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(255,255,255,0.08);
  border-color: var(--text);
}
.card:hover::before { transform: scaleX(1); }

.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}

.card-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.875rem; font-weight: 600; color: var(--text-1);
}
.card-title i { width: 15px; height: 15px; color: var(--text-3); }

.card-tag {
  font-size: 0.72rem; font-weight: 500; color: var(--text-3);
  background: var(--bg-3); border: 1px solid var(--border);
  padding: 2px 8px; border-radius: 99px;
}

/* card-link: suppressed so bella's global a:hover doesn't apply */
.card-link {
  font-size: 0.78rem; color: var(--text-3);
  transition: color 0.12s;
  border-bottom: none; padding-bottom: 0;
}
.card-link:hover {
  color: var(--text-1);
  background: none; padding: 0; transform: none;
}

/* ── Dashboard Grid ── */
.dashboard-grid { display: grid; grid-template-columns: 1fr 340px; gap: 16px; }
@media (max-width: 900px) { .dashboard-grid { grid-template-columns: 1fr; } }

/* ── Map ── */
.map-card { display: flex; flex-direction: column; }
.map-container { height: 420px; width: 100%; background: #0d0d0d; }

.leaflet-tile { filter: brightness(0.7) invert(1) contrast(1) hue-rotate(200deg) saturate(0.4) brightness(0.7); }
.leaflet-container { background: #0d0d0d; }
.leaflet-control-zoom a {
  background: var(--bg-2) !important; color: var(--text-1) !important; border-color: var(--border) !important;
}

/* ── Alert List ── */
.alerts-card { display: flex; flex-direction: column; }
.alert-list   { flex: 1; overflow-y: auto; max-height: 380px; }

.alert-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.alert-item:last-child { border-bottom: none; }
.alert-item:hover      { background: var(--accent-glow); }

.alert-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.alert-dot.high   { background: var(--red);   box-shadow: 0 0 6px var(--red);   }
.alert-dot.medium { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.alert-dot.low    { background: var(--green); }

.alert-content { flex: 1; min-width: 0; }
.alert-type    { font-size: 0.825rem; font-weight: 600; color: var(--text-1); }
.alert-meta    { font-size: 0.75rem;  color: var(--text-3); margin-top: 2px;  }

.empty-state-sm {
  padding: 32px 16px; text-align: center;
  font-size: 0.825rem; color: var(--text-3);
}

/* ── Table ── */
.table-wrapper { overflow-x: auto; }

.data-table { width: 100%; border-collapse: collapse; font-size: 0.825rem; }
.data-table thead tr { border-bottom: 1px solid var(--border); }
.data-table th {
  padding: 10px 16px; text-align: left;
  font-size: 0.75rem; font-weight: 600; color: var(--text-3);
  letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap;
}
.data-table td {
  padding: 12px 16px; color: var(--text-2);
  border-bottom: 1px solid var(--border); vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--accent-glow); }

.table-empty { text-align: center; color: var(--text-3); padding: 40px 16px; font-size: 0.825rem; }

/* ── Badges ── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 99px;
  font-size: 0.72rem; font-weight: 600; white-space: nowrap;
}
.badge-high     { background: rgba(255,255,255,0.15); color: var(--text-1); border: 1px solid rgba(255,255,255,0.3); }
.badge-medium   { background: rgba(255,255,255,0.08); color: var(--text-2); border: 1px solid rgba(255,255,255,0.2); }
.badge-low      { background: var(--bg-3);            color: var(--text-3); border: 1px solid var(--border);        }
.badge-active   { background: rgba(255,255,255,0.1);  color: var(--text-1); border: 1px solid rgba(255,255,255,0.25);}
.badge-resolved { background: var(--bg-3);            color: var(--text-3); border: 1px solid var(--border);        }

/* ── Search & Select ── */
.search-wrapper { position: relative; }

.search-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; color: var(--text-3); pointer-events: none;
}

.search-input {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px 12px 8px 32px; font-size: 0.825rem; color: var(--text-1);
  outline: none; width: 220px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.search-input::placeholder { color: var(--text-3); }
.search-input:focus { border-color: var(--text); box-shadow: 0 0 0 3px rgba(255,255,255,0.08); }

.select-input {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px 28px 8px 12px; font-size: 0.825rem; color: var(--text-1);
  outline: none; cursor: pointer; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}

/* ── Users Grid — bella feature-card hover ── */
.users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.user-card {
  background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 16px; display: flex; align-items: center; gap: 14px;
  transition: all 0.3s ease; position: relative; overflow: hidden;
}
.user-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--text), var(--text-muted));
  transform: scaleX(0); transition: transform 0.3s ease;
}
.user-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(255,255,255,0.08);
  border-color: var(--text);
}
.user-card:hover::before { transform: scaleX(1); }

.user-card-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: #ffffff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 700; color: #000000; flex-shrink: 0;
}

.user-card-info { flex: 1; min-width: 0; }
.user-card-name { font-size: 0.875rem; font-weight: 600; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card-inst { font-size: 0.75rem; color: var(--text-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.user-card-role {
  font-size: 0.68rem; font-weight: 600; padding: 2px 8px; border-radius: 99px;
  border: 1px solid var(--border); background: var(--bg-3); color: var(--text-3);
  white-space: nowrap; flex-shrink: 0;
}
.user-card-role.admin { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); color: var(--text-1); }

/* ══════════════════════════════════════════════════
   SUBSCRIPTION MODAL
══════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.modal-content {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  max-width: 420px;
  width: 100%;
  overflow: hidden;
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.subscription-modal {
  padding: 32px;
}

.subscription-header {
  text-align: center;
  margin-bottom: 24px;
}

/* Subscription Logo */
.subscription-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}

.subscription-logo-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.subscription-logo-sep {
  font-size: 1.5rem;
  color: var(--text-3);
  font-weight: 300;
}

.subscription-logo-text {
  font-family: 'Poppins', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.02em;
}

.subscription-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 8px;
}

.subscription-tagline {
  font-size: 0.9rem;
  color: var(--text-3);
}

.subscription-features {
  background: var(--bg-3);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 24px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  font-size: 0.875rem;
  color: var(--text-2);
}

.feature-item:not(:last-child) {
  border-bottom: 1px solid var(--border);
}

.feature-check {
  width: 18px;
  height: 18px;
  color: var(--text-1);
  flex-shrink: 0;
}

.subscription-pricing {
  text-align: center;
  margin-bottom: 24px;
}

.price-tag {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
}

.price-tag .currency {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-2);
}

.price-tag .amount {
  font-size: 3rem;
  font-weight: 800;
  color: var(--text-1);
  line-height: 1;
}

.price-tag .period {
  font-size: 1rem;
  color: var(--text-3);
  margin-left: 4px;
}

.price-note {
  font-size: 0.75rem;
  color: var(--text-3);
  margin-top: 8px;
}

.subscription-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-subscribe {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #ffffff;
  color: #000000;
  border: none;
  font-weight: 600;
  padding: 14px 24px;
  border-radius: var(--radius);
  transition: all 0.2s;
}

.btn-subscribe:hover {
  background: #e5e5e5;
  transform: translateY(-1px);
}

.btn-subscribe svg {
  width: 18px;
  height: 18px;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-3);
  padding: 12px 24px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.btn-ghost:hover {
  background: var(--bg-3);
  color: var(--text-2);
}

.subscription-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
  font-size: 0.75rem;
  color: var(--text-3);
}

.subscription-footer svg {
  color: var(--text-1);
}

/* ══════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: flex; }
  .sidebar-overlay.open { display: block; }

  .page         { padding: 16px; }
  .stats-grid   { grid-template-columns: repeat(2, 1fr); }
  .search-input { width: 160px; }
  .page-header  { flex-direction: column; align-items: flex-start; }
  
  .subscription-modal { padding: 24px; }
  .price-tag .amount { font-size: 2.5rem; }
}
