/* ==========================================================================
   UCLouvain Sport Bot - Modern Dark Theme & Glassmorphic Design System
   ========================================================================== */

:root {
  --bg-base: #080c14;
  --bg-surface: #0f172a;
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-card-hover: rgba(30, 41, 59, 0.9);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(99, 102, 241, 0.3);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #8fa0b5;

  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.25);

  --emerald: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.25);
  --amber: #f59e0b;
  --amber-glow: rgba(245, 158, 11, 0.25);
  --cyan: #06b6d4;
  --cyan-glow: rgba(6, 182, 212, 0.25);
  --rose: #f43f5e;
  --rose-glow: rgba(244, 63, 94, 0.25);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-base);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  background-image: 
    radial-gradient(at 10% 10%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
    radial-gradient(at 90% 90%, rgba(6, 182, 212, 0.08) 0px, transparent 50%);
  background-attachment: fixed;
}

/* App Layout */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
  width: 270px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 24px 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.logo-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 16px var(--primary-glow);
}

.brand-text h2 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.badge-sniper {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: var(--radius-sm);
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 24px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  position: relative;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  transform: translateX(4px);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.18), rgba(99, 102, 241, 0.06));
  color: #c7d2fe;
  border-left: 3px solid var(--primary);
  font-weight: 600;
}

.nav-item .icon {
  font-size: 1.2rem;
}

.nav-counter {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

.nav-item.active .nav-counter {
  background: var(--primary);
  color: #fff;
}

/* Sidebar Footer (Bot Status) */
.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.bot-status-widget {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.3);
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.status-indicator-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 12px var(--emerald);
  animation: pulse-dot 2s infinite;
}

.status-indicator-dot.paused {
  background: var(--rose);
  box-shadow: 0 0 12px var(--rose);
  animation: none;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.status-details {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.status-title {
  font-size: 0.85rem;
  font-weight: 600;
}

.status-subtitle {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.btn-toggle-mini {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-main);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  transition: var(--transition);
}

.btn-toggle-mini:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
}

/* Main Content Area */
.main-content {
  flex: 1;
  padding: 32px 40px;
  max-width: 1380px;
  width: 100%;
  min-width: 0;
  margin: 0 auto;
}

/* Top Bar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

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

.topbar-left h1 {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.topbar-left p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 4px;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
}

.user-pill:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
}

.user-pill * {
  pointer-events: none;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--emerald));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
}

.user-meta {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.9rem;
  font-weight: 600;
}

.user-status-tag {
  font-size: 0.72rem;
  color: var(--emerald);
  font-weight: 500;
}

.btn-connect-sso {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff;
  border: none;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-connect-sso:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* Tabs */
.tab-pane {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.metric-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.metric-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.15);
}

.card-glow-indigo::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--cyan));
}

.card-glow-emerald::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: var(--emerald);
}

.card-glow-amber::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: var(--amber);
}

