/* ==============================
   DISPATCH MANAGER - V3.0 NEON GLASS
   Theme: Dark Slate + Neon Accents
   ============================== */

/* GLOBAL RESET — Force default cursor EVERYWHERE */
*,
*::before,
*::after {
  box-sizing: border-box;
  cursor: default !important;
}

/* Allow text cursor ONLY on actual text inputs */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="tel"],
input[type="number"],
input:not([type]),
textarea,
[contenteditable="true"],
.form-control,
[role="textbox"] {
  cursor: text !important;
}

/* Pointer cursor for interactive elements */
select,
.form-select,
a,
button,
.btn,
label,
[role="button"],
.dropdown-item,
.nav-link,
.list-group-item-action,
summary,
[data-bs-toggle],
input[type="checkbox"],
input[type="radio"],
input[type="submit"],
input[type="button"],
input[type="file"] {
  cursor: pointer !important;
}

/* Grab cursor for draggable cards */
.small-card,
.incident-card-col {
  cursor: grab !important;
}

/* Permettre la sélection de texte dans les zones d'édition */
.small-card textarea,
.small-card input[type="text"],
.small-card .note-edit-textarea,
.incident-card-col textarea,
.incident-card-col input[type="text"] {
  cursor: text !important;
  user-select: text !important;
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
}

body {
  background-color: var(--bg-app);
  color: var(--text-main);
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ==============================
   THEME-ADAPTIVE INPUT CLASSES
   Replace hardcoded bg-dark text-white
   ============================== */
.theme-input {
  background-color: var(--input-bg) !important;
  color: var(--input-text) !important;
  border-color: var(--input-border) !important;
}

.theme-input::placeholder {
  color: var(--text-tertiary) !important;
}

.theme-input:focus {
  background-color: var(--input-bg) !important;
  color: var(--input-text) !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 0.2rem var(--primary-glow) !important;
}

/* ==============================
   TYPOGRAPHY
   ============================== */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Outfit', 'Inter', sans-serif;
  font-weight: 700;
  color: var(--text-main);
}

.text-neon {
  color: var(--primary) !important;
  text-shadow: 0 0 10px var(--primary-glow);
}

/* ==============================
   SIDEBAR
   ============================== */
.sidebar {
  position: fixed;
  top: 95px;
  left: 1rem;
  width: 220px;
  height: calc(100vh - 110px);
  background: rgba(30, 41, 59, 0.7);
  /* Transparence pour le fond */
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  /* Bords arrondis */
  overflow-y: auto;
  padding: 1.5rem 0;
  z-index: 900;
  transition: transform 0.3s var(--ease-smooth), width 0.3s var(--ease-smooth);
  /* Flex layout to push widget to bottom */
  display: flex;
  flex-direction: column;
}

/* Desktop: sidebar visible by default, hidden when .open removed */
@media (min-width: 769px) {
  .sidebar:not(.open) {
    transform: translateX(-120%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  body:not(.with-sidebar) .main-content {
    margin-left: 1rem;
    max-width: calc(100vw - 2rem);
  }
}

.sidebar-links {
  list-style-type: none;
  /* Enlever les points rouges/blancs */
  padding-left: 0;
  margin-bottom: 0;
  flex-grow: 1;
  /* Pushes the widget element below it to the bottom */
}

.sidebar a {
  display: flex;
  align-items: center;
  padding: 0.6rem 1.25rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  border-left: 3px solid transparent;
  transition: all var(--duration-fast) var(--ease-smooth);
}

.sidebar a:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
  /* Effet hover plus subtil */
  border-left-color: var(--primary);
}

.sidebar a.active {
  color: var(--primary);
  background: rgba(99, 102, 241, 0.15);
  /* Transparence pour l'élément actif */
  border-left-color: var(--primary);
}

.sidebar-category {
  padding: 1.5rem 1.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.8;
}

.sidebar-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.05);
  margin: 0.5rem 1.25rem;
}

.light-mode .sidebar-category {
  color: #64748b !important;
  /* Slate 500 */
}

.light-mode .sidebar-divider {
  background: rgba(0, 0, 0, 0.05);
}

/* ==============================
   MAIN CONTENT
   ============================== */
.main-content {
  margin-left: calc(220px + 2rem);
  max-width: calc(100vw - 220px - 2rem);
  padding: 2rem 1.5rem;
  min-height: calc(100vh - 80px);
  overflow-x: hidden;
}

/* ==============================
   NAVBAR
   ============================== */
