/* ===================================================================
   MAXEK WORKSPACE - Modern Enterprise Design System & WhatsApp Theme
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@500;600;700;800&display=swap');

:root {
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Outfit', sans-serif;

  /* Color Palette - Dark Slate & WhatsApp Emerald */
  --bg-app: #0b0e14;
  --bg-sidebar: #111622;
  --bg-chat: #0d121d;
  --bg-card: #182030;
  --bg-card-hover: #1f2a3e;
  --bg-input: #1a2233;

  /* Primary WhatsApp Emerald Accents */
  --primary: #10b981;
  --primary-hover: #059669;
  --primary-glow: rgba(16, 185, 129, 0.25);
  --primary-light: #34d399;

  /* Secondary Accents */
  --accent-cyan: #06b6d4;
  --accent-purple: #8b5cf6;
  --accent-rose: #f43f5e;
  --accent-amber: #f59e0b;

  /* Text Colors */
  --text-main: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;

  /* Borders & Dividers */
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.16);

  /* Message Bubble Colors */
  --bubble-incoming: #1e2638;
  --bubble-outgoing: #064e3b;
  --bubble-outgoing-border: rgba(16, 185, 129, 0.3);

  /* Shadows & Glassmorphism */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
  --glass-bg: rgba(22, 29, 44, 0.85);
  --glass-blur: blur(12px);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --transition-fast: 0.15s ease;
  --transition-smooth: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Resets */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-app);
  color: var(--text-main);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  -webkit-font-smoothing: antialiased;
}

/* Layout Container */
.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  position: relative;
  overflow: hidden;
}

/* ===================================================================
   1. LEFT SIDEBAR
   =================================================================== */

.app-sidebar {
  width: 360px;
  min-width: 320px;
  max-width: 420px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  z-index: 10;
}

/* Sidebar Top Profile & User Switcher */
.sidebar-header {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  background-color: rgba(17, 22, 34, 0.95);
}

.current-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar-wrapper {
  position: relative;
  width: 44px;
  height: 44px;
}

.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary);
}

.status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--primary);
  border: 2px solid var(--bg-sidebar);
}

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

.user-display-name {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
}

.role-tag-super {
  font-size: 11px;
  color: var(--primary-light);
  font-weight: 600;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Switch User Dropdown */
.switcher-bar {
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.switcher-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.active-user-select {
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 12px;
  font-family: var(--font-main);
  cursor: pointer;
  outline: none;
}

.active-user-select:focus {
  border-color: var(--primary);
}

/* Header Action Buttons */
.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

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

.icon-btn.primary {
  color: var(--primary);
}

.icon-btn.primary:hover {
  background: var(--primary-glow);
}

/* Search Bar */
.sidebar-search-box {
  padding: 12px 16px;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 0 12px;
  transition: var(--transition-fast);
}

.search-input-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.search-icon {
  color: var(--text-muted);
  margin-right: 8px;
}

.search-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 13px;
  padding: 8px 0;
}

.search-input::placeholder {
  color: var(--text-muted);
}

/* Filter Pills */
.filter-tabs-row {
  display: flex;
  gap: 6px;
  padding: 0 16px 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-tabs-row::-webkit-scrollbar {
  display: none;
}

.filter-tab-pill {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition-fast);
}

.filter-tab-pill:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.filter-tab-pill.active {
  background: var(--primary);
  color: #04241a;
  font-weight: 600;
  border-color: var(--primary);
}

/* Conversation List */
.conversations-container {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.conversation-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  gap: 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: var(--transition-fast);
}

.conversation-item:hover {
  background: var(--bg-card);
}

.conversation-item.active {
  background: var(--bg-card-hover);
  border-left: 3px solid var(--primary);
}

.conv-avatar-wrapper {
  position: relative;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.conv-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.conv-status-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--bg-sidebar);
}

.conv-body {
  flex: 1;
  min-width: 0;
}

