/* ==========================================================================
   NEXUS — Modern Web Application Stylesheet
   ========================================================================== */

:root {
  /* Brand Color Palette - Dark Mode Default */
  --primary-50: #eef2ff;
  --primary-100: #e0e7ff;
  --primary-200: #c7d2fe;
  --primary-500: #6366f1;
  --primary-600: #4f46e5;
  --primary-700: #4338ca;
  --primary-glow: rgba(99, 102, 241, 0.35);

  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  /* Neutral Surface & Dark Tones */
  --bg-body: #0b0f19;
  --bg-surface: #111827;
  --bg-surface-1: #111827;
  --bg-surface-2: #1f2937;
  --bg-surface-3: #283347;
  --bg-card: rgba(17, 24, 39, 0.85);
  --header-bg: rgba(17, 24, 39, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);

  /* Typography */
  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --text-subtle: #6b7280;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Lora', Georgia, 'Times New Roman', serif;
  --font-headline: var(--font-sans);
  --font-mono: 'JetBrains Mono', monospace;

  /* Specific Component Variables */
  --brand-logo-bg: linear-gradient(135deg, var(--primary-600), var(--accent-cyan));
  --brand-logo-color: #ffffff;
  --brand-logo-radius: var(--radius-md);
  --brand-name-color: linear-gradient(90deg, #ffffff, #c7d2fe);
  --btn-primary-bg: linear-gradient(135deg, var(--primary-600), var(--primary-500));
  --btn-primary-hover: linear-gradient(135deg, var(--primary-700), var(--primary-600));
  --btn-primary-color: #ffffff;
  --btn-primary-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
  --sidebar-active-bg: var(--primary-600);
  --sidebar-active-color: #ffffff;
  --sidebar-active-badge-bg: rgba(255, 255, 255, 0.25);
  --sidebar-active-badge-color: #ffffff;
  --sidebar-tag-bg: var(--bg-surface-2);
  --sidebar-tag-border: var(--border-subtle);
  --sidebar-tag-color: var(--text-muted);
  --avatar-default-bg: linear-gradient(135deg, var(--primary-600), #818cf8);
  --avatar-default-color: #ffffff;
  --post-card-bg: var(--bg-card);
  --post-card-border: var(--border-subtle);
  --post-card-shadow: var(--shadow-sm);
  --post-card-radius: var(--radius-lg);
  --post-type-badge-bg: rgba(255, 255, 255, 0.06);
  --post-type-badge-border: var(--border-subtle);
  --post-type-badge-color: var(--text-muted);
  --post-tag-bg: rgba(255, 255, 255, 0.05);
  --post-tag-border: var(--border-subtle);
  --post-tag-color: var(--text-subtle);

  /* Layout & Elevations */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 25px var(--primary-glow);
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

/* ==========================================================================
   LIGHT MODE (WARM EDITORIAL DESIGN MATCHING SCREENSHOT)
   ========================================================================== */
[data-theme="light"] {
  /* Warm cream paper tones */
  --bg-body: #faf6f0;
  --bg-surface: #ffffff;
  --bg-surface-1: #ffffff;
  --bg-surface-2: #f2ede4;
  --bg-surface-3: #e8e2d8;
  --bg-card: #ffffff;
  --header-bg: #faf6f0;
  
  /* Borders & Dividers */
  --border-subtle: #eae3d7;
  --border-focus: #c2410c;

  /* Typography */
  --text-main: #1f2937;
  --text-muted: #6b7280;
  --text-subtle: #9ca3af;
  --font-headline: var(--font-serif);

  /* Warm Rust Terracotta & Forest Green Palette */
  --primary-50: #fff7ed;
  --primary-100: #ffedd5;
  --primary-200: #fed7aa;
  --primary-500: #ea580c;
  --primary-600: #c2410c;
  --primary-700: #9a3412;
  --primary-glow: rgba(194, 65, 12, 0.25);

  --accent-cyan: #0284c7;
  --accent-emerald: #047857;
  --accent-amber: #d97706;
  --accent-rose: #e11d48;

  /* Brand Logo: Solid terracotta with crisp white letter N */
  --brand-logo-bg: #c2410c;
  --brand-logo-color: #ffffff;
  --brand-logo-radius: 50%;
  --brand-name-color: #1f2937;

  /* Primary Button: Terracotta pill */
  --btn-primary-bg: #c2410c;
  --btn-primary-hover: #9a3412;
  --btn-primary-color: #ffffff;
  --btn-primary-shadow: 0 2px 8px rgba(194, 65, 12, 0.25);

  /* Sidebar Active Pill: Warm soft peach / cream tinted */
  --sidebar-active-bg: #fff7ed;
  --sidebar-active-color: #c2410c;
  --sidebar-active-badge-bg: #c2410c;
  --sidebar-active-badge-color: #ffffff;
  --sidebar-tag-bg: #ffffff;
  --sidebar-tag-border: #eae3d7;
  --sidebar-tag-color: #6b7280;

  /* Forest Green User Avatars */
  --avatar-default-bg: #047857;
  --avatar-default-color: #ffffff;

  /* Clean Paper Cards */
  --post-card-bg: #ffffff;
  --post-card-border: #ede8e0;
  --post-card-shadow: 0 2px 8px rgba(100, 80, 60, 0.05);
  --post-card-radius: 14px;

  /* Subtle Post Type Badges */
  --post-type-badge-bg: #f5f0e8;
  --post-type-badge-border: #e8e0d4;
  --post-type-badge-color: #78716c;

  /* Post Tags */
  --post-tag-bg: #faf6f0;
  --post-tag-border: #e7dfd3;
  --post-tag-color: #78716c;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 15px 35px rgba(0, 0, 0, 0.12);
}

/* Base Reset & Typography */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  background-image: 
    radial-gradient(at 0% 0%, rgba(79, 70, 229, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(6, 182, 212, 0.08) 0px, transparent 50%);
  background-attachment: fixed;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

[data-theme="light"] body {
  /* Subtle light dot grid paper texture matching screenshot */
  background-color: #faf6f0;
  background-image: radial-gradient(#dfd7cc 1px, transparent 1px);
  background-size: 16px 16px;
  background-attachment: fixed;
}

/* ==========================================================================
   VISUAL SERVER INDICATORS (Zero Refresh Feedback)
   ========================================================================== */

/* 1. Top Indeterminate Progress Bar */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.progress-bar.active {
  opacity: 1;
}

.progress-bar-inner {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #6366f1, #06b6d4, #10b981, #6366f1);
  background-size: 300% 100%;
  animation: progressPulse 1.2s infinite linear;
}

@keyframes progressPulse {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

/* 2. Floating Server Activity Indicator Pill */
.server-indicator {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(99, 102, 241, 0.4);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-full);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 9000;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  transform: translateY(0);
}

.server-indicator.hidden {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

.indicator-spinner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--primary-500);
}

.indicator-spinner .pulse-ring {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-500);
  opacity: 0.3;
  animation: pulseScale 1.5s infinite ease-out;
}

@keyframes pulseScale {
  0% { transform: scale(0.8); opacity: 0.5; }
  100% { transform: scale(1.6); opacity: 0; }
}

.indicator-content {
  display: flex;
  flex-direction: column;
}

.indicator-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--primary-200);
}

.indicator-detail {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* 3. Toast Notifications */
.toast-container {
  position: fixed;
  top: 76px;
  right: 24px;
  z-index: 9500;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--bg-surface-2);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  animation: slideInRight 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.2s, transform 0.2s;
}

.toast.toast-success { border-color: rgba(16, 185, 129, 0.4); }
.toast.toast-error { border-color: rgba(244, 63, 94, 0.4); }
.toast.toast-info { border-color: rgba(99, 102, 241, 0.4); }

.toast-icon { font-size: 1.1rem; }
.toast-success .toast-icon { color: var(--accent-emerald); }
.toast-error .toast-icon { color: var(--accent-rose); }
.toast-info .toast-icon { color: var(--primary-500); }

@keyframes slideInRight {
  from { transform: translateX(40px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   APP HEADER
   ========================================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.header-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-group {
  display: flex;
  align-items: center;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--brand-logo-radius);
  background: var(--brand-logo-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--brand-logo-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: all var(--transition-fast);
}

.brand-icon i {
  display: inline-block;
}

[data-theme="light"] .brand-icon i {
  display: none;
}

[data-theme="light"] .brand-icon::after {
  content: "N";
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 1.25rem;
  color: #ffffff;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  background: var(--brand-name-color);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .brand-name {
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: unset;
  color: #1f2937;
  font-family: var(--font-headline);
  letter-spacing: 0.08em;
}

.brand-tagline {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Global Search */
.search-bar-wrapper {
  position: relative;
  flex: 1;
  max-width: 520px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
  font-size: 0.9rem;
}

.search-bar-wrapper input {
  width: 100%;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 9px 38px 9px 40px;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--text-main);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
}

[data-theme="light"] .search-bar-wrapper input {
  background: #ffffff;
  border-color: #e5ded4;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.search-bar-wrapper input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

[data-theme="light"] .search-bar-wrapper input:focus {
  border-color: #c2410c;
  box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.15);
}

.search-clear-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

.search-clear-btn:hover {
  color: var(--text-main);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ==========================================================================
   THEME TOGGLE SWITCH (Light / Dark)
   ========================================================================== */
.theme-toggle-btn {
  background: transparent;
  border: none;
  padding: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  transition: transform var(--transition-fast);
}

.theme-toggle-btn:hover {
  transform: scale(1.05);
}

.theme-toggle-btn:focus-visible {
  outline: 2px solid var(--primary-500);
  outline-offset: 2px;
}

.theme-toggle-track {
  width: 50px;
  height: 26px;
  background-color: var(--bg-surface-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  position: relative;
  display: flex;
  align-items: center;
  padding: 2px;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

[data-theme="light"] .theme-toggle-track {
  background-color: #e8e2d8;
  border-color: #d8cebf;
}

.theme-toggle-thumb {
  width: 20px;
  height: 20px;
  background-color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: #1f2937;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  transform: translateX(0);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background-color var(--transition-fast), color var(--transition-fast);
}

.theme-toggle-thumb .dark-icon {
  display: inline-block;
  color: #6366f1;
}

.theme-toggle-thumb .light-icon {
  display: none;
  color: #ea580c;
}

[data-theme="light"] .theme-toggle-thumb {
  transform: translateX(24px);
  background-color: #ffffff;
}

[data-theme="light"] .theme-toggle-thumb .dark-icon {
  display: none;
}

[data-theme="light"] .theme-toggle-thumb .light-icon {
  display: inline-block;
}

.server-status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(31, 41, 55, 0.7);
  border: 1px solid var(--border-subtle);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--text-subtle);
  transition: background-color var(--transition-fast);
}

.status-dot.online {
  background-color: var(--accent-emerald);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.status-dot.syncing {
  background-color: var(--accent-amber);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
  animation: pulseDot 1s infinite alternate;
}

@keyframes pulseDot {
  0% { transform: scale(0.9); opacity: 0.6; }
  100% { transform: scale(1.2); opacity: 1; }
}

/* ==========================================================================
   MAIN APP LAYOUT
   ========================================================================== */
.app-layout {
  max-width: 1320px;
  margin: 28px auto;
  padding: 0 24px 60px 24px;
  display: grid;
  grid-template-columns: 310px 1fr;
  gap: 32px;
  align-items: start;
}

/* ==========================================================================
   SIDEBAR
   ========================================================================== */
.app-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 86px;
}

.sidebar-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary-600), #818cf8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

.profile-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.profile-name {
  font-size: 0.96rem;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.profile-club {
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* Navigation Lists */
.sidebar-nav-section {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
}

.nav-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-subtle);
  margin-bottom: 12px;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
}

.nav-item:hover {
  background: var(--bg-surface-2);
  color: var(--text-main);
}

.nav-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-color);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.nav-icon {
  width: 20px;
  display: flex;
  justify-content: center;
  font-size: 0.95rem;
}

.nav-label {
  flex: 1;
}

.nav-badge {
  background: rgba(0, 0, 0, 0.25);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.nav-item.active .nav-badge {
  background: var(--sidebar-active-badge-bg);
  color: var(--sidebar-active-badge-color);
}

/* Topics Section */
.topics-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.topics-section-header .nav-section-title {
  margin-bottom: 0;
}

.text-btn {
  background: none;
  border: none;
  color: var(--primary-500);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.text-btn:hover {
  text-decoration: underline;
}

.topics-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
}

.topic-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--sidebar-tag-bg);
  border: 1px solid var(--sidebar-tag-border);
  border-radius: var(--radius-full);
  padding: 5px 12px;
  color: var(--sidebar-tag-color);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.topic-chip-btn:hover {
  border-color: var(--primary-500);
  color: var(--text-main);
  background: var(--bg-surface-3);
}

.topic-chip-btn.active {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-color);
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  font-weight: 600;
}

.topic-chip-count {
  font-size: 0.72rem;
  opacity: 0.8;
}

.topics-loading-placeholder {
  font-size: 0.82rem;
  color: var(--text-subtle);
  padding: 10px 0;
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

.sidebar-footer .btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-clear-data {
  color: var(--text-muted);
}

.btn-clear-data:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}

/* ==========================================================================
   LIVE ACTIVITY SIMULATOR CARD
   ========================================================================== */
.simulation-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: linear-gradient(145deg, rgba(31, 41, 55, 0.7), rgba(17, 24, 39, 0.9));
  border: 1px solid rgba(6, 182, 212, 0.35);
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.1);
}