.navbar {
  background: var(--bg-panel) !important;
  backdrop-filter: var(--glass-blur);
  border-bottom: var(--glass-border);
  border-left: var(--glass-border);
  border-right: var(--glass-border);
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
  margin: 0 1rem;
  position: sticky;
  top: 0;
  z-index: 1050;
  height: 80px;
}

.navbar .dropdown-menu {
  z-index: 1100;
}

.navbar-brand {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--primary) !important;
  text-shadow: 0 0 10px var(--primary-glow);
}

/* ===== BURGER MENU BUTTON ===== */
.sidebar-toggle-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 36px;
  height: 36px;
  background: var(--bg-surface);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  cursor: pointer;
  gap: 4px;
  transition: all 0.2s ease;
  padding: 0;
}

.sidebar-toggle-btn:hover {
  background: var(--bg-base);
  border-color: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
}

.sidebar-toggle-btn .burger-line {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--text-main);
  border-radius: 2px;
  transition: all 0.2s ease;
}

.sidebar-toggle-btn:hover .burger-line {
  background: var(--primary);
}

/* ===== NAVBAR AVATAR BUTTON ===== */
.navbar-avatar-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(99, 102, 241, 0.4);
    padding: 0;
    overflow: hidden;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.navbar-avatar-btn:hover,
.navbar-avatar-btn:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
    outline: none;
}
.navbar-avatar-btn::after { display: none !important; }
.navbar-avatar-img {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}
.navbar-avatar-initials {
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1;
    pointer-events: none;
}

/* ===== NAVBAR HOME ICON ===== */
.navbar-home-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    color: var(--text-secondary);
    transition: color 0.2s, background 0.2s;
    font-size: 1rem;
}
.navbar-home-icon:hover,
.navbar-home-icon.active {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.12);
}

/* ==============================
   KANBAN / TECH GRID
   ============================== */
.tech-grid {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  min-height: auto;
  padding-bottom: 8px;
}

.tech-column {
  min-width: 290px;
  max-width: 290px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.incident-list-col {
  overflow-y: auto;
  flex: 1;
  padding: 8px;
}

.incident-col-card {
  background: var(--bg-panel);
  backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ==============================
   CARDS
   ============================== */
.card {
  background: var(--bg-panel);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  color: var(--text-main);
  /* FIX: Force text color to adapt to theme */
  transition: transform var(--duration-fast) var(--ease-smooth),
    box-shadow var(--duration-fast) var(--ease-smooth);
}

.card-body {
  padding: 0.75rem;
}

/* === INCIDENT CARD OVERRIDES (Admin Kanban) === */
.incident-card-col {
  border-radius: var(--radius-md) !important;
  min-height: 140px;
}

.incident-card-col .card-body {
  padding: 0.75rem !important;
  font-size: 0.85rem !important;
}

.incident-card-col .card-body .badge {
  font-size: 0.7rem !important;
  padding: 0.2rem 0.4rem !important;
}

.incident-card-col .card-body strong,
.incident-card-col .card-body .fw-medium,
.incident-card-col .card-body .fw-bold {
  color: var(--text-main) !important;
}

.incident-card-col .card-body .small,
.incident-card-col .card-body small {
  color: var(--text-secondary) !important;
  font-size: 0.85rem !important;
}

.incident-card-col .note-wrapper {
  font-size: 0.85rem !important;
}

.incident-card-col .note-content {
  color: var(--text-secondary) !important;
  font-size: 0.82rem !important;
  min-height: 1.2em;
}

/* === TECHNICIAN SMALL-CARD OVERRIDES === */
.small-card {
  border-radius: var(--radius-md) !important;
  min-height: 140px;
}

.small-card .card-body {
  padding: 0.75rem !important;
  font-size: 0.85rem !important;
}

.small-card .card-body .badge {
  font-size: 0.7rem !important;
  padding: 0.2rem 0.4rem !important;
}

.small-card .card-body .fw-medium {
  color: var(--text-main) !important;
}

.small-card .card-body small {
  color: var(--text-secondary) !important;
  font-size: 0.85rem !important;
}

.small-card .note-content {
  color: var(--text-secondary) !important;
  max-height: 4.5em !important;
  overflow: hidden !important;
  word-break: break-word !important;
  overflow-wrap: break-word !important;
  white-space: normal !important;
}
.small-card .note-content.measure-height,
.small-card .note-content.expanded {
  max-height: none !important;
  overflow: visible !important;
}

/* ==============================
   BUTTONS
   ============================== */
.btn {
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: all var(--duration-fast) var(--ease-smooth);
}

.btn-admin {
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.85rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--duration-fast) var(--ease-smooth);
}

.btn-admin:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ==============================
   BADGES
   ============================== */
.badge {
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.4em 0.75em;
}

/* ==============================
   FORM CONTROLS (theme-adaptive)
   ============================== */
.form-control,
.form-select {
  background-color: var(--input-bg);
  color: var(--input-text);
  border-color: var(--input-border);
  border-radius: var(--radius-sm);
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

.form-control:focus,
.form-select:focus {
  background-color: var(--input-bg);
  color: var(--input-text);
  border-color: var(--primary);
  box-shadow: 0 0 0 0.2rem var(--primary-glow);
}

.form-control::placeholder {
  color: var(--text-tertiary);
}

.form-label {
  color: var(--text-secondary);
}

/* ==============================
   HOVER EFFECTS
   ============================== */
.hover-lift:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.hover-glow:hover {
  box-shadow: var(--shadow-glow-primary);
}

.transition-base {
  transition: all var(--duration-normal) var(--ease-smooth);
}

.transition-opacity {
  transition: opacity var(--duration-fast) var(--ease-smooth);
}

.hover-opacity-100:hover {
  opacity: 1 !important;
}

/* ==============================
   TEXT UTILITIES
   ============================== */
.text-neon {
  color: var(--primary);
  text-shadow: 0 0 10px var(--primary-glow);
}

/* Override Bootstrap .text-muted and <small> for dark glass backgrounds */
.text-muted,
small,
.small {
  color: var(--text-secondary) !important;
}

/* Base Modal Styling */
.modal-content {
  background-color: var(--bg-panel);
  color: var(--text-main);
  border: var(--glass-border);
  backdrop-filter: var(--glass-blur);
}

#eventDetailsModal img:not(.modal-avatar) {
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: var(--radius-md);
}

.modal-avatar {
  width: 72px !important;
  height: 72px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  border: 3px solid rgba(255, 255, 255, 0.2) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  aspect-ratio: 1/1;
  background-color: var(--bg-surface);
}

#eventDetailsModal i.fas {
  width: 20px;
  text-align: center;
}