.conv-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}

.conv-title {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-time {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.conv-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.conv-preview {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.conv-pin-icon {
  font-size: 12px;
  opacity: 0.7;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 40px 20px;
}

/* ===================================================================
   2. MAIN CHAT AREA
   =================================================================== */

.app-main-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-chat);
  position: relative;
  height: 100%;
  min-width: 0;
}

/* Top Chat Header */
.chat-header {
  height: 64px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-color);
  z-index: 5;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.header-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
}

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

.header-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.header-subtitle {
  font-size: 12px;
  color: var(--primary-light);
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-call-action {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 7px 14px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-call-action:hover {
  background: var(--primary);
  color: #04241a;
  border-color: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
}

/* AI Quick Action Chips Bar */
.ai-quick-bar {
  background: rgba(16, 185, 129, 0.08);
  border-bottom: 1px solid rgba(16, 185, 129, 0.15);
  padding: 8px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
}

.ai-bar-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-light);
  white-space: nowrap;
}

.ai-chip-prompt {
  background: var(--bg-card);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--text-main);
  border-radius: var(--radius-full);
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-fast);
}

.ai-chip-prompt:hover {
  background: var(--primary-glow);
  border-color: var(--primary);
  transform: translateY(-1px);
}

/* Message Stream Container */
.messages-stream-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 24px 24px;
}

.chat-date-divider {
  display: flex;
  justify-content: center;
  margin: 10px 0;
}

.chat-date-divider span {
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  text-transform: uppercase;
}

.chat-system-message {
  display: flex;
  justify-content: center;
  margin: 6px 0;
}

.chat-system-message span {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  font-size: 12px;
  padding: 4px 16px;
  border-radius: var(--radius-full);
}

/* Message Bubbles */
.message-bubble-wrapper {
  display: flex;
  width: 100%;
}

.message-bubble-wrapper.incoming {
  justify-content: flex-start;
}

.message-bubble-wrapper.outgoing {
  justify-content: flex-end;
}

.message-bubble {
  max-width: 68%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  position: relative;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.message-bubble-wrapper.incoming .message-bubble {
  background-color: var(--bubble-incoming);
  color: var(--text-main);
  border-top-left-radius: 2px;
  border: 1px solid var(--border-color);
}

.message-bubble-wrapper.outgoing .message-bubble {
  background-color: var(--bubble-outgoing);
  color: #ecfdf5;
  border-top-right-radius: 2px;
  border: 1px solid var(--bubble-outgoing-border);
}

.message-sender-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 6px;
}

.sender-role-tag {
  font-size: 9px;
  background: rgba(6, 182, 212, 0.2);
  color: var(--accent-cyan);
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.message-text {
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}

.message-text code {
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 13px;
}

/* Image Card */
.message-image-card {
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-top: 4px;
}

.msg-image-thumb {
  max-width: 100%;
  max-height: 320px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: block;
  transition: transform 0.2s ease;
}

.msg-image-thumb:hover {
  transform: scale(1.02);
}

.msg-caption {
  font-size: 13px;
  margin-top: 6px;
  color: var(--text-main);
}

/* File / Document Card */
.message-file-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.25);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.file-icon-box {
  font-size: 24px;
}

.file-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.file-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.file-size {
  font-size: 11px;
  color: var(--text-muted);
}

.btn-download-file {
  background: var(--bg-card);
  color: var(--primary);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: bold;
  border: 1px solid var(--border-color);
  transition: var(--transition-fast);
}

.btn-download-file:hover {
  background: var(--primary);
  color: #04241a;
}

/* AI Intelligence Card */
.message-ai-card {
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: var(--radius-md);
  padding: 12px;
}

.ai-badge-header {
  font-size: 12px;
  font-weight: 700;
  color: #c4b5fd;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ai-body-text {
  font-size: 13.5px;
  line-height: 1.6;
  color: #f3f4f6;
}

