/* ==========================================================================
   Modern Glassmorphism & High-Aesthetics UI Theme (MyChat)
   ========================================================================== */

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

:root {
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 40%, #0f172a 100%);
  --glass-bg: rgba(15, 23, 42, 0.75);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-card: rgba(30, 41, 59, 0.6);
  --glass-hover: rgba(51, 65, 85, 0.6);
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: rgba(99, 102, 241, 0.15);
  --accent-cyan: #06b6d4;
  --accent-pink: #ec4899;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --online-color: #10b981;
  --offline-color: #64748b;
  --danger-color: #ef4444;

  --radius-xl: 20px;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 6px;

  --shadow-main: 0 20px 50px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.25);
  
  --font-family: 'Plus Jakarta Sans', 'Outfit', system-ui, -apple-system, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* Background animated glow orbs */
.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  z-index: 0;
  pointer-events: none;
  opacity: 0.4;
  animation: pulseOrb 12s infinite alternate ease-in-out;
}
.bg-orb-1 {
  width: 450px;
  height: 450px;
  background: #6366f1;
  top: -100px;
  left: -100px;
}
.bg-orb-2 {
  width: 500px;
  height: 500px;
  background: #ec4899;
  bottom: -150px;
  right: -100px;
  animation-delay: -6s;
}

@keyframes pulseOrb {
  0% { transform: scale(1) translate(0, 0); }
  100% { transform: scale(1.15) translate(30px, 30px); }
}

/* Main Container App Wrapper */
#app {
  position: relative;
  z-index: 1;
  width: 95vw;
  max-width: 1280px;
  height: 90vh;
  max-height: 900px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-main);
  display: flex;
  overflow: hidden;
}

/* ==========================================================================
   Login Modal Overlay
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(15px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.login-card {
  background: var(--glass-card);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 460px;
  padding: 36px;
  box-shadow: var(--shadow-main), var(--shadow-glow);
  animation: modalSlideUp 0.4s ease-out;
}

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

.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.login-header .logo-icon {
  font-size: 42px;
  margin-bottom: 12px;
  display: inline-block;
  background: linear-gradient(135deg, var(--primary), var(--accent-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-header h2 {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.login-header p {
  color: var(--text-muted);
  font-size: 14px;
}

/* Role Selector Tabs */
.role-tabs {
  display: flex;
  background: rgba(15, 23, 42, 0.6);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 24px;
  border: 1px solid var(--glass-border);
}

.role-tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.role-tab.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Form Styles */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-wrapper {
  position: relative;
}

.input-wrapper input,
.input-wrapper textarea {
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text-main);
  font-size: 15px;
  outline: none;
  transition: all 0.2s ease;
}

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

.input-wrapper input:focus,
.input-wrapper textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
  background: rgba(15, 23, 42, 0.8);
}

.hint-text {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 6px;
}

.error-banner {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.error-banner.hidden {
  display: none;
}

.btn-submit {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.35);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.45);
}

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

/* ==========================================================================
   Chat Layout Styles
   ========================================================================== */

.chat-view {
  width: 100%;
  height: 100%;
  display: flex;
}

.chat-view.hidden {
  display: none !important;
}

/* ADMIN VIEW: Sidebar + Chat Main */
.admin-sidebar {
  width: 320px;
  background: rgba(15, 23, 42, 0.4);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
}

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

/* Sidebar Tabs */
.sidebar-tabs {
  display: flex;
  background: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid var(--glass-border);
  padding: 4px;
}

.sidebar-tab {
  flex: 1;
  background: transparent;
  border: none;
  padding: 10px 8px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: relative;
}

.sidebar-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-tab.active {
  color: white;
  background: rgba(99, 102, 241, 0.25);
  border: 1px solid rgba(99, 102, 241, 0.4);
}

.badge-unread {
  background: var(--accent-pink);
  color: white;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 10px;
}

/* Generative Avatar System */
.user-avatar-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
}

.user-avatar-img.sm {
  width: 28px;
  height: 28px;
}

.user-avatar-img.lg {
  width: 44px;
  height: 44px;
}

.badge-unread.hidden {
  display: none !important;
}

/* Admin Internal Channel Tag */
.admin-internal-tag {
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  margin-left: 6px;
}

.sidebar-header h3 {
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-badge {
  background: linear-gradient(135deg, var(--accent-pink), var(--primary));
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
}

.admin-badge.super {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.admin-table-row {
  border-bottom: 1px solid var(--glass-border);
  transition: background 0.15s ease;
}

.admin-table-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.search-box {
  padding: 14px 20px;
}

.search-box input {
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--glass-border);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 13px;
  outline: none;
}

.search-box input:focus {
  border-color: var(--primary);
}

/* Users List */
.user-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
}