/* ==============================
   GLASSMORPHISM
   ============================== */
.bg-glass {
  background: var(--bg-panel);
  backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
}

/* ==============================
   TABLE STYLING
   ============================== */
.table {
  color: var(--text-main);
}

.table thead {
  color: var(--text-main);
}

.table> :not(caption)>*>* {
  background-color: transparent;
  color: var(--text-main);
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

.table-hover>tbody>tr:hover>* {
  background-color: var(--bg-surface);
}

/* ==============================
   STATUS SELECTOR
   ============================== */
.status-selector-col,
.tech-selector-col {
  background-color: var(--input-bg) !important;
  color: var(--input-text) !important;
  border-color: var(--input-border) !important;
  font-size: 0.85rem;
}

/* ==============================
   NOTES
   ============================== */
.note-view-mode {
  border-radius: var(--radius-sm);
}

.note-edit-textarea {
  font-size: 0.85rem;
}

.note-content {
  color: var(--text-secondary);
  line-height: 1.4;
  position: relative;
  overflow: hidden;
  max-height: 4.5em;
  /* Environ 3 lignes */
  transition: max-height 0.3s ease;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

.note-content.expanded {
  max-height: none;
}

.note-content::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: 0;
  width: 100%;
  height: 1.5em;
  background: linear-gradient(transparent, var(--bg-panel));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.note-content.is-overflowing:not(.expanded)::after {
  opacity: 1;
}

.note-content.expanded::after {
  opacity: 0;
}

.note-toggle-btn {
  display: block;
  font-size: 0.75rem;
  color: var(--primary);
  text-decoration: none;
  margin-top: 2px;
  font-weight: 600;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer !important;
}

.note-toggle-btn:hover {
  text-decoration: underline;
  color: var(--primary-light);
}

/* ==============================
   ANIMATIONS (from home.css)
   ============================== */
.animate-fade-in-up {
  animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==============================
   SCROLLBAR STYLING
   ============================== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--text-tertiary);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* ==============================
   RESPONSIVE
   ============================== */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 280px;
    z-index: 1100;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    max-width: 100vw;
    padding: 1rem;
  }

  .tech-grid {
    height: auto;
    min-height: calc(100vh - 200px);
  }

  .tech-column {
    min-width: 300px;
    max-width: 300px;
  }
}

/* ==============================
   LIGHT MODE COMPONENT OVERRIDES
   ============================== */