/* Voice Note Player */
.voice-note-player {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 260px;
  padding: 6px 4px;
}

.voice-play-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary);
  color: #04241a;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.voice-play-btn:hover {
  transform: scale(1.08);
}

.voice-waveform-container {
  flex: 1;
  position: relative;
  height: 32px;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.voice-waveform-bars {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 100%;
  width: 100%;
}

.waveform-bar {
  flex: 1;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 2px;
  transition: background 0.1s;
}

.voice-note-player.playing .waveform-bar {
  background: var(--primary-light);
}

.voice-waveform-progress {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  background: rgba(16, 185, 129, 0.35);
  border-radius: 4px;
  pointer-events: none;
}

.voice-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.voice-duration {
  font-size: 11px;
  color: var(--text-secondary);
}

.voice-speed-pill {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: 10px;
  font-size: 10px;
  padding: 1px 6px;
  cursor: pointer;
}

/* Reactions */
.message-reactions-row {
  display: flex;
  gap: 4px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.reaction-chip {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 2px 8px;
  font-size: 12px;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.reaction-chip:hover {
  border-color: var(--primary);
}

/* Meta & Hover Actions */
.message-meta-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

.message-ticks.blue {
  color: #38bdf8;
  font-weight: bold;
}

.message-hover-actions {
  position: absolute;
  top: -14px;
  right: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 2px 6px;
  display: none;
  gap: 4px;
  box-shadow: var(--shadow-md);
  z-index: 2;
}

.message-bubble:hover .message-hover-actions {
  display: flex;
}

.message-hover-actions button {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 13px;
  padding: 2px 4px;
  border-radius: 4px;
  transition: transform 0.1s ease;
}

.message-hover-actions button:hover {
  transform: scale(1.25);
}

/* Typing Indicator */
.chat-typing-indicator {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 6px 20px;
  background: transparent;
  color: var(--primary-light);
  font-size: 12px;
  font-style: italic;
}

.chat-typing-indicator.active {
  display: flex;
}

.typing-dots {
  display: flex;
  gap: 3px;
}

.typing-dots span {
  width: 5px;
  height: 5px;
  background: var(--primary);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* ===================================================================
   3. BOTTOM INPUT BAR
   =================================================================== */

.chat-input-area {
  padding: 12px 20px;
  background: var(--bg-sidebar);
  border-top: 1px solid var(--border-color);
  position: relative;
}

.input-bar-normal {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.input-actions-left {
  display: flex;
  align-items: center;
  gap: 4px;
}

.text-input-wrapper {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  transition: var(--transition-fast);
}

.text-input-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.message-textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 14px;
  resize: none;
  max-height: 120px;
  line-height: 1.4;
}

.btn-send {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--primary);
  color: #04241a;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition-fast);
}

.btn-send:hover {
  background: var(--primary-light);
  transform: scale(1.05);
}

/* Voice Recording Bar */
.input-bar-recording {
  display: none;
  align-items: center;
  gap: 16px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 8px 16px;
}

.recording-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-rose);
  animation: pulseRecording 1s infinite;
}

@keyframes pulseRecording {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

.recording-timer {
  font-family: monospace;
  font-size: 15px;
  font-weight: bold;
  color: var(--text-main);
}

.voice-waveform-canvas {
  flex: 1;
  height: 28px;
}

.btn-cancel-recording {
  background: transparent;
  border: none;
  color: var(--accent-rose);
  font-size: 13px;
  cursor: pointer;
  font-weight: 600;
}

.btn-send-recording {
  background: var(--primary);
  color: #04241a;
  border: none;
  border-radius: var(--radius-full);
  padding: 6px 16px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

/* Emoji Popover */
.emoji-popover {
  position: absolute;
  bottom: 74px;
  left: 20px;
  width: 320px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 12px;
  display: none;
  z-index: 20;
}

.emoji-popover.active {
  display: block;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.emoji-item {
  font-size: 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  text-align: center;
  transition: transform 0.1s ease;
}

.emoji-item:hover {
  transform: scale(1.3);
  background: var(--bg-card-hover);
}

/* Drag & Drop Overlay */
.drag-drop-overlay {
  position: absolute;
  inset: 0;
  background: rgba(16, 185, 129, 0.9);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 50;
  color: #04241a;
}

.drag-drop-overlay.active {
  display: flex;
}

.drag-drop-text {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  margin-top: 12px;
}

/* ===================================================================
   4. RIGHT DETAILS DRAWER
   =================================================================== */

.details-drawer {
  width: 0;
  overflow: hidden;
  background: var(--bg-sidebar);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transition: width var(--transition-smooth);
}

.details-drawer.open {
  width: 320px;
}

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

.drawer-title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
}

.drawer-content {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.drawer-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.drawer-member-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}

.small-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
}

.member-info .member-name {
  font-size: 13px;
  font-weight: 600;
}

.member-info .member-role {
  font-size: 11px;
  color: var(--text-muted);
}

.drawer-media-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.drawer-media-thumb {
  width: 100%;
  height: 70px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

/* ===================================================================
   5. VIDEO CALLING & MEETINGS MODAL
   =================================================================== */

.meeting-room-modal {
  position: fixed;
  inset: 0;
  background: #06090e;
  z-index: 1000;
  display: none;
  flex-direction: column;
}

.meeting-room-modal.active {
  display: flex;
}

.meeting-top-bar {
  height: 60px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  background: #0b0e14;
}

.meeting-brand-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
}

.meeting-timer-badge {
  background: rgba(16, 185, 129, 0.2);
  color: var(--primary-light);
  font-size: 13px;
  font-family: monospace;
  font-weight: bold;
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

.meeting-main-grid {
  flex: 1;
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}

.meeting-participant-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  height: 100%;
  min-height: 280px;
  max-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
}

.participant-media {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: radial-gradient(circle, #1a2333 0%, #0d121c 100%);
}

.participant-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 3px solid var(--primary);
}

.participant-status-badge {
  position: absolute;
  bottom: 16px;
  left: 16px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.mic-indicator.active {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

.simulated-speaking-wave {
  position: absolute;
  bottom: 16px;
  right: 16px;
  display: flex;
  gap: 3px;
}

.simulated-speaking-wave span {
  width: 3px;
  height: 14px;
  background: var(--primary);
  border-radius: 2px;
  animation: audioWave 1s infinite ease-in-out;
}

.simulated-speaking-wave span:nth-child(2) { animation-delay: 0.2s; height: 20px; }
.simulated-speaking-wave span:nth-child(3) { animation-delay: 0.4s; height: 16px; }

@keyframes audioWave {
  0%, 100% { transform: scaleY(0.4); }
  50% { transform: scaleY(1.2); }
}

/* Local Video Container */
.local-video-wrapper {
  position: absolute;
  bottom: 90px;
  right: 24px;
  width: 220px;
  height: 140px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  border: 2px solid var(--primary);
  box-shadow: var(--shadow-lg);
  z-index: 10;
}

.local-video-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.simulated-feed {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #111827;
  gap: 8px;
}

.sim-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.feed-label {
  font-size: 11px;
  color: var(--text-muted);
}

/* Meeting Controls Bar */
.meeting-controls-bar {
  height: 80px;
  background: rgba(11, 14, 20, 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.control-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.control-btn:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.control-btn.off {
  background: rgba(244, 63, 94, 0.2);
  color: var(--accent-rose);
  border-color: var(--accent-rose);
}

.control-btn.active {
  background: var(--primary);
  color: #04241a;
}

.control-btn.end-call {
  background: var(--accent-rose);
  color: #fff;
  border-color: var(--accent-rose);
}

.control-btn.end-call:hover {
  background: #e11d48;
}

/* ===================================================================
   6. SUPERADMIN CONTROL CENTER MODAL
   =================================================================== */

.admin-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(16px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.admin-modal.active {
  display: flex;
}

.admin-dialog {
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 1000px;
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.admin-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #151b29;
}

.admin-header-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-badge-pill {
  background: rgba(16, 185, 129, 0.2);
  color: var(--primary-light);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.admin-nav-tabs {
  display: flex;
  background: #0f1420;
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
}

.admin-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  padding: 12px 18px;
  cursor: pointer;
  transition: var(--transition-fast);
}

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

.admin-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.admin-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.admin-tab-content {
  display: none;
}

.admin-tab-content.active {
  display: block;
}

/* Metrics Row */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
}

.metric-value {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
}

.metric-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

/* Admin Tables */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.admin-table th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
}

.admin-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.table-user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.table-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

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

.user-cell-email {
  font-size: 11px;
  color: var(--text-muted);
}

.role-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.badge-superadmin { background: rgba(245, 158, 11, 0.2); color: var(--accent-amber); }
.badge-admin { background: rgba(6, 182, 212, 0.2); color: var(--accent-cyan); }
.badge-member { background: rgba(255, 255, 255, 0.1); color: var(--text-secondary); }
.badge-bot { background: rgba(139, 92, 246, 0.2); color: var(--accent-purple); }

.status-indicator-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}

.status-indicator-dot.online { background: var(--primary); }
.status-indicator-dot.offline { background: var(--text-muted); }

.table-actions {
  display: flex;
  gap: 6px;
}

.btn-table-action {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  cursor: pointer;
}

.btn-table-action:hover {
  background: var(--primary);
  color: #04241a;
}

.btn-table-action.btn-danger:hover {
  background: var(--accent-rose);
  color: #fff;
}

/* Forms */
.admin-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg-card);
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input, .form-select, .form-textarea {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-main);
  font-size: 13px;
  font-family: var(--font-main);
  outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
}

.members-checkbox-selector {
  max-height: 140px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg-input);
}

.checkbox-member-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  cursor: pointer;
}