[data-theme="light"] .simulation-card {
  background: #ffffff;
  border: 1px solid #e8e2d8;
  box-shadow: 0 2px 8px rgba(100, 80, 60, 0.05);
}

[data-theme="light"] .simulation-card .sim-icon {
  color: #0284c7;
}

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

.sim-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sim-icon {
  color: var(--accent-cyan);
  font-size: 1.15rem;
}

.sim-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.sim-subtitle {
  font-size: 0.7rem;
  color: var(--accent-cyan);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.sim-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.sim-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

/* Switch Toggle UI */
.switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
  flex-shrink: 0;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-surface-3);
  transition: .3s;
}

[data-theme="light"] .slider {
  background-color: #d1c7ba;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
}

input:checked + .slider {
  background-color: var(--accent-cyan);
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.6);
}

[data-theme="light"] input:checked + .slider {
  background-color: #0284c7;
  box-shadow: 0 0 6px rgba(2, 132, 199, 0.4);
}

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

.slider.round {
  border-radius: 20px;
}

.slider.round:before {
  border-radius: 50%;
}

/* ==========================================================================
   MAIN FEED & COMPOSER
   ========================================================================== */
.app-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

/* Composer Card */
.composer-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-normal);
  animation: fadeInDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.composer-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.composer-prompt-icon {
  color: var(--primary-500);
  font-size: 1.1rem;
}