.light-mode .card {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.light-mode .card-header.bg-primary {
  background-color: var(--primary) !important;
}

.light-mode .navbar {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.light-mode .sidebar {
  background: rgba(255, 255, 255, 0.9) !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
  box-shadow: 1px 0 10px rgba(0, 0, 0, 0.05);
}

.light-mode .sidebar a {
  color: #475569 !important;
  /* Slate 600 */
}

.light-mode .sidebar a:hover {
  color: #0f172a !important;
  /* Slate 900 */
  background: rgba(0, 0, 0, 0.03) !important;
}

.light-mode .sidebar a.active {
  color: var(--primary) !important;
  background: rgba(99, 102, 241, 0.1) !important;
}

.light-mode .badge.bg-dark {
  background-color: #e2e8f0 !important;
  color: #1e293b !important;
}

.light-mode .note-view-mode {
  background-color: rgba(241, 245, 249, 0.8) !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
}

.light-mode .border-white {
  border-color: rgba(0, 0, 0, 0.1) !important;
}

.light-mode .border-opacity-10 {
  --bs-border-opacity: 0.1;
}

/* Light-mode overrides for Bootstrap dark utilities */
.light-mode .bg-dark {
  background-color: var(--input-bg) !important;
}

.light-mode .text-white {
  color: var(--text-main) !important;
}

/* Explicitly keep white text on vibrant backgrounds in light mode */
.light-mode .bg-primary.text-white,
.light-mode .bg-primary .text-white,
.light-mode .bg-danger.text-white,
.light-mode .bg-danger .text-white,
.light-mode .bg-info.text-white,
.light-mode .bg-info .text-white,
.light-mode .bg-success.text-white,
.light-mode .bg-success .text-white,
.light-mode .btn-primary.text-white,
.light-mode .btn-primary .text-white,
.light-mode .btn-danger.text-white,
.light-mode .btn-danger .text-white {
  color: #ffffff !important;
}

.light-mode .border-secondary {
  border-color: var(--input-border) !important;
}

.light-mode .text-light {
  color: var(--text-main) !important;
}

.light-mode .bg-opacity-25 {
  --bs-bg-opacity: 0.08;
}

.light-mode .bg-opacity-50 {
  --bs-bg-opacity: 0.12;
}

.light-mode .modal-content {
  background-color: var(--bg-panel);
  color: var(--text-main);
}

/* ==============================
   PROFILE WIDGET
   ============================== */
.profile-widget {
  margin: auto 1rem 0 1rem;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
  color: var(--text-main);
  text-decoration: none;
}

.light-mode .profile-widget {
  background: rgba(0, 0, 0, 0.03) !important;
  border: 1px solid rgba(0, 0, 0, 0.05) !important;
}

.light-mode .profile-widget-initials {
  background: var(--primary) !important;
  color: #ffffff !important;
}

.profile-widget:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.profile-widget-img,
.profile-widget-initials {
  width: 42px;
  /* Slightly smaller for the sidebar */
  height: 42px;
  flex-shrink: 0;
  aspect-ratio: 1/1;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary);
  background: var(--bg-base);
}

.profile-widget-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  color: #fff;
  font-weight: bold;
  font-size: 1.3rem;
}

.profile-widget-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.profile-widget-name {
  font-weight: 600;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.profile-widget-role {
  font-size: 0.7rem;
  letter-spacing: 0.5px;
  align-self: flex-start;
  margin-top: 4px;
}

.slide-up-animation {
  opacity: 0;
  animation: slideUp 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === NOTE ACTION BUTTONS === */
.note-save-btn,
.note-cancel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  /* Slightly larger for better touch/click area */
  height: 32px;
  padding: 0 !important;
  border-radius: 8px !important;
  transition: all var(--duration-fast) var(--ease-smooth);
  border: none !important;
}

.note-save-btn i,
.note-cancel-btn i {
  font-size: 1rem;
  pointer-events: none;
  /* Ensure clicks pass through to the button */
  color: #ffffff !important;
  display: block !important;
  visibility: visible !important;
}

.note-save-btn {
  background-color: var(--success) !important;
  border-color: var(--success) !important;
  color: #ffffff !important;
}

.note-save-btn:hover {
  background-color: var(--primary-hover) !important;
  border-color: var(--primary-hover) !important;
  box-shadow: 0 0 10px var(--primary-glow);
}

.note-cancel-btn {
  background-color: #64748b !important;
  /* Slate 500 */
  border-color: #64748b !important;
  color: #ffffff !important;
}

.note-cancel-btn:hover {
  background-color: #475569 !important;
  /* Slate 600 */
  border-color: #475569 !important;
}

/* ==============================
   MESSAGERIE INTERNE — style Teams
   ============================== */
.message-drawer {
  position: fixed;
  top: 55px;
  right: 0;
  width: 420px;
  max-width: 100vw;
  height: calc(100vh - 55px);
  background: #151525;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 1040;
  display: flex;
  flex-direction: column;
  color: var(--text-main);
  box-shadow: -8px 0 30px rgba(0,0,0,0.35);
}

.light-mode .message-drawer {
  background: #f8f9fa;
  border-left: 1px solid rgba(0, 0, 0, 0.08);
}

.message-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #151525;
}