.user-item {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid transparent;
}

.user-item:hover {
  background: var(--glass-hover);
}

.user-item.active {
  background: var(--primary-light);
  border-color: rgba(99, 102, 241, 0.4);
}

.user-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.user-item-name {
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.status-dot.online {
  background: var(--online-color);
  box-shadow: 0 0 8px var(--online-color);
}

.unread-pill {
  background: var(--accent-pink);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}

.user-item-reason {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Chat Main Area */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: rgba(15, 23, 42, 0.2);
  position: relative;
}

.chat-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.5);
}

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

/* Target Admin Selector Styles */
.target-admin-selector-wrapper {
  position: relative;
  display: inline-block;
}

.btn-admin-selector {
  background: transparent;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--text-main);
  text-align: left;
}

.btn-admin-selector:hover h4 {
  color: #818cf8;
}

.btn-admin-selector h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  transition: color 0.15s ease;
}

.selector-arrow {
  font-size: 10px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.admin-selector-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 250px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  z-index: 100;
  overflow: hidden;
}

.admin-selector-dropdown .dropdown-header {
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--glass-border);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-option-list {
  max-height: 200px;
  overflow-y: auto;
  padding: 4px 0;
}

.admin-option-item {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: background 0.15s ease;
  font-size: 13px;
  color: var(--text-main);
}

.admin-option-item:hover {
  background: rgba(99, 102, 241, 0.15);
}

.admin-option-item.selected {
  background: rgba(99, 102, 241, 0.25);
  font-weight: 600;
}

.admin-option-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 700;
  font-size: 18px;
  color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.chat-header-details h4 {
  font-size: 17px;
  font-weight: 700;
}

.chat-header-details p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  white-space: nowrap;
}

.user-identity-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 20px;
  background: var(--primary-light);
  border: 1px solid rgba(99, 102, 241, 0.3);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  max-width: 130px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
}

.user-identity-badge .user-pill-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-icon-only {
  width: 36px;
  height: 36px;
  padding: 0 !important;
  justify-content: center;
  font-size: 16px;
  border-radius: var(--radius-sm);
}

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

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