.composer-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Media Tabs */
.media-tabs {
  display: flex;
  background: var(--bg-surface-2);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 4px;
  margin-bottom: 18px;
}

.media-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.media-tab:hover {
  color: var(--text-main);
}

.media-tab.active {
  background: var(--bg-surface-3);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

/* Forms & Inputs */
.composer-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

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

.form-group.flex-1 {
  flex: 1;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.required {
  color: var(--accent-rose);
}

.label-hint {
  font-size: 0.72rem;
  color: var(--text-subtle);
  font-weight: 400;
}

input[type="text"],
input[type="url"],
input[type="password"],
input[type="email"],
textarea,
select {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-main);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
}

[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="url"],
[data-theme="light"] input[type="password"],
[data-theme="light"] input[type="email"],
[data-theme="light"] textarea,
[data-theme="light"] select {
  background: #ffffff;
  border-color: #e5ded4;
  color: #1f2937;
}

input[type="text"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

[data-theme="light"] input[type="text"]:focus,
[data-theme="light"] input[type="url"]:focus,
[data-theme="light"] input[type="password"]:focus,
[data-theme="light"] input[type="email"]:focus,
[data-theme="light"] textarea:focus,
[data-theme="light"] select:focus {
  border-color: #c2410c;
  box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.15);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon i {
  position: absolute;
  left: 14px;
  color: var(--text-subtle);
  font-size: 0.9rem;
}

.input-with-icon input {
  padding-left: 38px;
  width: 100%;
}

.topics-input-wrapper {
  position: relative;
}

.tag-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
  font-size: 0.85rem;
}

.topics-input-wrapper input {
  width: 100%;
  padding-left: 36px;
}

/* Tag Autocomplete Dropdown */
.tag-autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: var(--bg-surface-2, #1f1f23);
  border: 1px solid var(--border-subtle, #333);
  border-radius: var(--radius-md, 8px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
  z-index: 1060;
  padding: 4px;
}

[data-theme="light"] .tag-autocomplete-dropdown {
  background: #ffffff;
  border-color: #dcd6cc;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.tag-autocomplete-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  border-radius: var(--radius-sm, 6px);
  font-size: 0.85rem;
  color: var(--text-normal, #e0e0e0);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
  user-select: none;
}

[data-theme="light"] .tag-autocomplete-item {
  color: #2c2523;
}

.tag-autocomplete-item:hover,
.tag-autocomplete-item.active {
  background: var(--primary-500, #ff5722);
  color: #ffffff !important;
}

.tag-autocomplete-item .tag-item-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.tag-autocomplete-item .tag-item-name i {
  font-size: 0.75rem;
  opacity: 0.7;
}

.tag-autocomplete-item .tag-item-count {
  font-size: 0.72rem;
  opacity: 0.65;
  background: rgba(255, 255, 255, 0.12);
  padding: 2px 6px;
  border-radius: 10px;
}

.tag-autocomplete-item.active .tag-item-count {
  background: rgba(255, 255, 255, 0.25);
  opacity: 0.9;
}

.suggested-topics-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.suggest-label {
  font-size: 0.72rem;
  color: var(--text-subtle);
  font-weight: 500;
}

.chip-suggestion {
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 2px 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.chip-suggestion:hover {
  background: var(--bg-surface-3);
  color: var(--primary-200);
  border-color: var(--primary-500);
}

/* Media Fields Switcher */
.media-fields {
  display: none;
  flex-direction: column;
  gap: 14px;
}

.media-fields.active {
  display: flex;
}

/* Sound Method Selector Tabs (Upload vs Record) */
.sound-method-tabs {
  display: flex;
  background: var(--bg-surface-2);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 4px;
  margin-bottom: 12px;
}

.sound-method-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sound-method-tab:hover {
  color: var(--text-main);
}

.sound-method-tab.active {
  background: var(--bg-surface-3);
  color: var(--accent-cyan);
  box-shadow: var(--shadow-sm);
}

.sound-method-panel {
  display: flex;
  flex-direction: column;
}

.sound-method-panel.hidden {
  display: none !important;
}

/* Live Recording Box */
.record-box {
  background: linear-gradient(145deg, rgba(31, 41, 55, 0.6), rgba(17, 24, 39, 0.8));
  border: 1px solid rgba(244, 63, 94, 0.3);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

[data-theme="light"] .record-box {
  background: var(--bg-surface-2);
  border-color: #ede8e0;
}

.record-visualizer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.record-status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.record-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-subtle);
  transition: all var(--transition-fast);
}

.record-dot.active {
  background: var(--accent-rose);
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.8);
  animation: pulseRecording 1s infinite alternate;
}

@keyframes pulseRecording {
  from { transform: scale(0.9); opacity: 0.7; }
  to { transform: scale(1.3); opacity: 1; }
}

.record-timer {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.3);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

/* Sound Wave Bars during recording */
.record-waveform-bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  height: 36px;
  width: 100%;
  padding: 4px 0;
  opacity: 0.3;
  transition: opacity 0.2s ease;
}

.record-box.is-recording .record-waveform-bars {
  opacity: 1;
}

.rec-bar {
  width: 4px;
  height: 6px;
  background: var(--accent-rose);
  border-radius: 2px;
  transition: height 0.1s ease;
}

.record-box.is-recording .rec-bar:nth-child(2n) { animation: liveWave 0.5s infinite ease-in-out alternate; }
.record-box.is-recording .rec-bar:nth-child(2n+1) { animation: liveWave 0.7s infinite ease-in-out alternate 0.1s; }
.record-box.is-recording .rec-bar:nth-child(3n) { animation: liveWave 0.4s infinite ease-in-out alternate 0.2s; }

@keyframes liveWave {
  0% { height: 6px; }
  100% { height: 32px; }
}

.record-controls-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-record-start {
  background: linear-gradient(135deg, #e11d48, #be123c);
  color: #fff;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.4);
}

.btn-record-start:hover {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  box-shadow: 0 6px 18px rgba(225, 29, 72, 0.5);
}

.btn-record-stop {
  background: #374151;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-record-stop:hover {
  background: #4b5563;
}

.recorded-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--accent-emerald);
  font-weight: 600;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 6px 14px;
  border-radius: var(--radius-full);
}

/* File Drop Zone (Sound Upload) */
.file-drop-zone {
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface-2);
  padding: 22px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
}

[data-theme="light"] .file-drop-zone {
  background: var(--bg-surface-2);
  border-color: #ede8e0;
}

.file-drop-zone:hover,
.file-drop-zone.dragover {
  border-color: var(--primary-500);
  background: rgba(99, 102, 241, 0.08);
}

.file-input-hidden {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.drop-icon {
  font-size: 2rem;
  color: var(--primary-500);
  margin-bottom: 8px;
}

.drop-primary {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.drop-secondary {
  font-size: 0.76rem;
  color: var(--text-subtle);
  margin-top: 4px;
}

.drop-zone-selected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface-2);
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}

.selected-file-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.file-icon {
  font-size: 1.6rem;
  color: var(--accent-cyan);
}

.file-details {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.file-name {
  font-size: 0.88rem;
  font-weight: 600;
}

.file-size {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.local-preview {
  margin-top: 10px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.preview-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 6px;
}

.local-preview audio {
  width: 100%;
  height: 36px;
}

/* Composer Actions */
.composer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.server-waiting-feedback {
  font-size: 0.82rem;
  color: var(--primary-200);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-color);
  box-shadow: var(--btn-primary-shadow);
}

.btn-primary:hover {
  background: var(--btn-primary-hover);
  box-shadow: var(--btn-primary-shadow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-surface-2);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

[data-theme="light"] .btn-secondary {
  background: #ffffff;
  color: #1f2937;
  border-color: #eae3d7;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.btn-secondary:hover {
  background: var(--bg-surface-3);
  border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="light"] .btn-secondary:hover {
  background: #fbf9f5;
  border-color: #c2410c;
  color: #c2410c;
}

.btn-subtle {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid transparent;
}

[data-theme="light"] .btn-subtle {
  background: transparent;
  color: #6b7280;
}

.btn-subtle:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

[data-theme="light"] .btn-subtle:hover {
  background: #f0ebe1;
  color: #1f2937;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
}

.btn-xs {
  padding: 4px 10px;
  font-size: 0.74rem;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  background: var(--bg-surface-3);
  color: var(--text-main);
}

.btn-icon.danger:hover {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* ==========================================================================
   FILTER BANNER
   ========================================================================== */
.filter-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-md);
  padding: 10px 16px;
}

[data-theme="light"] .filter-banner {
  background: #fff7ed;
  border-color: #fed7aa;
}

[data-theme="light"] .filter-info {
  color: #c2410c;
}

.filter-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--primary-200);
}