.card-glow-cyan::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: var(--cyan);
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.metric-title {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.metric-value-huge {
  font-size: 2.2rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #fff;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.metric-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.metric-footer {
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* Dashboard Split */
.dashboard-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.dashboard-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.card-head h3 {
  font-size: 1.15rem;
  font-weight: 600;
}

.card-desc {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 20px;
}

/* Rules compact list */
.rules-list-compact {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rule-compact-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.rule-compact-item:hover {
  background: rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 255, 255, 0.12);
}

.rule-info h4 {
  font-size: 0.95rem;
  font-weight: 600;
}

.rule-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.rule-status-badge {
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
}

/* Terminal Console */
.terminal-card {
  display: flex;
  flex-direction: column;
}

.terminal-logs {
  background: #050811;
  border-radius: var(--radius-md);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  height: 320px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.log-line {
  margin-bottom: 6px;
  line-height: 1.4;
  word-break: break-all;
}

.log-info { color: #94a3b8; }
.log-success { color: #34d399; font-weight: 500; }
.log-warning { color: #fbbf24; }
.log-error { color: #f87171; }

.btn-terminal-clear {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.btn-terminal-clear:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

/* Buttons - Modern & Premium Design System */
.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  outline: none;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  box-shadow: 0 6px 24px rgba(99, 102, 241, 0.55);
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.btn-primary-sm {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 7px 15px;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
}

.btn-primary-sm:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.45);
  filter: brightness(1.1);
}

.btn-secondary {
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 9px 18px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: inherit;
  outline: none;
}

.btn-secondary:hover {
  background: rgba(51, 65, 85, 0.85);
  border-color: rgba(99, 102, 241, 0.45);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  transform: translateY(-1px);
}

.btn-secondary:active {
  transform: translateY(0) scale(0.98);
}

.btn-danger-outline {
  background: rgba(239, 68, 68, 0.08);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  outline: none;
}

.btn-danger-outline:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.6);
  color: #fca5a5;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.25);
  transform: translateY(-1px);
}

.btn-danger-outline:active {
  transform: translateY(0) scale(0.98);
}

.btn-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.btn-icon:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.45);
  color: #ffffff;
  transform: scale(1.06);
}

/* Action Bars */
.section-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.section-action-bar h2 {
  font-size: 1.5rem;
  font-weight: 700;
}

.section-action-bar p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Rules Grid (Full Page) */
.rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 22px;
}

.rule-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.4);
}

.rule-card:hover {
  transform: translateY(-3px);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.5), 0 0 24px rgba(99, 102, 241, 0.15);
}

.rule-card-disabled {
  opacity: 0.7;
}

.rule-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.rule-card-head h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.35;
}

.rule-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.rule-badge-active {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

.rule-badge-paused {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.15);
}

.rule-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.rule-prop {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.87rem;
  padding: 3px 0;
}

.prop-label {
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.prop-val {
  color: #f1f5f9;
  font-weight: 500;
  text-align: right;
}

.highlight-sniper {
  color: #818cf8;
  font-weight: 600;
}

.prop-status {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  border: 1px solid rgba(56, 189, 248, 0.25);
  font-weight: 500;
}

.rule-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-toggle-rule {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  outline: none;
}

.btn-toggle-rule.btn-pause {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.btn-toggle-rule.btn-pause:hover {
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(245, 158, 11, 0.55);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
  transform: translateY(-1px);
}

.btn-toggle-rule.btn-resume {
  background: rgba(16, 185, 129, 0.14);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.btn-toggle-rule.btn-resume:hover {
  background: rgba(16, 185, 129, 0.24);
  border-color: rgba(16, 185, 129, 0.6);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
  transform: translateY(-1px);
}

.btn-delete-rule {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  outline: none;
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.btn-delete-rule:hover {
  background: rgba(239, 68, 68, 0.22);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.55);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
  transform: translateY(-1px);
}

.btn-toggle-rule:active,
.btn-delete-rule:active {
  transform: scale(0.97);
}

/* Catalog Table */
.catalog-header-bar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 16px;
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  gap: 12px;
}

.search-icon {
  font-size: 1.1rem;
}

.search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 1rem;
  font-family: var(--font-main);
  width: 100%;
}

.filters-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.form-select-custom, .form-input-custom {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  padding: 10px 16px;
  font-family: var(--font-main);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

.form-select-custom:focus, .form-input-custom:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.checkbox-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  cursor: pointer;
}

.btn-refresh {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 500;
  transition: var(--transition);
  margin-left: auto;
}

.btn-refresh:hover {
  background: rgba(255, 255, 255, 0.15);
}

.catalog-stats-bar {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 14px;
}

/* Date Carousel & Selector Bar - Modern Glassmorphic Slider */
.date-selector-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 8px 12px;
  backdrop-filter: blur(14px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.date-nav-arrow {
  width: 38px;
  height: 54px;
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.date-nav-arrow:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.5);
  color: #ffffff;
  transform: scale(1.06);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.date-nav-arrow:active {
  transform: scale(0.95);
}

.date-nav-arrow svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.date-selector-bar {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 4px 2px;
  flex: 1 1 0;
  min-width: 0;
  /* Completely hide ugly default scrollbars on all browsers */
  scrollbar-width: none;
  -ms-overflow-style: none;
  cursor: grab;
}

.date-selector-bar:active {
  cursor: grabbing;
}

.date-selector-bar::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.date-tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  min-width: 96px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: #94a3b8;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  text-align: center;
  flex-shrink: 0;
  position: relative;
}

.date-tab-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #f8fafc;
  border-color: rgba(99, 102, 241, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.date-tab-btn.active {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #ffffff;
  border-color: rgba(165, 180, 252, 0.5);
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.date-tab-day {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  opacity: 0.85;
  margin-bottom: 2px;
}

.date-tab-num {
  font-size: 0.94rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
  color: #f1f5f9;
}

.date-tab-btn.active .date-tab-num {
  color: #ffffff;
}

.date-tab-count {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.2s;
}

.date-tab-btn:hover .date-tab-count {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.date-tab-btn.active .date-tab-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.35);
}

/* Day Section Grouping */
.catalog-day-section {
  margin-bottom: 24px;
}

.catalog-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.15), rgba(15, 23, 42, 0.7));
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
}