/* Reason Info Box (Top of chat) */
.reason-banner {
  background: rgba(99, 102, 241, 0.08);
  border-bottom: 1px solid rgba(99, 102, 241, 0.15);
  padding: 10px 24px;
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.reason-banner strong {
  color: var(--accent-cyan);
}

/* Message List Container */
.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Empty placeholder */
.empty-placeholder {
  margin: auto;
  text-align: center;
  color: var(--text-dim);
}

.empty-placeholder .icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

/* Message Bubble */
.message-bubble-wrapper {
  display: flex;
  flex-direction: column;
  max-width: 70%;
  animation: fadeIn 0.25s ease-out;
}

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

.message-bubble-wrapper.sent {
  align-self: flex-end;
}

.message-bubble-wrapper.received {
  align-self: flex-start;
}

.message-meta {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 4px;
  display: flex;
  gap: 6px;
}

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

.message-bubble {
  padding: 12px 18px;
  border-radius: var(--radius-lg);
  font-size: 14.5px;
  line-height: 1.5;
  word-break: break-word;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.message-bubble-wrapper.sent .message-bubble {
  background: linear-gradient(135deg, var(--primary), #4338ca);
  color: white;
  border-bottom-right-radius: 4px;
}

.message-bubble-wrapper.received .message-bubble {
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  border-bottom-left-radius: 4px;
}

/* Typing indicator */
.typing-indicator {
  font-size: 12px;
  color: var(--accent-cyan);
  padding: 4px 24px;
  height: 20px;
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Input Area */
.chat-input-area {
  padding: 18px 24px;
  background: rgba(15, 23, 42, 0.6);
  border-top: 1px solid var(--glass-border);
}

.input-box-wrapper {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.input-box-wrapper textarea {
  flex: 1;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text-main);
  font-size: 14.5px;
  outline: none;
  resize: none;
  max-height: 120px;
  height: 48px;
  transition: all 0.2s ease;
}

.input-box-wrapper textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.btn-send {
  height: 48px;
  padding: 0 24px;
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-send:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.45);
}

/* Image message bubble styling */
.chat-image-preview {
  max-width: 280px;
  max-height: 240px;
  border-radius: var(--radius-md);
  object-fit: cover;
  cursor: pointer;
  display: block;
  margin-top: 4px;
  border: 1px solid var(--glass-border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chat-image-preview:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Drag over highlight */
.chat-input-area.drag-over {
  background: rgba(99, 102, 241, 0.2) !important;
  outline: 2px dashed var(--primary);
  outline-offset: -4px;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Full-Window Drag Drop Overlay */
.drag-drop-overlay {
  position: absolute;
  inset: 0;
  z-index: 90;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 24px;
}

.drag-drop-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.drag-drop-content {
  border: 2px dashed var(--primary);
  border-radius: var(--radius-xl);
  padding: 40px 60px;
  text-align: center;
  background: rgba(99, 102, 241, 0.08);
  box-shadow: var(--shadow-glow);
  pointer-events: none;
  animation: pulseScale 1.5s infinite alternate ease-in-out;
}

.drag-drop-content .drag-icon {
  font-size: 56px;
  display: block;
  margin-bottom: 12px;
}

.drag-drop-content h3 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.drag-drop-content p {
  font-size: 14px;
  color: var(--text-muted);
}

@keyframes pulseScale {
  0% { transform: scale(0.98); }
  100% { transform: scale(1.02); }
}

/* File Transfer Card Styling */
.file-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  min-width: 260px;
  max-width: 340px;
  margin-top: 4px;
}

.file-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.file-card-icon {
  font-size: 32px;
  line-height: 1;
}

.file-card-info {
  flex: 1;
  overflow: hidden;
}

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

.file-card-size {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}

.file-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 600;
  align-self: flex-start;
}

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

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

.file-status-badge.rejected {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.file-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.btn-file-action {
  flex: 1;
  padding: 6px 12px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
}

.btn-file-approve {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-file-approve:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.45);
}

.btn-file-reject {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.btn-file-reject:hover {
  background: rgba(239, 68, 68, 0.35);
}

.btn-file-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px 14px;
  background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
  color: white;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
  transition: all 0.2s ease;
}

.btn-file-download:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.45);
}

/* Glassmorphism Context Menu Styles */
.context-menu.hidden, .hidden {
  display: none !important;
}

.context-menu {
  position: fixed;
  z-index: 1000;
  min-width: 180px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 1px rgba(255, 255, 255, 0.1);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: ctxFadeIn 0.15s ease-out;
}

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

.context-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-main);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.context-menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.context-menu-item.danger {
  color: #f87171;
}

.context-menu-item.danger:hover {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
}

.context-menu-item .ctx-icon {
  font-size: 14px;
}

/* ==========================================================================
   Mobile Responsive Adaptation (@media max-width: 768px)
   ========================================================================== */
@media (max-width: 768px) {
  body {
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
    margin: 0;
  }

  #app {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: 100vw;
    max-height: 100dvh;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }

  .login-card {
    padding: 24px 18px;
    max-width: 100%;
    border-radius: var(--radius-lg);
  }

  /* Prevent iOS Safari input focus auto-zoom */
  input[type="text"],
  input[type="password"],
  textarea {
    font-size: 16px !important;
  }

  .login-header h2 {
    font-size: 20px;
  }

  /* Admin View Mobile Switching */
  #admin-view {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  /* User View Mobile Layout */
  #user-view {
    width: 100%;
    height: 100%;
    position: relative;
  }

  #user-view .chat-main {
    width: 100%;
    height: 100%;
    position: relative;
    transform: none;
  }

  #admin-view .admin-sidebar {
    width: 100%;
    height: 100%;
    border-right: none;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }

  #admin-view .chat-main {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 5;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(100%);
  }

  /* Mobile Active States for Admin Panel */
  #admin-view.mobile-show-chat .admin-sidebar {
    transform: translateX(-100%);
  }

  #admin-view.mobile-show-chat .chat-main {
    transform: translateX(0);
    z-index: 15;
  }

  .mobile-back-btn {
    display: inline-flex !important;
    padding: 5px 10px !important;
    font-size: 12px !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: var(--radius-sm) !important;
    color: var(--text-main) !important;
    align-items: center;
    gap: 4px;
    margin-right: 6px;
  }

  /* Chat Messages & Input bar mobile tweaks */
  .chat-header {
    padding: 12px 14px;
  }

  .chat-header h4 {
    font-size: 15px;
  }

  .messages-container {
    padding: 12px;
  }

  .message-bubble-wrapper {
    max-width: 90%;
  }

  .message-bubble {
    padding: 10px 14px;
    font-size: 14px;
  }

  .chat-input-area {
    padding: 10px 12px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }

  .btn-icon {
    width: 38px;
    height: 38px;
    font-size: 16px;
  }

  .btn-send {
    padding: 10px 16px;
    font-size: 14px;
  }

  .file-card {
    min-width: 200px;
    max-width: 250px;
  }

  .file-card-actions {
    flex-direction: column;
  }

  .reason-banner {
    padding: 8px 12px;
    font-size: 12px;
  }
}