.filter-chip {
  background: var(--primary-600);
  color: #fff;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.8rem;
}

.filter-count {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ==========================================================================
   POSTS STREAM & POST CARD
   ========================================================================== */
.posts-stream {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.post-card {
  background: var(--post-card-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--post-card-border);
  border-radius: var(--post-card-radius);
  padding: 22px;
  box-shadow: var(--post-card-shadow);
  transition: border-color var(--transition-fast), transform var(--transition-fast), background-color var(--transition-normal);
}

.post-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

[data-theme="light"] .post-card:hover {
  border-color: #dfd7cc;
}

.post-card.post-newly-added {
  animation: highlightNewPost 2.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes highlightNewPost {
  0% {
    opacity: 0;
    transform: translateY(-16px) scale(0.98);
    border-color: rgba(99, 102, 241, 0.9);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
  }
  30% {
    opacity: 1;
    transform: translateY(0) scale(1);
    border-color: rgba(6, 182, 212, 0.8);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.3);
  }
  100% {
    border-color: var(--border-subtle);
    box-shadow: var(--shadow-sm);
  }
}

/* Post Header */
.post-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.post-author-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.post-author-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.88rem;
  color: #fff;
  box-shadow: var(--shadow-sm);
}

[data-theme="light"] .post-author-avatar {
  background: var(--avatar-default-bg) !important;
  color: #ffffff;
}

.post-author-meta {
  display: flex;
  flex-direction: column;
}

.post-author-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.post-author-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
}

.post-author-club {
  font-size: 0.74rem;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 500;
}

.post-timestamp {
  font-size: 0.76rem;
  color: var(--text-subtle);
  cursor: help;
}

/* Post Type Badge */
.post-header-badges {
  display: flex;
  align-items: center;
  gap: 8px;
}

.media-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.media-badge.badge-text {
  background: var(--post-type-badge-bg);
  color: var(--post-type-badge-color);
  border: 1px solid var(--post-type-badge-border);
}