.message-drawer-header h5 {
  font-size: 1rem;
  letter-spacing: 0.3px;
}

.message-drawer-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #151525;
}

.light-mode .message-drawer-header,
.light-mode .message-drawer-tabs {
  background: #f8f9fa;
}

.message-tab {
  flex: 1;
  padding: 0.7rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 500;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.message-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: rgba(255, 255, 255, 0.03);
}

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

.message-tab-panel {
  display: none;
  flex: 1;
  overflow: hidden;
  flex-direction: column;
  background: #151525;
}

.message-tab-panel.active {
  display: flex;
}

.light-mode .message-tab-panel {
  background: #f8f9fa;
}

.message-drawer-actions {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.message-room-list,
.message-mentions-list,
.message-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.message-room-item,
.message-mention-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
  margin-bottom: 0.25rem;
}

.message-room-item:hover,
.message-mention-item:hover,
.message-room-item.active {
  background: rgba(255, 255, 255, 0.07);
}

.message-room-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  flex-shrink: 0;
  text-transform: uppercase;
}

.message-room-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.message-room-name {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-room-preview {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-room-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  opacity: 0.8;
}

.message-room-unread {
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.4rem;
}

.message-conversation-panel {
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  background: #151525;
}

.light-mode .message-conversation-panel {
  background: #f8f9fa;
}

.message-conversation-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #151525;
}

.light-mode .message-conversation-header {
  background: #f8f9fa;
}

.message-conversation-header span {
  font-size: 0.95rem;
}

.message-item {
  display: flex;
  margin-bottom: 1rem;
  max-width: 85%;
  animation: messageFadeIn 0.2s ease;
}

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

.message-mine {
  margin-left: auto;
  justify-content: flex-end;
}

.message-other {
  margin-right: auto;
  justify-content: flex-start;
}

.message-bubble {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  min-width: 120px;
}

.message-mine .message-bubble {
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.message-other .message-bubble {
  border-bottom-left-radius: 4px;
}

.message-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
  font-size: 0.75rem;
  opacity: 0.85;
}

.message-content {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.4;
  font-size: 0.9rem;
}

.message-mention {
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.message-mine .message-mention {
  color: #fff;
  text-decoration: underline;
}

.message-input-area {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.75rem;
  background: #151525;
}

.light-mode .message-input-area {
  background: #f8f9fa;
}

.message-input-wrapper {
  position: relative;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.message-input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-main);
  resize: none;
  font-size: 0.9rem;
  padding: 0.25rem;
}

.message-input:focus {
  outline: none;
}

.message-input-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.message-attachment-preview {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.message-attachment-img {
  max-width: 120px;
  max-height: 80px;
  border-radius: 6px;
  margin-top: 0.5rem;
}

.message-attachment-file {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.25rem 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.8rem;
}

.message-reply-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
}

.message-reply-btn {
  margin-top: 0.25rem;
  font-size: 0.7rem;
  opacity: 0.6;
}

.message-reply-btn:hover {
  opacity: 1;
}

.mention-autocomplete {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  background: var(--bg-panel);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  max-height: 180px;
  overflow-y: auto;
  z-index: 10;
  margin-bottom: 0.5rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.mention-autocomplete-item {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: background 0.15s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mention-autocomplete-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.mention-autocomplete-item .avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: #fff;
  font-weight: 700;
}

.new-conversation-members {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 340px;
  overflow-y: auto;
  padding: 0.75rem 1rem 0.75rem 1.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}

.light-mode .new-conversation-members {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.new-conversation-members .form-check {
  padding: 0.45rem 0.5rem 0.45rem 2rem;
  border-radius: 6px;
  transition: background 0.15s;
  margin-bottom: 0.2rem;
  min-height: auto;
}

.new-conversation-members .form-check-input {
  margin-top: 0.25rem;
  margin-left: -1.75rem;
  width: 1.1rem;
  height: 1.1rem;
}

.new-conversation-members .form-check:hover {
  background: rgba(255, 255, 255, 0.06);
}

.light-mode .new-conversation-members .form-check:hover {
  background: rgba(0, 0, 0, 0.05);
}

.new-conversation-members .form-check-label {
  font-size: 0.9rem;
  cursor: pointer;
}

@media (max-width: 480px) {
  .message-drawer {
    width: 100vw;
  }
}