.btn-primary-form {
  background: var(--primary);
  color: #04241a;
  border: none;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-self: flex-start;
  transition: var(--transition-fast);
}

.btn-primary-form:hover {
  background: var(--primary-light);
}

/* Projects List in Admin */
.admin-projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.admin-project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.project-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.project-code {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

.project-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

.project-members-row {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Audit Logs */
.audit-logs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.audit-log-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}

.audit-badge {
  font-size: 11px;
  font-weight: bold;
  padding: 2px 8px;
  border-radius: 4px;
}

.audit-badge.badge-create { background: rgba(16, 185, 129, 0.2); color: var(--primary-light); }
.audit-badge.badge-general { background: rgba(6, 182, 212, 0.2); color: var(--accent-cyan); }

.audit-details {
  flex: 1;
}

.audit-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
}

.audit-meta {
  font-size: 11px;
  color: var(--text-muted);
}

/* ===================================================================
   7. CALL NOTIFICATION MODAL & LIGHTBOX
   =================================================================== */

.call-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  z-index: 2500;
  display: none;
  align-items: center;
  justify-content: center;
}

.call-modal.active {
  display: flex;
}

.call-card {
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 340px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-lg);
}

.call-avatar-wrapper {
  position: relative;
  width: 96px;
  height: 96px;
}

.call-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary);
  animation: callAvatarPulse 1.5s infinite;
}

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

.call-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
}

.call-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.call-actions {
  display: flex;
  gap: 20px;
  margin-top: 10px;
}

.btn-call-decline {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--accent-rose);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.btn-call-decline:hover {
  transform: scale(1.1);
}

/* Media Lightbox */
.media-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
}

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

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

.lightbox-img {
  max-width: 100%;
  max-height: 85vh;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}