.media-badge.badge-link {
  background: rgba(6, 182, 212, 0.15);
  color: #67e8f9;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

[data-theme="light"] .media-badge.badge-link {
  background: #f0f9ff;
  color: #0284c7;
  border-color: #bae6fd;
}

.media-badge.badge-sound {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

[data-theme="light"] .media-badge.badge-sound {
  background: #ecfdf5;
  color: #059669;
  border-color: #a7f3d0;
}

.media-badge.badge-file {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

[data-theme="light"] .media-badge.badge-file {
  background: #fffbeb;
  color: #d97706;
  border-color: #fde68a;
}

/* Post Content Sections */
.post-content {
  margin-bottom: 16px;
}

.post-headline {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-main);
  font-family: var(--font-headline);
  margin-bottom: 10px;
}

[data-theme="light"] .post-headline {
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
  letter-spacing: -0.01em;
}

.post-body-text {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
  white-space: pre-wrap;
}

[data-theme="light"] .post-body-text {
  color: #4b5563;
}

/* Link Post Presentation */
.link-preview-box {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.link-preview-box:hover {
  background: var(--bg-surface-3);
  border-color: var(--primary-500);
  transform: translateY(-1px);
}

.link-preview-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

.link-preview-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
}

.link-preview-url {
  font-size: 0.76rem;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-preview-arrow {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ==========================================================================
   SOUND PLAYING WIDGET (Dedicated Audio Controller)
   ========================================================================== */
.sound-widget-container {
  background: linear-gradient(145deg, #161f30, #131a29);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

.sound-widget-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sound-meta-left {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.sound-waveform-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.sound-original-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sound-file-specs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sound-codec-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-emerald);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.sound-size-tag {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Audio Player Controls Bar */
.sound-controls-bar {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sound-play-toggle-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-emerald), #059669);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.sound-play-toggle-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.5);
}

/* Visualizer Bars Animation */
.sound-visualizer {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 24px;
  padding: 0 4px;
}

.viz-bar {
  width: 3px;
  height: 4px;
  background: var(--accent-emerald);
  border-radius: 2px;
  transition: height 0.15s ease;
}

.sound-widget-container.is-playing .viz-bar:nth-child(1) { animation: soundBar 0.6s infinite ease-in-out alternate; }
.sound-widget-container.is-playing .viz-bar:nth-child(2) { animation: soundBar 0.9s infinite ease-in-out alternate 0.1s; }
.sound-widget-container.is-playing .viz-bar:nth-child(3) { animation: soundBar 0.5s infinite ease-in-out alternate 0.2s; }
.sound-widget-container.is-playing .viz-bar:nth-child(4) { animation: soundBar 0.8s infinite ease-in-out alternate 0.3s; }
.sound-widget-container.is-playing .viz-bar:nth-child(5) { animation: soundBar 0.7s infinite ease-in-out alternate 0.15s; }

@keyframes soundBar {
  0% { height: 4px; }
  100% { height: 22px; }
}

/* Scrubber / Progress Bar */
.sound-scrubber-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sound-scrub-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--bg-surface-3);
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
  transition: background 0.15s;
}

.sound-scrub-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
  cursor: pointer;
  transition: transform 0.1s;
}

.sound-scrub-slider::-webkit-slider-thumb:hover {
  transform: scale(1.3);
}

.sound-time-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Secondary Audio Tools */
.sound-extra-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sound-download-link {
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 6px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.sound-download-link:hover {
  color: var(--accent-emerald);
}

/* ==========================================================================
   DOCUMENT / FILE WIDGET
   ========================================================================== */
.file-widget-container {
  background: linear-gradient(145deg, #181d29, #131722);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
  margin-top: 12px;
}

[data-theme="light"] .file-widget-container {
  background: #fdfbf7;
  border-color: #fde68a;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.file-widget-left {
  display: flex;
  align-items: center;
  gap: 14px;
  overflow: hidden;
  flex: 1;
}

.file-type-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}

.file-type-icon.has-thumb {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0;
  cursor: pointer;
}

.file-thumbnail-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
  transition: transform 0.2s ease;
}

.file-type-icon.has-thumb:hover .file-thumbnail-img {
  transform: scale(1.08);
}

.file-type-icon.pdf {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.file-widget-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

.file-widget-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-widget-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.file-badge-format {
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-mono);
  text-transform: uppercase;
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.file-badge-size {
  font-size: 0.75rem;
  color: var(--text-muted);
}

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

.file-view-btn,
.file-download-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   POST FOOTER & TOPICS
   ========================================================================== */
.post-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  gap: 12px;
}

.post-topics-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.post-tag {
  background: var(--post-tag-bg);
  color: var(--post-tag-color);
  border: 1px solid var(--post-tag-border);
  border-radius: var(--radius-full);
  padding: 3px 10px;
  font-size: 0.75rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.post-tag:hover {
  background: var(--bg-surface-2);
  color: var(--text-main);
  border-color: var(--border-focus);
}
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.post-tag:hover {
  background: var(--primary-600);
  color: #fff;
  border-color: transparent;
  transform: translateY(-1px);
}

.post-action-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Like & Bookmark button styling */
.btn-icon.like-post-btn {
  color: var(--text-muted);
  transition: transform 0.15s ease, color 0.15s ease;
}
.btn-icon.like-post-btn:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
}
.btn-icon.like-post-btn.liked {
  color: #ef4444 !important;
}
.btn-icon.like-post-btn.liked i,
.btn-icon.like-post-btn.liked .liked-icon {
  color: #ef4444 !important;
}

.btn-icon.bookmark-post-btn {
  color: var(--text-muted);
  transition: transform 0.15s ease, color 0.15s ease;
}
.btn-icon.bookmark-post-btn:hover {
  color: #eab308;
  background: rgba(234, 179, 8, 0.12);
}
.btn-icon.bookmark-post-btn.bookmarked {
  color: #eab308 !important;
}
.btn-icon.bookmark-post-btn.bookmarked i,
.btn-icon.bookmark-post-btn.bookmarked .bookmarked-icon {
  color: #eab308 !important;
}

.btn-icon.link-post-btn {
  color: var(--text-muted);
  transition: transform 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.btn-icon.link-post-btn:hover {
  color: var(--primary-500, #6366f1);
  background: rgba(99, 102, 241, 0.12);
}

.btn-icon.comment-toggle-btn {
  color: var(--text-muted);
  transition: transform 0.15s ease, color 0.15s ease, background 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: auto;
  padding: 0 8px;
}
.btn-icon.comment-toggle-btn:hover,
.btn-icon.comment-toggle-btn.active {
  color: #06b6d4;
  background: rgba(6, 182, 212, 0.12);
}
.comment-count-badge {
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}

/* Post Direct Link Target Highlight */
.post-card.post-targeted {
  border-color: var(--primary-500, #6366f1) !important;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.4), var(--shadow-md) !important;
  animation: pulseTargetPost 3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pulseTargetPost {
  0% {
    transform: scale(0.99);
    box-shadow: 0 0 24px rgba(99, 102, 241, 0.7);
  }
  30% {
    transform: scale(1.01);
    box-shadow: 0 0 28px rgba(6, 182, 212, 0.6);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.4), var(--shadow-md);
  }
}

/* Threaded Comments & Replies Section */
.post-comments-section {
  border-top: 1px solid var(--border-subtle);
  padding: 16px 20px 20px 20px;
  background: var(--bg-surface-2, rgba(255, 255, 255, 0.02));
  border-bottom-left-radius: var(--radius-lg, 12px);
  border-bottom-right-radius: var(--radius-lg, 12px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.comments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.comments-header h4 {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}
.comments-header h4 i {
  color: #06b6d4;
  font-size: 0.85rem;
}

.comments-tree {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.comment-item {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md, 8px);
  padding: 12px 14px;
  position: relative;
  transition: border-color 0.15s ease;
}
.comment-item:hover {
  border-color: var(--border-focus, rgba(99, 102, 241, 0.3));
}

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

.comment-author-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.comment-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  flex-shrink: 0;
}

.comment-author-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
}

.comment-author-org {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.comment-time {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.comment-body {
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text-main);
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 8px;
}

.comment-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 4px;
}

.comment-action-btn {
  background: transparent;
  border: none;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
}
.comment-action-btn:hover {
  color: var(--primary-500, #6366f1);
  background: rgba(99, 102, 241, 0.08);
}
.comment-action-btn.delete-comment-btn:hover {
  color: var(--accent-rose, #ef4444);
  background: rgba(239, 68, 68, 0.08);
}

/* Threaded Nested Replies */
.comment-replies {
  margin-top: 10px;
  padding-left: 14px;
  border-left: 2px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comment-reply-form-container {
  margin-top: 8px;
  padding: 10px;
  background: var(--bg-surface-2, rgba(255, 255, 255, 0.04));
  border-radius: var(--radius-sm, 6px);
  border: 1px dashed var(--border-subtle);
}

/* Add Comment / Reply Inputs */
.comment-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.comment-textarea {
  width: 100%;
  min-height: 60px;
  padding: 8px 12px;
  font-size: 0.84rem;
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm, 6px);
  color: var(--text-main);
  resize: vertical;
  font-family: inherit;
  box-sizing: border-box;
}
.comment-textarea:focus {
  outline: none;
  border-color: var(--primary-500, #6366f1);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.comment-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.comments-empty-notice {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  padding: 8px 0;
}

@keyframes popHeart {
  0% { transform: scale(1); }
  50% { transform: scale(1.35); }
  100% { transform: scale(1); }
}
.like-post-btn.liked i {
  animation: popHeart 0.25s ease-out;
}

@keyframes popBookmark {
  0% { transform: scale(1); }
  50% { transform: scale(1.35); }
  100% { transform: scale(1); }
}
.bookmark-post-btn.bookmarked i {
  animation: popBookmark 0.25s ease-out;
}

/* ==========================================================================
   EMPTY STATE & SKELETON LOADERS
   ========================================================================== */
.empty-state {
  background: var(--bg-card);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.empty-icon {
  font-size: 2.5rem;
  color: var(--text-subtle);
  margin-bottom: 4px;
}

.empty-state h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.empty-state p {
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: 440px;
  line-height: 1.5;
}

/* Skeleton Loading */
.skeleton-container {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.post-skeleton {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.skeleton-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.skeleton-circle {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-2);
  animation: skeletonPulse 1.2s infinite ease-in-out;
}

.skeleton-lines {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.skeleton-line {
  height: 12px;
  background: var(--bg-surface-2);
  border-radius: var(--radius-sm);
  animation: skeletonPulse 1.2s infinite ease-in-out;
}

.skeleton-line.short { width: 35%; }
.skeleton-line.tiny { width: 20%; height: 10px; }
.skeleton-line.medium { width: 65%; height: 16px; }
.skeleton-line.full { width: 100%; }

@keyframes skeletonPulse {
  0% { opacity: 0.5; }
  50% { opacity: 0.9; }
  100% { opacity: 0.5; }
}

/* ==========================================================================
   MODAL DIALOG (EDIT POST)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-card {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(99, 102, 241, 0.15);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: scaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

.modal-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-icon {
  font-size: 1.4rem;
  color: var(--primary-500);
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
}

.modal-subtitle {
  font-size: 0.76rem;
  color: var(--accent-cyan);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.edit-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.edit-media-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.current-audio-info {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 0.82rem;
  color: var(--text-main);
  margin-bottom: 6px;
}

.current-audio-info i {
  color: var(--accent-emerald);
}

.badge-keep {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.file-drop-zone.small {
  padding: 12px;
}

.drop-icon-sm {
  font-size: 1.2rem;
  color: var(--primary-500);
  margin-right: 6px;
}

.drop-primary-sm {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.replacement-note {
  font-size: 0.76rem;
  color: var(--accent-emerald);
  margin-top: 4px;
  font-weight: 600;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 6px;
}

.btn-icon.edit-post-btn:hover {
  color: var(--primary-500);
}

/* ==========================================================================
   AUTHENTICATION & USER SESSION UI
   ========================================================================== */
.header-auth-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  padding: 4px 10px 4px 6px;
  border-radius: var(--radius-full);
}

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

[data-theme="light"] .header-user-avatar {
  background: var(--avatar-default-bg);
}

.header-user-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Composer Logged-In Author Badge */
.composer-author-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}

[data-theme="light"] .composer-author-badge {
  background: #fbf9f5;
  border-color: #ede8e0;
}

.author-badge-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.composer-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary-600), var(--accent-cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
}

[data-theme="light"] .composer-user-avatar {
  background: var(--avatar-default-bg);
}

.composer-user-details {
  display: flex;
  flex-direction: column;
}

.composer-user-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
}

.composer-user-org {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.author-badge-tag {
  font-size: 0.74rem;
  color: var(--accent-emerald);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Auth Modal Card */
.auth-modal-card {
  max-width: 480px;
}

.auth-icon-badge {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary-600), var(--accent-cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #fff;
}

.auth-tabs {
  display: flex;
  background: var(--bg-surface-2);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 4px;
}

.auth-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.auth-tab.active {
  background: var(--bg-surface-3);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-form.hidden {
  display: none !important;
}

.auth-actions {
  padding-top: 10px;
  border-top: none;
}

.btn-full {
  width: 100%;
  padding: 11px;
  font-size: 0.94rem;
}

.auth-switch-prompt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.text-link-btn {
  background: none;
  border: none;
  color: var(--primary-500);
  font-weight: 600;
  cursor: pointer;
  font-size: 0.82rem;
  padding: 0;
}

.text-link-btn:hover {
  text-decoration: underline;
}

.auth-info-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.76rem;
  color: var(--accent-cyan);
  line-height: 1.4;
}

.demo-credentials-helper {
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.helper-label {
  font-size: 0.74rem;
  color: var(--text-subtle);
}

.btn-demo-creds {
  background: none;
  border: none;
  color: var(--accent-emerald);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-demo-creds:hover {
  text-decoration: underline;
}

/* Utility classes */
.hidden {
  display: none !important;
}

/* ==========================================================================
   MULTI-TENANT ORGANIZATION WORKSPACE & SWITCHER
   ========================================================================== */
.brand-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.org-switcher-wrapper {
  position: relative;
}

.org-switcher-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  padding: 6px 14px 6px 8px;
  color: var(--text-main);
  cursor: pointer;
  transition: all var(--transition-fast);
  max-width: 320px;
}

[data-theme="light"] .org-switcher-btn {
  background: #ffffff;
  border-color: #eae3d7;
  color: #1f2937;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.org-switcher-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .org-switcher-btn:hover {
  background: #fbf9f5;
  border-color: #c2410c;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.org-switcher-btn:focus-visible {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.org-badge-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(6, 182, 212, 0.2));
  border: 1px solid rgba(99, 102, 241, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  color: #818cf8;
  flex-shrink: 0;
}

[data-theme="light"] .org-badge-icon {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #c2410c;
}

.org-switcher-info {
  display: flex;
  flex-direction: column;
  text-align: left;
  overflow: hidden;
}

.org-switcher-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1;
}

.org-switcher-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}

[data-theme="light"] .org-switcher-name {
  color: #1f2937;
}

.org-switcher-chevron {
  font-size: 0.72rem;
  color: var(--text-subtle);
  transition: transform var(--transition-fast);
  margin-left: 2px;
}

.org-switcher-wrapper.open .org-switcher-chevron {
  transform: rotate(180deg);
}

.superuser-badge {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(239, 68, 68, 0.25));
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fcd34d;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}

[data-theme="light"] .superuser-badge {
  background: #fef3c7;
  border-color: #fde68a;
  color: #b45309;
  box-shadow: none;
}

/* Organization Dropdown Menu */
.org-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 330px;
  background: var(--bg-surface-1);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
  z-index: 1050;
  padding: 6px 0;
  animation: modalScaleUp 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] .org-dropdown-menu {
  background: #ffffff;
  border-color: #eae3d7;
  box-shadow: 0 10px 30px rgba(100, 80, 60, 0.12), 0 1px 4px rgba(0, 0, 0, 0.05);
}

.org-dropdown-header {
  padding: 10px 16px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.org-dropdown-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

.dropdown-heading {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.org-count-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
}

.org-access-hint {
  font-size: 0.72rem;
  color: var(--text-subtle);
  display: block;
}

.org-list {
  max-height: 290px;
  overflow-y: auto;
  padding: 4px 0;
}

.org-item-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition-fast);
  color: inherit;
}

.org-item-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .org-item-btn:hover {
  background: #f5f0e8;
}

.org-item-btn.active {
  background: rgba(99, 102, 241, 0.14);
  border-left: 3px solid var(--primary-500);
}

[data-theme="light"] .org-item-btn.active {
  background: #fff7ed;
  border-left: 3px solid #c2410c;
}

.org-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}

.org-item-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  color: #93c5fd;
  flex-shrink: 0;
}

.org-item-icon.private-org-icon {
  background: rgba(139, 92, 246, 0.2);
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.35);
}

.org-item-btn.active .org-item-icon {
  background: var(--primary-600);
  color: #ffffff;
}

.org-item-btn.active .org-item-icon.private-org-icon {
  background: linear-gradient(135deg, #7c3aed, #9333ea);
  color: #ffffff;
  border-color: rgba(192, 132, 252, 0.5);
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.4);
}

.org-item-details {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
}

.org-item-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.org-item-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.private-badge {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.18);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.private-badge i {
  font-size: 0.6rem;
}

.org-item-meta {
  font-size: 0.72rem;
  color: var(--text-subtle);
  display: flex;
  gap: 8px;
}

.org-item-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: 8px;
}

.org-item-settings-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all var(--transition-fast);
  opacity: 0.6;
}

.org-item-btn:hover .org-item-settings-btn,
.org-item-settings-btn:hover {
  opacity: 1;
}

.org-item-settings-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--primary-500);
  transform: rotate(30deg);
}