.catalog-day-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.catalog-day-title h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f8fafc;
}

.catalog-day-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.catalog-day-free-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-toggle-day {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-toggle-day:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.seances-table-wrapper {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.seances-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.seances-table th {
  background: rgba(0, 0, 0, 0.25);
  padding: 14px 18px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}

.seances-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.9rem;
}

.seances-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.badge-places {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.8rem;
}

.badge-places-available {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.badge-places-full {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
}

.table-action-btns {
  display: flex;
  gap: 8px;
}

.btn-action-register {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-action-register:hover {
  background: var(--primary-hover);
}

.btn-action-automate {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-action-automate:hover {
  background: rgba(255, 255, 255, 0.16);
}

/* Inscriptions Cards */
.inscriptions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.inscription-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-left: 4px solid var(--emerald);
}

.inscr-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.inscr-header h3 {
  font-size: 1.15rem;
  font-weight: 600;
}

.inscr-body {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.inscr-body div {
  margin-bottom: 6px;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  overflow-y: auto;
}

.modal-backdrop.open,
.modal-backdrop.show {
  display: flex !important;
}

.modal-content {
  background: #111827;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  animation: modalScale 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScale {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.btn-close-modal:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.form-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.form-row {
  display: flex;
  gap: 16px;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

.options-box {
  background: rgba(0, 0, 0, 0.25);
  padding: 14px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkbox-container {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  cursor: pointer;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

/* Settings elements */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.auth-status-box {
  background: rgba(0, 0, 0, 0.25);
  padding: 16px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.divider {
  text-align: center;
  position: relative;
  margin: 16px 0;
  color: var(--text-dim);
  font-size: 0.8rem;
}

.divider::before, .divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: var(--border-subtle);
}

.divider::before { left: 0; }
.divider::after { right: 0; }

.form-help {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.input-disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: 0.3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--emerald);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.toast {
  background: #1e293b;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  color: #fff;
  font-size: 0.9rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  animation: toastIn 0.3s ease-out;
  display: flex;
  align-items: center;
  gap: 10px;
}

@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast-success { border-left: 4px solid var(--emerald); }
.toast-error { border-left: 4px solid var(--rose); }
.toast-warning { border-left: 4px solid var(--amber); }

/* Multi-User Selector & Dropdown */
.user-selector-container {
  position: relative;
}

.dropdown-trigger {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: 30px;
  transition: var(--transition);
}

.dropdown-trigger:hover {
  background: rgba(51, 65, 85, 0.9);
  border-color: rgba(99, 102, 241, 0.4);
}

.dropdown-chevron {
  font-size: 0.65rem;
  color: var(--text-dim);
  transition: transform 0.2s ease;
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
  z-index: 1000;
  display: none;
  overflow: hidden;
  animation: dropdownSlideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdownSlideDown {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.user-dropdown-menu.show {
  display: block;
}

.dropdown-header {
  padding: 12px 16px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dropdown-users-list {
  max-height: 240px;
  overflow-y: auto;
}

.dropdown-user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  cursor: pointer;
  transition: var(--transition);
}

.dropdown-user-item:hover {
  background: rgba(99, 102, 241, 0.12);
}

.dropdown-user-item.active {
  background: rgba(99, 102, 241, 0.2);
  border-left: 3px solid var(--primary);
}

.dropdown-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-mini-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: white;
}

.dropdown-user-meta {
  display: flex;
  flex-direction: column;
}

.dropdown-user-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
}

.dropdown-user-sub {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
}

.dropdown-action-btn {
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: none;
  color: #38bdf8;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.dropdown-action-btn:hover {
  background: rgba(56, 189, 248, 0.1);
}

/* Group View Cards */
.group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 16px;
}

.group-user-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  transition: var(--transition);
}

.group-user-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.4);
}

.group-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.group-user-badge {
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 20px;
}

.group-badge-connected {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.group-badge-disconnected {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.group-inscriptions-box {
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 0.82rem;
}

.group-inscriptions-box h4 {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.group-session-tag {
  display: inline-block;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #c7d2fe;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.78rem;
  margin: 3px 4px 3px 0;
}

/* Bookmarklet Tool */
.bookmarklet-box {
  background: rgba(99, 102, 241, 0.1);
  border: 1px dashed rgba(99, 102, 241, 0.4);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  margin: 16px 0;
}

.bookmarklet-link {
  display: inline-block;
  background: linear-gradient(135deg, #6366f1, #3b82f6);
  color: white;
  padding: 8px 18px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  cursor: grab;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .app-layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .dashboard-split, .settings-grid { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: flex-start; gap: 14px; }
  .topbar-right { width: 100%; justify-content: flex-start; gap: 8px; }
  .main-content { padding: 24px 18px; }
}

/* Lucide Icons & Status Indicators */
.lucide-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.inline-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: -0.15em;
  margin-right: 4px;
}

.status-dot-green,
.status-dot-red,
.status-dot-amber {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 6px;
  flex-shrink: 0;
}

.status-dot-green {
  background-color: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}

.status-dot-red {
  background-color: #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
}

.status-dot-amber {
  background-color: #f59e0b;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
}

.user-status-tag.status-active {
  color: var(--emerald, #10b981);
}

.user-status-tag.status-offline {
  color: var(--rose, #f43f5e);
}

/* ==========================================================================
   Portal Screen - Profil Selector (Modern Luxury Dark Glassmorphism)
   ========================================================================== */

#portal-screen {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #080c16;
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.22) 0%, transparent 60%),
    radial-gradient(circle at 85% 85%, rgba(6, 182, 212, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 15% 90%, rgba(244, 63, 94, 0.08) 0%, transparent 50%);
  overflow-y: auto;
  padding: 32px 16px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.portal-container {
  max-width: 640px;
  width: 100%;
  margin: auto;
  position: relative;
  animation: portalFadeUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.portal-card {
  background: linear-gradient(175deg, rgba(20, 29, 49, 0.88) 0%, rgba(11, 16, 28, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 36px 32px;
  box-shadow: 
    0 25px 60px -15px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    0 0 80px -20px rgba(99, 102, 241, 0.2);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* Subtle top glow highlight on card */
.portal-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.8), rgba(6, 182, 212, 0.8), transparent);
  pointer-events: none;
}

.portal-header {
  text-align: center;
  margin-bottom: 28px;
  position: relative;
}

.portal-brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 5px 14px;
  border-radius: 9999px;
  margin-bottom: 16px;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.15);
}

.portal-brand-badge i {
  color: #818cf8;
}

.portal-logo-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 16px;
}

.portal-logo-glow {
  position: absolute;
  inset: -6px;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  border-radius: 24px;
  filter: blur(14px);
  opacity: 0.45;
  z-index: 0;
}

.portal-logo-icon {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 66px;
  height: 66px;
  background: linear-gradient(135deg, #6366f1 0%, #3b82f6 50%, #06b6d4 100%);
  border-radius: 20px;
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

.portal-title {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  background: linear-gradient(180deg, #ffffff 40%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}

.portal-subtitle {
  color: #94a3b8;
  font-size: 0.94rem;
  line-height: 1.55;
  max-width: 480px;
  margin: 0 auto;
}

.portal-subtitle strong {
  color: #f1f5f9;
  font-weight: 600;
}

/* User cards list */
.portal-users-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.portal-user-row {
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  position: relative;
  text-decoration: none;
  color: inherit;
}

.portal-user-row:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(99, 102, 241, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 0 24px rgba(99, 102, 241, 0.18);
}

.portal-user-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

.portal-user-avatar {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.15);
  position: relative;
}

.portal-user-meta {
  min-width: 0;
}

.portal-user-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
  margin-bottom: 3px;
}

.portal-user-status-line {
  font-size: 0.82rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.portal-pill-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.portal-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  position: relative;
}

.portal-pulse-dot.online {
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
  animation: pulseDotGreen 2s infinite;
}

.portal-pulse-dot.offline {
  background: #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}

@keyframes pulseDotGreen {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.portal-pill-rules {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1px 8px;
  border-radius: 6px;
  font-size: 0.76rem;
  color: #cbd5e1;
}

.portal-user-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-portal-copy {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  padding: 8px 13px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: inherit;
}

.btn-portal-copy:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.btn-portal-copy:active {
  transform: translateY(0);
}

.btn-portal-copy.copied {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.5);
  color: #34d399;
}

.btn-portal-open {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-portal-open:hover {
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.55);
  transform: translateY(-1px);
}

.btn-portal-open .icon-arrow {
  display: inline-flex;
  align-items: center;
  transition: transform 0.2s ease;
}

.portal-user-row:hover .btn-portal-open .icon-arrow {
  transform: translateX(3px);
}

/* Add Friend / Link Profile Button */
.portal-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: rgba(255, 255, 255, 0.02);
  border: 1.5px dashed rgba(99, 102, 241, 0.35);
  border-radius: 16px;
  padding: 13px 20px;
  color: #e2e8f0;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  margin-bottom: 20px;
}

.portal-add-btn:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.7);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px -4px rgba(99, 102, 241, 0.2);
}

.portal-add-icon-wrap {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #38bdf8;
}

/* Tip Box (Cleanly positioned, perfectly aligned, no overlapping) */
.portal-tip-box {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.08) 0%, rgba(99, 102, 241, 0.04) 100%);
  border: 1px solid rgba(6, 182, 212, 0.22);
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 0.85rem;
  color: #bae6fd;
  line-height: 1.55;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.portal-tip-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.portal-tip-body strong {
  color: #ffffff;
}

.portal-code-chip {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #38bdf8;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 500;
}

/* Modal User Selection Item */
.modal-user-item {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px 16px;
  cursor: pointer;
  background: rgba(30, 41, 59, 0.5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-user-item:hover {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
  .main-content {
    padding: 16px 12px;
  }
  .portal-card {
    padding: 24px 18px;
    border-radius: 20px;
  }
  .portal-title {
    font-size: 1.5rem;
  }
  .portal-user-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .portal-user-actions {
    justify-content: flex-end;
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 10px;
  }
  .btn-portal-copy, .btn-portal-open {
    flex: 1;
    justify-content: center;
  }
}

/* Accessibility: Focus-Visible & Reduced Motion */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
.user-pill:focus-visible,
.nav-item:focus-visible,
.date-tab-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