[data-theme="light"] .org-item-settings-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #c2410c;
}

.org-item-check {
  color: var(--accent-emerald);
  font-size: 0.9rem;
}

.org-dropdown-footer {
  padding: 8px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Sidebar Organization Banner Card */
.org-banner-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.9));
  border: 1px solid rgba(99, 102, 241, 0.3);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  padding: 16px;
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
}

.org-banner-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.org-banner-icon-box {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary-600), var(--accent-cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.35);
}

.org-banner-titles {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.org-badge-tag {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-emerald);
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 4px;
}

.org-banner-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.25;
}

.org-banner-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 12px;
}

.org-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.74rem;
  color: var(--text-subtle);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 10px;
}

.org-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.org-meta-item i {
  color: #818cf8;
}

/* Demo Logins Grid */
.demo-login-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-top: 6px;
}

.form-select {
  width: 100%;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-select:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* ==========================================================================
   RESPONSIVENESS
   ========================================================================== */
@media (max-width: 960px) {
  .app-layout {
    grid-template-columns: 1fr;
    margin: 16px auto;
    padding: 0 16px 40px 16px;
    gap: 20px;
  }

  .app-sidebar {
    position: static;
  }

  .search-bar-wrapper {
    display: none; /* Collapsed for small screen real-estate */
  }

  .org-switcher-name {
    max-width: 110px;
  }
}

@media (max-width: 600px) {
  .header-container {
    padding: 10px 14px;
    gap: 8px;
  }

  .brand-tagline {
    display: none;
  }

  .org-switcher-name {
    display: none;
  }

  .theme-toggle-btn {
    padding: 2px;
  }

  .theme-toggle-track {
    width: 44px;
    height: 24px;
  }

  .theme-toggle-thumb {
    width: 18px;
    height: 18px;
  }

  [data-theme="light"] .theme-toggle-thumb {
    transform: translateX(20px);
  }

  .composer-card {
    padding: 16px;
  }

  .form-row.author-row {
    flex-direction: column;
  }

  .post-card {
    padding: 16px;
  }

  .sound-controls-bar {
    flex-wrap: wrap;
  }
}

/* ==========================================================================
   USER PROFILE & SUPERUSER USER MANAGEMENT STYLES
   ========================================================================== */

/* Superuser button styling */
.btn-superuser {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #c084fc;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.btn-superuser:hover {
  background: rgba(168, 85, 247, 0.28);
  border-color: rgba(168, 85, 247, 0.7);
  color: #f3e8ff;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.35);
}

.clickable {
  cursor: pointer;
  user-select: none;
  transition: transform var(--transition-fast), filter var(--transition-fast);
}

.clickable:hover {
  filter: brightness(1.18);
  transform: translateY(-1px);
}

/* Profile Card in Sidebar */
.profile-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-edit-pill {
  margin-top: 10px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.profile-edit-pill:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
  color: #818cf8;
}

/* Superuser Administration Section in Sidebar */
.superuser-admin-card {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.08), rgba(99, 102, 241, 0.04));
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-top: 0;
}

[data-theme="light"] .superuser-admin-card {
  background: #ffffff;
  border: 1px solid #e8e2d8;
  box-shadow: 0 2px 8px rgba(100, 80, 60, 0.05);
}

.superuser-card-header {
  margin-bottom: 10px;
}

.superuser-actions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Share View Card in Sidebar (Between Superuser Admin and Feeds) */
.share-view-card {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(14, 165, 233, 0.04));
  border: 1px solid rgba(59, 130, 246, 0.22);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

[data-theme="light"] .share-view-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(100, 80, 60, 0.05);
}

.share-view-card-header {
  display: flex;
  align-items: center;
}

.share-view-badge {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(14, 165, 233, 0.2));
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #60a5fa;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

[data-theme="light"] .share-view-badge {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.share-view-description {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.share-view-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ==========================================================================
   MY PROFILE MODAL
   ========================================================================== */
.profile-modal-card {
  max-width: 660px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 26px;
  box-shadow: var(--shadow-xl);
}

.profile-header-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  margin-bottom: 22px;
}

.profile-header-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.35rem;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.profile-header-info {
  flex: 1;
  min-width: 0;
}

.profile-header-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.profile-header-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.profile-header-email {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 8px;
}

.profile-header-orgs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

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

.badge-purple {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.badge-org-pill {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.profile-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.form-group-full {
  grid-column: span 2;
}

/* Accordion for Password Change */
.profile-password-section {
  margin: 18px 0;
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}

.btn-accordion-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-accordion-toggle:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.profile-password-fields {
  padding: 0 16px 16px 16px;
  border-top: 1px solid var(--border-subtle);
}

/* ==========================================================================
   SUPERUSER USER MANAGEMENT MODAL & DIRECTORY TABLE
   ========================================================================== */
.users-mgmt-modal-card {
  max-width: 1050px;
  width: 95%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-xl);
}

.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.users-mgmt-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.users-mgmt-search {
  position: relative;
  flex: 1;
  max-width: 450px;
}

.users-mgmt-search i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.users-mgmt-search input {
  width: 100%;
  padding: 8px 14px 8px 34px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 0.82rem;
  outline: none;
}

.users-mgmt-search input:focus {
  border-color: #6366f1;
  background: rgba(255, 255, 255, 0.08);
}

.users-mgmt-table-container {
  flex: 1;
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(90vh - 210px);
  margin-top: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: rgba(0, 0, 0, 0.2);
}

.users-mgmt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  text-align: left;
}

.users-mgmt-table th {
  padding: 12px 16px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 2;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.users-mgmt-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

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

.user-cell-member {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-table-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  flex-shrink: 0;
}

.user-cell-name {
  font-weight: 600;
  color: var(--text-primary);
  display: block;
}

.user-cell-email {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
}

.user-cell-phone {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.user-cell-title {
  font-weight: 500;
  color: var(--text-primary);
  display: block;
}

.user-cell-org {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.user-workspaces-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 220px;
}

.text-right {
  text-align: right;
}

/* ==========================================================================
   EDIT / ADD USER MODAL
   ========================================================================== */
.edit-user-modal-card {
  max-width: 680px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 26px;
  box-shadow: var(--shadow-xl);
}

.superuser-checkbox-card {
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin: 16px 0;
}

.custom-checkbox-container {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.custom-checkbox-container input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: #a855f7;
  cursor: pointer;
}

.checkbox-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.checkbox-title {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-primary);
}

.checkbox-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.section-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  display: block;
}

.org-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.org-checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.org-checkbox-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.org-checkbox-item input[type="checkbox"] {
  accent-color: #6366f1;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

@media (max-width: 640px) {
  .profile-form-grid {
    grid-template-columns: 1fr;
  }
  .form-group-full {
    grid-column: span 1;
  }
  .users-mgmt-table th:nth-child(2),
  .users-mgmt-table td:nth-child(2),
  .users-mgmt-table th:nth-child(3),
  .users-mgmt-table td:nth-child(3) {
    display: none;
  }
}

/* User Disable / Status Styles */
.user-row-disabled td {
  background: rgba(239, 68, 68, 0.035);
  opacity: 0.75;
}

.user-row-disabled:hover td {
  background: rgba(239, 68, 68, 0.07) !important;
  opacity: 1;
}

.user-row-disabled .user-cell-name {
  text-decoration: line-through;
  color: var(--text-muted);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.badge-success-subtle {
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.text-danger {
  color: #f87171 !important;
}

.user-disabled-meta {
  font-size: 0.72rem;
  color: #f87171;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
}

.user-status-checkbox-card {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin: 16px 0;
}

.custom-checkbox-container input[type="checkbox"].checkmark-danger,
.user-status-checkbox-card input[type="checkbox"] {
  accent-color: #ef4444;
}

.btn-outline-danger {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #f87171;
}

.btn-outline-danger:hover {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.7);
}

.btn-outline-success {
  background: transparent;
  border: 1px solid rgba(34, 197, 94, 0.45);
  color: #4ade80;
}

.btn-outline-success:hover {
  background: rgba(34, 197, 94, 0.18);
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.7);
}

/* Organization Members & Access Modal Styles */
.org-members-modal-card {
  max-width: 860px;
  width: 95%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.org-members-info-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
}

.org-members-info-text {
  flex: 1;
}

.org-banner-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.org-members-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.org-settings-drawer {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
  animation: fadeIn 0.2s ease-in-out;
}

.org-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.org-settings-header h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.org-settings-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.org-danger-zone-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.org-members-info-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary, #6366f1));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #fff;
  flex-shrink: 0;
}

.org-members-info-text h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.org-members-info-text p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

.org-invite-box {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 24px;
}

.org-invite-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.org-invite-inputs {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.flex-align-end {
  display: flex;
  align-items: flex-end;
}

.org-members-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 16px;
}

.org-members-search {
  position: relative;
  flex: 1;
  max-width: 380px;
}

.org-members-search i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.org-members-search input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.85rem;
}

.member-role-select {
  padding: 4px 8px;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.btn-transfer-owner {
  color: #fbbf24;
}

.btn-transfer-owner:hover {
  background: rgba(251, 191, 36, 0.15);
  color: #fde047;
}
