/* =================================
   VENUE MANAGER - CONSOLIDATED CSS
   Cleaned and optimized version
   ================================= */

/* =================================
   CSS VARIABLES - Centralized Colors
   ================================= */
:root {
  /* Primary Colors */
  --color-primary: #667eea;
  --color-primary-dark: #764ba2;
  --color-primary-light: #8b5cf6;
  
  /* Status Colors */
  --color-success: #22c55e;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-info: #3b82f6;
  
  /* Neutral Colors */
  --color-gray-50: #f8f9fa;
  --color-gray-100: #f1f3f4;
  --color-gray-200: #e9ecef;
  --color-gray-300: #dee2e6;
  --color-gray-400: #adb5bd;
  --color-gray-500: #6c757d;
  --color-gray-600: #495057;
  --color-gray-700: #374151;
  --color-gray-800: #212529;
  --color-gray-900: #1a1a1a;
  
  /* WhatsApp Green */
  --color-whatsapp: #25D366;
  
  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  
  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.1);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.15);
  --shadow-xl: 0 8px 25px rgba(0,0,0,0.15);
  
  /* Z-index Scale */
  --z-base: 1;
  --z-dropdown: 10;
  --z-sticky: 50;
  --z-fixed: 100;
  --z-modal-backdrop: 1000;
  --z-modal: 1050;
  --z-tooltip: 1100;
}

/* =================================
   FULL HEIGHT FIXED LAYOUT - NO PAGE SCROLL
   ================================= */

html, body {
  height: 100%;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

#app {
  height: 100vh;
  overflow: hidden;
}

.page-wrapper {
  height: 100vh;
  overflow: hidden;
}

.page-wrapper > .container-fluid {
  height: 100vh;
  overflow: hidden;
  padding: 0 !important;
}

.page-wrapper > .container-fluid > .row {
  height: 100vh;
  margin: 0;
  display: flex;
  flex-wrap: nowrap;
}

/* Override Bootstrap column heights */
.page-wrapper .col-3,
.page-wrapper .col-9,
.page-wrapper .col-md-2,
.page-wrapper .col-md-10 {
  height: auto !important;
  min-height: 100vh !important;
  max-height: 100vh !important;
}

/* BUT: Content inside main-content should flow normally */
.main-content .container-fluid {
  height: auto !important;
  overflow: visible !important;
}

.main-content .row {
  height: auto !important;
}

/* Sidebar - Fixed height with footer */
.sidebar {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--color-gray-200);
  width: 250px;
  min-width: 250px;
  max-width: 250px;
  flex-shrink: 0;
  position: relative;
}

/* Main content area */
.main-content {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  width: calc(100% - 250px);
}

.sidebar .nav {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 140px; /* Space for footer to overlay */
  min-height: 0;
}

/* Sidebar footer - absolutely positioned, always visible on top */
.sidebar-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem 0 1rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  background: linear-gradient(to bottom, 
    rgba(44, 62, 80, 0) 0%, 
    rgba(44, 62, 80, 0.95) 10%, 
    rgba(44, 62, 80, 1) 100%);
  z-index: var(--z-fixed);
  pointer-events: all;
  box-shadow: 0 -8px 16px rgba(0, 0, 0, 0.3);
}

.sidebar-footer .nav-link {
  color: rgba(255,255,255,0.8) !important;
  background: transparent !important;
  border-radius: var(--radius-md);
  margin: 3px 12px;
  padding: 10px 14px;
  transition: all 0.3s ease;
  text-decoration: none;
  display: flex;
  align-items: center;
}

.sidebar-footer .nav-link:hover {
  background: rgba(255,255,255,0.1) !important;
  color: white !important;
  text-decoration: none;
  transform: translateX(4px);
}

.sidebar-footer .nav-link.text-danger {
  color: #ff6b6b !important;
}

.sidebar-footer .nav-link.text-danger:hover {
  background: rgba(255, 107, 107, 0.15) !important;
  color: #ff5252 !important;
}

.notification-link {
  position: relative;
}

.notification-badge-sidebar {
  position: absolute;
  top: 8px;
  right: 10px;
  background: var(--color-danger);
  color: white;
  border-radius: 10px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 600;
  min-width: 18px;
  text-align: center;
  animation: notificationPulse 2s infinite;
  box-shadow: 0 2px 4px rgba(220, 53, 69, 0.4);
}

/* User info in sidebar footer */
.sidebar-footer #user-info-sidebar {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.75rem;
  padding: 0 1rem;
  margin-bottom: 0.5rem;
  display: block;
}

/* Main content - scrollable */
.main-content {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#page-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.5rem;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Ensure content inside flows normally */
#page-content > * {
  height: auto !important;
  flex-shrink: 0;
}

#page-content .container-fluid {
  height: auto !important;
  flex: 1;
  min-height: 0;
}

#page-content .row {
  height: auto !important;
}

/* Remove old navbar styles since it's deleted */
.navbar {
  display: none;
}

/* Notification dropdown positioning from sidebar */
.notification-dropdown {
  position: fixed;
  bottom: 80px;
  left: 280px;
  width: 360px;
  max-height: 500px;
  background: white;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  z-index: var(--z-modal);
  overflow: hidden;
  display: none;
}

.notification-dropdown.show {
  display: block;
  animation: slideDown 0.2s ease-out;
}

/* =================================
   BASE STYLES & ANIMATIONS
   ================================= */

/* Global Animations */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

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

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

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

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

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@keyframes scheduleCreate {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes pulse {
  0%, 100% { 
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7); 
  }
  50% { 
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(40, 167, 69, 0); 
  }
}

@keyframes notificationPulse {
  0%, 100% { 
    transform: scale(1); 
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.4);
  }
  50% { 
    transform: scale(1.1); 
    box-shadow: 0 3px 8px rgba(220, 53, 69, 0.6);
  }
}

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

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

@keyframes failureAttention {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes statUpdate {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* Loading Spinner - Unified */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-spinner.large {
  width: 24px;
  height: 24px;
}

/* =================================
   LOGIN & AUTHENTICATION
   ================================= */

.login-bg {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  min-height: 100vh;
}

.login-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: none;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

/* Session Expiry Overlay */
#app.session-expired {
  filter: blur(4px);
  pointer-events: none;
  transition: filter 0.3s ease;
}

#session-expired-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.session-expired-backdrop {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(2px);
}

.session-expired-modal {
  position: relative;
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  max-width: 400px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

@media (prefers-color-scheme: dark) {
  .session-expired-modal {
    background: #1a1a1a;
    color: #ffffff;
  }
  
  .session-expired-modal .form-control {
    background: #2d2d2d;
    border-color: #404040;
    color: #ffffff;
  }
  
  .session-expired-modal .form-control:focus {
    background: #2d2d2d;
    border-color: #0d6efd;
    color: #ffffff;
  }
}

/* =================================
   LAYOUT & NAVIGATION
   ================================= */

/* Navbar is hidden in favor of sidebar-only layout */
.navbar {
  display: none;
}

.sidebar {
  background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
}

/* Base Navigation Styles */
.nav {
  padding: 12px 0;
}

/* Regular Navigation Links (NOT accordion triggers or sub-links) */
.nav-link:not(.accordion-trigger):not(.sub-link) {
  color: rgba(255,255,255,0.8) !important;
  background: transparent !important;
  border-radius: var(--radius-md);
  margin: 3px 12px;
  padding: 10px 14px;
  transition: all 0.3s ease;
  text-decoration: none;
  display: flex;
  align-items: center;
}

.nav-link:not(.accordion-trigger):not(.sub-link):hover {
  background: rgba(255,255,255,0.1) !important;
  color: white !important;
  text-decoration: none;
  transform: translateX(4px);
}

.nav-link:not(.accordion-trigger):not(.sub-link).active {
  background: rgba(255,255,255,0.15) !important;
  color: white !important;
  font-weight: 500;
}

/* Accordion Section Container */
.accordion-section {
  margin: 3px 12px;
  width: calc(100% - 24px);
}

/* Accordion Trigger (Main Item) */
.nav-link.accordion-trigger {
  color: rgba(255,255,255,0.8) !important;
  background: transparent !important;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin: 0 !important;
  transition: all 0.3s ease;
  text-decoration: none;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  cursor: pointer;
  border: none;
  outline: none;
}

.nav-link.accordion-trigger:hover {
  background: rgba(255,255,255,0.1) !important;
  color: white !important;
  text-decoration: none;
  transform: translateX(4px);
}

.nav-link.accordion-trigger.expanded {
  background: rgba(255,255,255,0.1) !important;
  color: white !important;
}

/* Accordion Arrow */
.accordion-arrow {
  transition: transform 0.3s ease;
  font-size: 0.875rem;
  opacity: 0.7;
}

.accordion-trigger.expanded .accordion-arrow {
  transform: rotate(180deg);
}

/* Accordion Content Container */
.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: transparent;
  margin: 0;
  padding: 0;
}

.accordion-content.expanded {
  max-height: 500px;
  padding: 4px 0;
}

/* Sub Navigation Links - Override nav-link styles completely */
.nav-link.sub-link {
  color: rgba(255,255,255,0.85) !important;
  background: transparent !important;
  border-radius: var(--radius-sm);
  margin: 2px 0 2px 12px !important;
  padding: 8px 14px 8px 32px !important;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  text-decoration: none;
  display: block;
  transform: none !important;
  width: calc(100% - 12px);
}

.nav-link.sub-link:hover {
  background: rgba(255,255,255,0.15) !important;
  color: white !important;
  text-decoration: none;
  transform: translateX(4px);
}

.nav-link.sub-link.active {
  background: rgba(255,255,255,0.2) !important;
  color: white !important;
  font-weight: 500;
}

/* CRITICAL: Force all non-active, non-hovered sub-links to be transparent */
.accordion-content .nav-link.sub-link:not(:hover):not(.active),
.accordion-content.expanded .nav-link.sub-link:not(:hover):not(.active),
.accordion-section .nav-link.sub-link:not(:hover):not(.active),
.accordion-section.active .nav-link.sub-link:not(:hover):not(.active),
.accordion-section.active .nav-link.sub-link:not(.active):not(:hover),
.accordion-content.expanded .nav-link.sub-link:not(.active):not(:hover),
.nav .nav-link.sub-link:not(.active):not(:hover),
.active .nav-link.sub-link:not(.active):not(:hover) {
  background: transparent !important;
  color: rgba(255,255,255,0.85) !important;
  transform: none !important;
}

/* Page content and layout are handled by full height layout section */

/* =================================
   CARDS & COMPONENTS
   ================================= */

/* Unified Card Styles */
.stats-card, .data-table, .content-card, .file-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  border: none;
  overflow: hidden;
}

.stats-card:hover, .content-card:hover, .file-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.data-table {
  overflow: hidden;
}

/* Form Controls */
.search-input, .form-control, .form-select {
  border-radius: var(--radius-md);
  border: 1px solid var(--color-gray-300);
  transition: all 0.3s ease;
  padding: 0.75rem;
}

.search-input:focus, .form-control:focus, .form-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
  outline: none;
}

/* Buttons - Unified */
.btn-primary, .upload-btn, .btn-gradient {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  transition: all 0.3s ease;
}

.btn-primary:hover, .upload-btn:hover:not(:disabled), .btn-gradient:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102,126,234,0.3);
}

.upload-btn {
  padding: 0.75rem 2rem;
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

/* Action Buttons - Single Definition */
.btn-action {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-gray-300);
  background: white;
  color: var(--color-gray-500);
  font-size: 0.8rem;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  text-decoration: none;
  cursor: pointer;
}

.btn-action:hover {
  background: var(--color-gray-50);
  color: var(--color-gray-600);
  border-color: var(--color-gray-400);
  text-decoration: none;
}

.btn-action.danger {
  border-color: var(--color-danger);
  color: var(--color-danger);
}

.btn-action.danger:hover {
  background: #fef2f2;
  border-color: #dc2626;
  color: #dc2626;
}

.btn-remove {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: rgba(220, 53, 69, 0.1);
  border: none;
  color: var(--color-danger);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  opacity: 0.7;
  cursor: pointer;
}

.btn-remove:hover {
  background: var(--color-danger);
  color: white;
  opacity: 1;
  transform: scale(1.1);
}

.btn-pulse {
  animation: pulse 2s infinite;
}

/* =================================
   AVATARS & BADGES
   ================================= */

.customer-avatar, .avatar-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
}

.avatar-placeholder {
  width: 32px;
  height: 32px;
  background: var(--color-gray-200);
  color: var(--color-gray-500);
  font-size: 0.8rem;
}

/* Status Badges - Single Definition */
.status-badge, .badge {
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 12px;
  font-weight: 500;
}

.status-confirmed, .status-complete, .badge.bg-success { 
  background: #d4edda; 
  color: #155724; 
}
.status-pending { 
  background: #fff3cd; 
  color: #856404; 
}
.status-cancelled { 
  background: #f8d7da; 
  color: #721c24; 
}
.status-online { 
  background: #d4edda; 
  color: #155724; 
}
.status-offline { 
  background: #f8d7da; 
  color: #721c24; 
}

.badge.bg-danger {
  background-color: var(--color-danger) !important;
  animation: failureAttention 2s ease-in-out 3;
}

.badge.bg-warning {
  background-color: var(--color-warning) !important;
  color: #000 !important;
}

.badge.bg-info {
  background-color: var(--color-info) !important;
}

/* =================================
   TOASTS & MODALS
   ================================= */

.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: var(--z-tooltip);
  min-width: 300px;
}

.toast.session-warning {
  border-left: 4px solid #ff6b35;
}

.toast.session-warning .toast-header {
  background-color: rgba(255, 107, 53, 0.1);
}

.modal-content {
  border-radius: var(--radius-lg);
  border: none;
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

/* =================================
   EMPTY STATES
   ================================= */

.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--color-gray-500);
}

.empty-state i {
  margin-bottom: 1rem;
}

.empty-state h3 {
  margin-bottom: 1rem;
  color: var(--color-gray-600);
}

.empty-state p {
  margin-bottom: 2rem;
  color: var(--color-gray-500);
}

.available-pages {
  margin-top: 1rem;
  text-align: left;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* =================================
   COMMUNICATIONS HUB - FIXED NO-SCROLL VERSION
   ================================= */

/* CRITICAL: Force communications page to have NO page scroll at ALL levels */
body.page-communications,
body.page-communications html {
  overflow: hidden !important;
  height: 100vh !important;
  max-height: 100vh !important;
}

body.page-communications .page-wrapper {
  overflow: hidden !important;
}

body.page-communications .main-content {
  overflow: hidden !important;
  height: 100vh !important;
  max-height: 100vh !important;
}

body.page-communications #page-content {
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  max-height: 100% !important;
  flex: 1 !important;
  min-height: 0 !important;
}

/* Make sure all direct children of page-content don't create overflow */
body.page-communications #page-content > * {
  flex-shrink: 0 !important;
  height: auto !important;
}

/* Except the communications-hub which should fill the space */
body.page-communications #page-content > .communications-hub {
  flex: 1 !important;
  flex-shrink: 1 !important;
  min-height: 0 !important;
  height: 100% !important;
  overflow: hidden !important;
}

/* Make the communications hub fill the container exactly */
body.page-communications .communications-hub {
  height: 100% !important;
  max-height: 100% !important;
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
}

/* Communications container grid - fixed height */
body.page-communications .communications-container {
  flex: 1 !important;
  min-height: 0 !important;
  max-height: 100% !important;
  height: 100% !important;
  overflow: hidden !important;
}

/* Main Communications Container */
.communications-hub {
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.communications-container {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 0;
  height: 100%;
  flex: 1;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: white;
  box-shadow: var(--shadow-md);
  position: relative;
  width: 100%;
  min-height: 0;
}

/* Sidebar - Fixed height with INTERNAL scrolling */
.conversations-sidebar {
  border-right: 1px solid var(--color-gray-200);
  display: flex;
  flex-direction: column;
  background: var(--color-gray-50);
  height: 100%;
  overflow: hidden;
}

.sidebar-header {
  padding: 1rem;
  background: white;
  border-bottom: 1px solid var(--color-gray-200);
  flex-shrink: 0;
}

/* KEY FIX: Conversation list scrolls INSIDE the sidebar */
.conversation-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
  min-height: 0;
  background: white;
}

/* Messages Panel - Fixed height with INTERNAL scrolling */
.messages-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: white;
  overflow: hidden;
}

#messages-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.conversation-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--color-gray-200);
  background: white;
  flex-shrink: 0;
  z-index: var(--z-sticky);
}

/* KEY FIX: Messages list scrolls INSIDE the panel */
.messages-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.5rem;
  background: #f0f2f5;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Message Input - Fixed at bottom */
.message-input-container {
  padding: 1rem 1.5rem;
  background: white;
  border-top: 1px solid var(--color-gray-200);
  flex-shrink: 0;
  position: relative;
  z-index: var(--z-sticky);
}

/* Conversation Items - WhatsApp Style */
.conversation-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  background: white;
  transition: background-color 0.2s;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.conversation-item:hover {
  background: #f5f5f5;
}

.conversation-item.active {
  background: #e9f5ff;
}

.conversation-item.unread {
  background: #fff;
}

.conversation-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

/* Channel icon colors */
.channel-icon-email {
  color: #0d6efd;
  background: #e7f3ff;
  padding: 10px;
  border-radius: 50%;
}

.channel-icon-whatsapp {
  color: var(--color-whatsapp);
  background: #e8f8f0;
  padding: 10px;
  border-radius: 50%;
}

.channel-icon-instagram {
  color: #E4405F;
  background: #ffe7ec;
  padding: 10px;
  border-radius: 50%;
}

.channel-icon-facebook {
  color: #1877F2;
  background: #e7f2ff;
  padding: 10px;
  border-radius: 50%;
}

/* Message Bubbles - WhatsApp Style */
.message {
  display: flex;
  margin-bottom: 0.75rem;
  animation: messageSlide 0.3s ease-out;
  clear: both;
}

.message-received {
  justify-content: flex-start;
}

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

.message-bubble {
  max-width: 75%;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  position: relative;
  word-wrap: break-word;
  box-shadow: var(--shadow-sm);
}

.conversation-header[data-channel="whatsapp"] ~ .messages-list .message-received .message-bubble,
.messages-list[data-channel="whatsapp"] .message-received .message-bubble {
  background: white;
  border-radius: var(--radius-md);
  border-bottom-left-radius: 2px;
}

.conversation-header[data-channel="whatsapp"] ~ .messages-list .message-sent .message-bubble,
.messages-list[data-channel="whatsapp"] .message-sent .message-bubble {
  background: #dcf8c6;
  color: #000;
  border-radius: var(--radius-md);
  border-bottom-right-radius: 2px;
}

.message-received .message-bubble {
  background: white;
  border: 1px solid var(--color-gray-200);
  border-bottom-left-radius: 4px;
}

.message-sent .message-bubble {
  background: #0d6efd;
  color: white;
  border-bottom-right-radius: 4px;
}

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

.message-content a {
  color: inherit;
  text-decoration: underline;
}

/* Message Footer - Time and Status */
.message-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  justify-content: flex-end;
}

.message-time {
  font-size: 0.7rem;
  opacity: 0.7;
}

.message-status {
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  opacity: 0.8;
  color: #999;
}

.message-status i {
  font-size: 0.9rem;
}

.message-status.status-sent {
  color: #999 !important;
}

.message-status.status-delivered {
  color: #999 !important;
}

.message-status.status-read {
  color: #4FC3F7 !important;
}

.message-status.status-failed {
  color: #f44336 !important;
}

/* Sender Name */
.message-sender-name {
  font-size: 0.7rem;
  font-weight: 500;
  color: #000000 !important;
  margin-top: 4px;
  text-align: right;
  opacity: 0.7;
}

.message-sent .message-sender-name {
  color: #000000 !important;
  text-align: right;
}

.message-received .message-sender-name {
  color: #000000 !important;
  text-align: left;
}

/* Reactions - WhatsApp Style */
.message {
  position: relative;
}

.message-reactions-whatsapp {
  position: absolute;
  bottom: -8px;
  right: 8px;
  display: flex;
  gap: 4px;
  z-index: var(--z-dropdown);
}

.reaction-bubble {
  background: white;
  border: 1px solid var(--color-gray-200);
  border-radius: 12px;
  padding: 2px 6px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  box-shadow: var(--shadow-sm);
  cursor: default;
  min-width: 32px;
  height: 24px;
  justify-content: center;
  transition: all 0.2s;
}

.reaction-bubble:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.reaction-emoji {
  font-size: 14px;
  line-height: 1;
}

.reaction-count {
  font-size: 11px;
  font-weight: 600;
  color: #666;
  line-height: 1;
}

.message-sent .reaction-bubble {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.message-received .reaction-bubble {
  background: white;
  border: 1px solid var(--color-gray-200);
}

.message:has(.message-reactions-whatsapp) {
  margin-bottom: 1rem;
}

/* Reply Form */
#reply-form {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

#message-input {
  flex: 1;
  resize: none;
  border-radius: 24px;
  border: 1px solid var(--color-gray-200);
  padding: 10px 16px;
  font-size: 14px;
  max-height: 120px;
  overflow-y: auto;
  background: white;
}

#message-input:focus {
  border-color: var(--color-whatsapp);
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
  outline: none;
}

#reply-form .btn {
  border-radius: 50%;
  width: 44px;
  height: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#reply-form .btn-primary {
  background: var(--color-whatsapp);
  border: none;
}

#reply-form .btn-primary:hover {
  background: #1ea952;
}

/* Channel Filters */
.channel-filters .btn {
  flex: 1;
}

.channel-filter.active {
  background-color: #0d6efd;
  color: white;
}

/* Loading States */
.loading-messages {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

/* Mobile Header Controls */
.mobile-header-controls {
  display: none;
}

.exit-button {
  display: none;
}

.mobile-header-title {
  display: none;
}

.back-button {
  display: none;
}
/* =================================
   SIGNAGE SPECIFIC STYLES
   ================================= */

/* Upload Zone - Single Definition */
.upload-zone {
  background: linear-gradient(135deg, var(--color-gray-50) 0%, #ffffff 100%);
  border: 2px dashed var(--color-gray-300);
  border-radius: var(--radius-xl);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.upload-zone::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.upload-zone:hover::before { 
  opacity: 1; 
}

.upload-zone:hover, 
.upload-zone.dragover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

.upload-zone.dragover {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  transform: scale(1.02);
}

.upload-zone.has-files {
  border-color: var(--color-success);
  background: linear-gradient(135deg, rgba(40, 167, 69, 0.05) 0%, rgba(40, 167, 69, 0.1) 100%);
}

.upload-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2rem;
  transition: all 0.3s ease;
}

.upload-zone:hover .upload-icon {
  transform: scale(1.1) rotate(5deg);
}

/* File Grid and Cards - Single Definition */
.file-grid, .content-grid, .content-library {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.content-grid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.file-card, .content-card {
  padding: 1.25rem;
  border: 1px solid var(--color-gray-200);
  position: relative;
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.file-card::before, .content-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-dark));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.file-card:hover::before, .content-card:hover::before {
  transform: scaleX(1);
}

.content-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

/* File Type Badges - Single Definition */
.file-type-badge {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.75rem;
  margin-right: 0.75rem;
  text-transform: uppercase;
}

.file-type-video { 
  background: linear-gradient(135deg, #e74c3c, #c0392b); 
  color: white; 
}
.file-type-image { 
  background: linear-gradient(135deg, #27ae60, #2ecc71); 
  color: white; 
}
.file-type-html { 
  background: linear-gradient(135deg, #f39c12, #f1c40f); 
  color: white; 
}
.file-type-other { 
  background: linear-gradient(135deg, #95a5a6, #7f8c8d); 
  color: white; 
}

/* Content Preview */
.content-preview, .thumbnail-container {
  height: 160px;
  background: linear-gradient(135deg, var(--color-gray-50) 0%, var(--color-gray-200) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--color-gray-400);
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
}

.thumbnail-container {
  height: 180px;
  width: 100%;
}

.content-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumbnail-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: white;
  font-size: 3rem;
}

.content-preview::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(45deg, transparent 0%, rgba(102, 126, 234, 0.1) 50%, transparent 100%);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.content-card:hover .content-preview::before {
  transform: translateX(100%);
}

.content-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.content-card:hover .content-overlay {
  opacity: 1;
}

.play-button {
  width: 60px;
  height: 60px;
  background: rgba(255,255,255,0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #333;
}

.content-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
}

.content-body {
  padding: 1rem;
}

.content-type-tag {
  display: inline-block;
  padding: 4px 8px;
  background: var(--color-gray-200);
  color: var(--color-gray-700);
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.content-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #1f2937;
}

.content-meta {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.content-actions {
  display: flex;
  gap: 0.5rem;
}

/* Progress Bars - Single Definition */
.progress-section {
  margin-top: 2rem;
  padding: 2rem;
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  display: none;
}

.progress-section.active {
  display: block;
  animation: slideUp 0.5s ease;
}

.progress-bar-wrapper, .progress {
  position: relative;
  height: 12px;
  background: var(--color-gray-200);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.progress {
  height: 8px;
  background-color: var(--color-gray-200);
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-dark));
  border-radius: 6px;
  transition: width 0.3s ease;
  position: relative;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}

.progress-bar.bg-success {
  background-color: var(--color-success) !important;
}

.progress-bar.bg-info {
  background-color: var(--color-info) !important;
}

.progress-bar.bg-warning {
  background-color: var(--color-warning) !important;
}

.progress-bar.bg-danger {
  background-color: var(--color-danger) !important;
}

/* =================================
   WIFI SPECIFIC STYLES
   ================================= */

.signal-bars {
  display: flex;
  gap: 8px;
  align-items: end;
  height: 60px;
  margin: 10px 0;
}

.signal-bar {
  flex: 1;
  min-height: 10px;
  border-radius: 3px;
  position: relative;
  display: flex;
  align-items: end;
  justify-content: center;
}

.signal-bar.excellent { 
  background: linear-gradient(to top, #27ae60, #2ecc71); 
}
.signal-bar.good { 
  background: linear-gradient(to top, #2980b9, #3498db); 
}
.signal-bar.fair { 
  background: linear-gradient(to top, #f39c12, #f1c40f); 
}
.signal-bar.poor { 
  background: linear-gradient(to top, #e74c3c, #c0392b); 
}

.signal-count {
  color: white;
  font-size: 0.75rem;
  font-weight: bold;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* =================================
   SCHEDULE MANAGER STYLES
   ================================= */

/* Weekly Schedule Grid Styles */
.weekly-schedule-table {
  display: grid;
  grid-template-columns: 80px repeat(7, 1fr);
  gap: 1px;
  background: #e2e8f0;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.schedule-header-row {
  display: contents;
}

.time-header {
  background: var(--color-gray-50);
  padding: 16px 12px;
  font-weight: 600;
  text-align: center;
  border-right: 2px solid #cbd5e1;
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}

.day-header {
  background: var(--color-gray-50);
  padding: 16px 12px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}

.day-name {
  font-weight: 600;
  font-size: 14px;
  color: #1e293b;
}

.day-date {
  font-size: 12px;
  color: #64748b;
  margin-top: 4px;
}

.schedule-time-row {
  display: contents;
}

.time-label {
  background: #ffffff;
  padding: 8px 12px;
  text-align: center;
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
  border-right: 2px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 60px;
}

.day-cell {
  background: #ffffff;
  min-height: 60px;
  position: relative;
}

/* Empty time slots */
.empty-time-slot {
  width: 100%;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px dashed transparent;
}

.empty-time-slot:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.time-slot-indicator {
  color: #cbd5e1;
  font-size: 20px;
  opacity: 0;
  transition: opacity 0.2s;
}

.empty-time-slot:hover .time-slot-indicator {
  opacity: 1;
}

/* Schedule blocks */
.schedule-block {
  width: 100%;
  cursor: pointer;
  transition: all 0.2s;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 2px solid rgba(255, 255, 255, 0.3);
  position: relative;
}

.schedule-block:hover {
  transform: translateX(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
  border-color: rgba(255, 255, 255, 0.6);
  z-index: var(--z-dropdown);
}

.schedule-content {
  padding: 12px;
  color: white;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.schedule-playlist {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.schedule-time {
  font-size: 12px;
  opacity: 0.95;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.schedule-priority {
  font-size: 11px;
  opacity: 0.9;
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
}

/* Continuation blocks */
.schedule-continuation {
  width: 100%;
  cursor: pointer;
  transition: all 0.2s;
  border-radius: 6px;
  overflow: hidden;
  border: 2px dashed rgba(255, 255, 255, 0.5);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.schedule-continuation:hover {
  opacity: 1 !important;
  border-color: rgba(255, 255, 255, 0.8);
  z-index: var(--z-dropdown);
}

.continuation-indicator {
  color: white;
  text-align: center;
  font-style: italic;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

/* Modal styles */
.day-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px;
  background: var(--color-gray-50);
  border-radius: 6px;
}

.day-selector .form-check-inline {
  margin: 0;
}

.day-selector .form-check-label {
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}

.day-selector .form-check-input:checked + .form-check-label {
  color: #2563eb;
}

/* Priority Colors */
.priority-normal { 
  background: var(--color-success) !important; 
}
.priority-high { 
  background: var(--color-info) !important; 
}
.priority-critical { 
  background: var(--color-warning) !important; 
}
.priority-emergency { 
  background: var(--color-danger) !important; 
}

/* =================================
   TEMPLATE EDITOR STYLES
   ================================= */

.template-editor {
  min-height: 100vh;
  background: var(--color-gray-50);
}

.editor-container {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.editor-header {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: white;
  padding: 20px;
}

.editor-pane {
  min-height: 600px;
}

.CodeMirror {
  height: 600px !important;
  font-size: 14px;
  border: none;
}

.preview-pane {
  background: #1a1a1a;
  color: white;
  padding: 20px;
  overflow-y: auto;
}

.variable-panel {
  background: var(--color-gray-50);
  border-left: 1px solid var(--color-gray-300);
  padding: 20px;
  overflow-y: auto;
  max-height: 600px;
}

/* =================================
   STATUS MESSAGES
   ================================= */

.status-message {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-lg);
  margin-top: 1rem;
  display: none;
  animation: fadeIn 0.3s ease;
}

.status-message.success {
  background: linear-gradient(135deg, rgba(40, 167, 69, 0.1), rgba(40, 167, 69, 0.05));
  border: 1px solid rgba(40, 167, 69, 0.2);
  color: #155724;
  display: block;
}

.status-message.error {
  background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(220, 53, 69, 0.05));
  border: 1px solid rgba(220, 53, 69, 0.2);
  color: #721c24;
  display: block;
}

/* =================================
   SIGNAGE DASHBOARD STYLES
   ================================= */

/* Stat Circles for Device Overview */
.stat-circle {
  padding: 15px;
  border-radius: var(--radius-md);
  text-align: center;
  transition: all 0.2s ease;
}

.stat-circle:hover {
  transform: translateY(-2px);
}

.stat-circle.online {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.stat-circle.offline {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.stat-circle.warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 4px;
  line-height: 1;
}

.stat-number.updated {
  animation: statUpdate 0.3s ease;
}

.stat-label {
  font-size: 0.75rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

/* Activity Feed */
.activity-feed {
  max-height: 400px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.activity-item {
  padding: 8px 0;
  border-bottom: 1px solid #f1f3f4;
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.75rem;
  flex-shrink: 0;
  font-weight: 500;
}

.activity-content {
  flex: 1;
  min-width: 0;
}

.activity-message {
  font-size: 0.875rem;
  line-height: 1.3;
  margin-bottom: 2px;
  word-wrap: break-word;
}

.activity-time {
  font-size: 0.75rem;
  color: var(--color-gray-500);
  font-weight: 400;
}

/* Network Status */
.network-status {
  background: var(--color-gray-50);
  padding: 12px;
  border-radius: 6px;
  border: 1px solid var(--color-gray-200);
}

.network-status .badge {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Device Groups */
.device-group-item {
  padding: 8px 0;
  border-bottom: 1px solid #f1f3f4;
}

.device-group-item:last-child {
  border-bottom: none;
}

.device-group-item .small {
  font-size: 0.8rem;
  font-weight: 500;
}

.device-group-item .progress {
  margin-top: 4px;
}

/* Error States */
.signage-error-state {
  text-align: center;
  padding: 2rem 1rem;
  background: rgba(220, 53, 69, 0.05);
  border: 1px solid rgba(220, 53, 69, 0.1);
  border-radius: var(--radius-md);
}

.signage-error-state i {
  font-size: 2.5rem;
  color: var(--color-danger);
  margin-bottom: 1rem;
  opacity: 0.7;
}

.signage-error-state h6 {
  color: #721c24;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.signage-error-state p {
  color: #856404;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

/* Device Overview Section */
.device-overview {
  background: var(--color-gray-50);
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-gray-200);
}

.device-overview .row {
  margin: 0;
}

.device-overview .col-4 {
  padding: 0 0.5rem;
}

/* Status Indicators */
.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.status-indicator.online {
  background: var(--color-success);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.status-indicator.offline {
  background: var(--color-danger);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.status-indicator.warning {
  background: var(--color-warning);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

/* =================================
   PREVIEW MODAL STYLES
   ================================= */

.preview-container {
  display: flex;
  gap: 2rem;
  min-height: 400px;
  max-height: 70vh;
  overflow: hidden;
}

.preview-media {
  flex: 2;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.preview-image {
  width: 100%;
  max-width: 100%;
  max-height: 500px;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

.preview-video {
  width: 100%;
  max-width: 100%;
  max-height: 500px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  aspect-ratio: 16/9;
  background: #000;
  transition: all 0.3s ease;
}

.preview-iframe {
  width: 100%;
  max-width: 100%;
  height: 500px;
  max-height: 500px;
  border: none;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

.preview-info {
  flex: 1;
  background: var(--color-gray-50);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  height: fit-content;
  min-width: 250px;
  max-width: 350px;
}

.preview-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  background: var(--color-gray-50);
  border-radius: var(--radius-md);
  color: #6b7280;
}

.orientation-selector {
  margin-bottom: 1rem;
}

/* =================================
   PLAYLIST MANAGEMENT STYLES
   ================================= */

/* Playlist Cards */
.playlist-card {
  background: white;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.playlist-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

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

.playlist-info h5 {
  margin: 0 0 4px 0;
  color: #1f2937;
  font-weight: 600;
}

.content-count {
  font-size: 0.875rem;
  color: #6b7280;
}

.playlist-duration {
  background: #f3f4f6;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-gray-700);
}

.playlist-description {
  color: #6b7280;
  margin-bottom: 16px;
  line-height: 1.5;
}

.playlist-meta {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  font-size: 0.875rem;
  color: #9ca3af;
}

.meta-item {
  display: flex;
  align-items: center;
}

.playlist-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Editor Modal Styles */
.content-panel {
  background: var(--color-gray-50);
  border: 1px solid var(--color-gray-300);
  border-radius: var(--radius-md);
  padding: 16px;
  height: 500px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.panel-header {
  margin-bottom: 16px;
}

.panel-header h6 {
  margin: 0 0 4px 0;
  font-weight: 600;
}

.content-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  position: relative;
}

.content-item, 
.playlist-item {
  background: white;
  border: 1px solid var(--color-gray-200);
  border-radius: 6px;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.content-item:hover, 
.playlist-item:hover {
  border-color: #0d6efd;
  box-shadow: var(--shadow-md);
}

.content-item-inner, 
.playlist-item-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  position: relative;
  overflow: hidden;
}

.content-icon {
  width: 32px;
  height: 32px;
  background: var(--color-gray-200);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #6b7280;
  flex-shrink: 0;
}

.content-info {
  flex: 1;
  min-width: 0;
  position: relative;
  overflow: hidden;
}

.content-title {
  font-weight: 500;
  margin-bottom: 4px;
  font-size: 0.875rem;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
}

.content-type {
  background: var(--color-gray-200);
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 500;
}

.content-duration {
  background: var(--color-gray-700);
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  min-width: 35px;
  text-align: center;
  display: inline-block;
  white-space: nowrap;
  position: static !important;
  float: none !important;
  transform: none !important;
  flex-shrink: 0;
}

.duration-editor {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
  position: relative;
  flex-shrink: 0;
}

.duration-input {
  width: 45px;
  height: 22px;
  border: 1px solid #d1d5db;
  border-radius: 3px;
  padding: 0 4px;
  font-size: 0.75rem;
  text-align: center;
  background: white;
  color: var(--color-gray-700);
}

.duration-unit {
  font-size: 0.75rem;
  color: #6b7280;
  font-weight: 500;
}

.btn-add, 
.btn-remove {
  width: 28px;
  height: 28px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-add:hover {
  background: #0d6efd;
  border-color: #0d6efd;
  color: white;
}

.btn-remove:hover {
  background: var(--color-danger);
  border-color: var(--color-danger);
  color: white;
}

.drag-handle {
  cursor: grab;
  color: #9ca3af;
  padding: 4px;
}

.drag-handle:hover {
  color: #6b7280;
}

.drag-handle:active {
  cursor: grabbing;
}

/* Drag and Drop Visual Effects */
.drag-over {
  border-color: #0d6efd !important;
  background-color: rgba(13, 110, 253, 0.05) !important;
}

.playlist-item-placeholder {
  height: 60px;
  margin: 8px 0;
  border: 2px dashed #0d6efd;
  border-radius: 6px;
  background: rgba(13, 110, 253, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse 1s infinite;
}

.placeholder-content {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #0d6efd;
  font-size: 0.875rem;
  font-weight: 500;
}

.content-item[draggable="true"] {
  cursor: grab;
}

.content-item[draggable="true"]:active {
  cursor: grabbing;
}

.content-item.dragging,
.playlist-item.dragging {
  opacity: 0.5;
  transform: rotate(2deg);
}

.playlist-item.dragging .content-duration,
.content-item.dragging .content-duration {
  background: #1f2937 !important;
  color: white !important;
  border-color: var(--color-gray-700) !important;
  position: static !important;
}

.playlist-info {
  padding: 8px 12px;
  background: #e3f2fd;
  border-radius: 6px;
  font-size: 0.875rem;
  color: #1565c0;
}

.empty-playlist {
  color: #9ca3af;
  padding: 40px 20px;
}

.search-filter input {
  border-radius: 6px;
}

/* =================================
   DISPLAY GROUPS STYLES
   ================================= */

/* Group Cards */
.group-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  border: 1px solid var(--color-gray-200);
  margin-bottom: 20px;
}

.group-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.group-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 16px;
}

.group-info {
  flex: 1;
}

.group-title {
  margin: 0 0 4px 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #1a1a1a;
}

.device-count {
  font-size: 0.875rem;
  color: var(--color-gray-500);
}

.group-status {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 12px;
  margin-top: 6px;
  flex-shrink: 0;
}

.group-status.online {
  background: var(--color-success);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.group-status.offline {
  background: var(--color-danger);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

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

.master-badge {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: white;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.no-master-badge {
  background: #f3f4f6;
  color: #6b7280;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  white-space: nowrap;
}

.group-description {
  color: var(--color-gray-500);
  font-size: 0.875rem;
  margin-bottom: 20px;
  line-height: 1.5;
}

.group-stats {
  display: flex;
  gap: 24px;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--color-gray-50);
  border-radius: var(--radius-md);
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.stat-item i {
  font-size: 1.25rem;
  color: #0d6efd;
}

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

.stat-value {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--color-gray-500);
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.group-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Device Management Panels */
.device-panel {
  background: var(--color-gray-50);
  border: 1px solid var(--color-gray-300);
  border-radius: var(--radius-md);
  padding: 16px;
  height: 500px;
  display: flex;
  flex-direction: column;
}

.device-panel h6 {
  margin-bottom: 4px;
  font-weight: 600;
}

.device-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  margin-top: 12px;
}

/* Device Items */
.device-item {
  background: white;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  padding: 12px;
}

.device-item:last-child {
  margin-bottom: 0;
}

.device-item:hover {
  border-color: #0d6efd;
  box-shadow: var(--shadow-md);
}

.device-item-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.device-status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.device-status-indicator.online {
  background: var(--color-success);
}

.device-status-indicator.offline {
  background: var(--color-danger);
}

.device-icon {
  width: 32px;
  height: 32px;
  background: var(--color-gray-200);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #6b7280;
  flex-shrink: 0;
}

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

.device-name {
  font-weight: 500;
  margin-bottom: 2px;
  font-size: 0.875rem;
  color: #1f2937;
  display: flex;
  align-items: center;
  gap: 4px;
}

.device-meta {
  font-size: 0.75rem;
  color: #6b7280;
  margin: 0;
}

.device-status-text {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-gray-500);
}

.device-id {
  font-family: monospace;
  background: var(--color-gray-50);
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 0.75rem;
}

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

/* Device Status Indicators in Lists */
.device-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 12px;
  flex-shrink: 0;
}

.device-status.online {
  background: var(--color-success);
}

.device-status.offline {
  background: var(--color-danger);
}

/* Device List Modal */
.devices-list {
  max-height: 400px;
  overflow-y: auto;
}

.device-item-placeholder {
  height: 60px;
  margin: 8px 0;
  border: 2px dashed #0d6efd;
  border-radius: 6px;
  background: rgba(13, 110, 253, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse 1s infinite;
}

.group-device-item {
  background: white;
  border: 1px solid var(--color-gray-200);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.group-device-item:hover {
  border-color: #0d6efd;
  box-shadow: var(--shadow-md);
}

.last-seen {
  color: #9ca3af;
}

/* =================================
   TABLE MAPPING STYLES
   ================================= */

/* Zone Sections */
.zone-section {
  background: white;
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-gray-200);
}

.zone-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-gray-200);
}

.zone-title {
  margin: 0;
  font-weight: 600;
  color: #1a1a1a;
  display: flex;
  align-items: center;
}

.zone-stats {
  display: flex;
  gap: 16px;
  font-size: 0.875rem;
}

.zone-count {
  color: var(--color-gray-500);
  background: var(--color-gray-50);
  padding: 4px 8px;
  border-radius: 12px;
}

.zone-mapped {
  color: #0d6efd;
  background: rgba(13, 110, 253, 0.1);
  padding: 4px 8px;
  border-radius: 12px;
  font-weight: 500;
}

/* Tables Grid */
.tables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

/* Table Cards */
.table-card {
  border: 2px solid var(--color-gray-200);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: all 0.3s ease;
  position: relative;
  background: white;
}

.table-card.has-device {
  border-color: var(--color-success);
  background: rgba(34, 197, 94, 0.02);
}

.table-card.no-device {
  border-color: var(--color-warning);
  background: rgba(245, 158, 11, 0.02);
}

.table-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

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

.table-name {
  margin: 0;
  font-weight: 600;
  color: #1a1a1a;
  font-size: 1rem;
}

.table-capacity {
  color: var(--color-gray-500);
  display: flex;
  align-items: center;
  margin-top: 4px;
  font-size: 0.7rem;
  font-weight: normal;
}

.table-status {
  display: flex;
  align-items: center;
}

/* Device Indicators */
.device-indicator, 
.no-device-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-top: 2px;
}

.device-indicator.online {
  background: var(--color-success);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.device-indicator.offline {
  background: var(--color-danger);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.no-device-indicator {
  background: var(--color-warning);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

/* Table Body */
.table-body {
  min-height: 80px;
}

/* Assigned Device */
.assigned-device {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px;
  background: rgba(34, 197, 94, 0.05);
  border-radius: 6px;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.device-location {
  font-size: 0.75rem;
  color: var(--color-gray-500);
  margin-top: 2px;
  display: flex;
  align-items: center;
}

/* No Device Assigned */
.no-device-assigned {
  text-align: center;
  padding: 24px 12px;
  border: 2px dashed var(--color-warning);
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.05);
}

.no-device-message {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
  color: #92400e;
  font-size: 0.875rem;
}

/* Unassigned Section */
.unassigned-section {
  background: white;
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-gray-200);
}

.unassigned-devices {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.unassigned-device {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-md);
  background: white;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.unassigned-device:hover {
  border-color: #0d6efd;
  background: rgba(13, 110, 253, 0.02);
  box-shadow: var(--shadow-md);
}

.unassigned-device-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.unassigned-device .device-info {
  flex: 1;
}

.device-details {
  color: var(--color-gray-500);
  font-size: 0.75rem;
}

/* =================================
   SCHEDULE MANAGER COMPLETE STYLES
   ================================= */

/* Simple Tab System */
.tab-content-area {
  display: block;
}

/* Tab Button Styling */
.btn-primary {
  background-color: #0d6efd;
  border-color: #0d6efd;
  color: white;
}

.btn-outline-primary {
  color: #0d6efd;
  border-color: #0d6efd;
  background-color: transparent;
}

.btn-outline-primary:hover {
  background-color: #0d6efd;
  border-color: #0d6efd;
  color: white;
}

/* Quick Schedule Container */
.quick-schedule-container {
  min-height: 600px;
}

.week-navigation {
  background: var(--color-gray-50);
  border-bottom: 1px solid var(--color-gray-300);
}

/* Scrollable Schedule Grid with Sticky Headers */
.weekly-grid {
  max-height: 70vh;
  overflow-y: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-gray-200);
}

/* Current Time Indicator */
.current-time-indicator {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  background: var(--color-danger);
  z-index: var(--z-fixed);
  pointer-events: none;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

.current-time-indicator::before {
  content: '';
  position: absolute;
  left: -4px;
  top: -3px;
  width: 8px;
  height: 8px;
  background: var(--color-danger);
  border-radius: 50%;
}

/* Advanced Rules Tab */
.advanced-rules-container {
  min-height: 500px;
}

.rule-card {
  background: white;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
  transition: all 0.2s ease;
}

.rule-card:hover {
  border-color: #0d6efd;
  box-shadow: var(--shadow-md);
}

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

.rule-info {
  flex: 1;
}

.rule-name {
  margin: 0;
  font-weight: 600;
  color: #1a1a1a;
  font-size: 1.1rem;
}

.rule-description {
  margin: 4px 0 0 0;
  color: var(--color-gray-500);
  font-size: 0.875rem;
}

.rule-status .badge {
  font-size: 0.75rem;
  padding: 4px 8px;
}

.rule-details {
  margin-bottom: 16px;
  padding: 12px;
  background: var(--color-gray-50);
  border-radius: 6px;
}

.rule-pattern, .rule-playlist {
  margin-bottom: 8px;
  font-size: 0.875rem;
}

.rule-pattern:last-child, .rule-playlist:last-child {
  margin-bottom: 0;
}

.rule-actions {
  display: flex;
  gap: 8px;
}

/* Preview Tab */
.preview-container {
  min-height: 500px;
}

/* Schedule Modal */
#quickScheduleModal .modal-dialog {
  max-width: 500px;
}

/* =================================
   RESERVATIONS SYSTEM STYLES
   ================================= */

/* Reservation Header Styles */
.reservation-header {
  border-radius: var(--radius-lg) !important;
  border: none !important;
  box-shadow: var(--shadow-md) !important;
  background: linear-gradient(135deg, #ffffff 0%, var(--color-gray-50) 100%) !important;
}

.reservation-title {
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 8px;
}

.reservation-status {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Tab Navigation Enhancements */
.nav-pills .nav-link {
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  font-weight: 600;
  color: #64748b;
  margin: 0 2px;
}

.nav-pills .nav-link.active,
.card .card-body .nav.nav-pills .nav-link.active,
.nav.nav-pills.nav-fill .nav-link.active {
  background: linear-gradient(135deg, var(--color-primary-light) 0%, #7c3aed 100%) !important;
  color: white !important;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3) !important;
}

.nav-pills .nav-link:not(.active):hover,
.card .card-body .nav.nav-pills .nav-link:not(.active):hover,
.nav.nav-pills.nav-fill .nav-link:not(.active):hover {
  background: #f1f5f9 !important;
  color: #334155 !important;
}

.nav-pills .nav-link .badge {
  background: rgba(255, 255, 255, 0.2) !important;
  color: white;
  font-size: 9px;
  padding: 2px 6px;
  margin-left: 6px;
}

.card .card-body .nav.nav-pills {
  background: transparent;
}

.card .card-body .nav.nav-pills .nav-link,
.nav.nav-pills.nav-fill .nav-link {
  color: #64748b !important;
  background: transparent !important;
  font-weight: 600 !important;
  border-radius: var(--radius-md) !important;
  transition: all 0.2s ease !important;
  padding: 0.75rem 1.25rem !important;
}

/* Tab Content Container */
.tab-content-container {
  min-height: 500px;
}

.tab-pane {
  animation: fadeIn 0.3s ease-in-out;
}

/* Reservation Details Sections */
.reservation-details-section {
  border-radius: var(--radius-lg);
  border: none;
  box-shadow: var(--shadow-sm);
  height: 100%;
}

.reservation-details-section .card-header {
  background: linear-gradient(135deg, var(--color-gray-50) 0%, #f1f5f9 100%);
  border-bottom: 1px solid #e2e8f0;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
  padding: 16px 20px;
}

.reservation-details-section .card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-gray-700);
  margin: 0;
}

.reservation-details-section .card-body {
  padding: 20px;
}

/* Enhanced Form Controls */
.form-label {
  font-weight: 600;
  color: var(--color-gray-700);
  margin-bottom: 6px;
  font-size: 13px;
}

/* Stats Cards */
.stats-card {
  border-radius: var(--radius-lg);
  border: none;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  height: 100%;
}

.stats-card .card-body {
  padding: 24px;
}

/* Message Thread Styles */
.message-thread {
  max-height: 500px;
  overflow-y: auto;
  background: var(--color-gray-50);
  border-radius: var(--radius-md);
  padding: 16px;
}

.message-item {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px;
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.message-item:last-child {
  margin-bottom: 0;
}

.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary-light) 0%, #7c3aed 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

.message-content {
  flex: 1;
  min-width: 0;
}

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

.message-sender {
  font-weight: 600;
  color: #1e293b;
  font-size: 14px;
}

.message-time {
  font-size: 12px;
  color: #64748b;
}

.message-subject {
  font-weight: 600;
  color: var(--color-gray-700);
  margin-bottom: 4px;
  font-size: 13px;
}

.message-text {
  color: #6b7280;
  line-height: 1.5;
  font-size: 13px;
}

/* Payment Summary Styles */
.payment-summary .bg-success {
  background-color: rgba(16, 185, 129, 0.1) !important;
}

.payment-summary .bg-danger {
  background-color: rgba(239, 68, 68, 0.1) !important;
}

.payment-summary .bg-info {
  background-color: rgba(59, 130, 246, 0.1) !important;
}

.payment-summary .bg-warning {
  background-color: rgba(245, 158, 11, 0.1) !important;
}

.payment-summary .rounded {
  border-radius: var(--radius-md) !important;
}

/* Payment List Styles */
.payment-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto auto;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6;
  align-items: center;
  font-size: 14px;
}

.payment-item:last-child {
  border-bottom: none;
}

.payment-header {
  background: var(--color-gray-50);
  font-weight: 600;
  color: var(--color-gray-700);
  border-bottom: 2px solid var(--color-gray-200);
}

.payment-status {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.payment-status.bg-success {
  background: #dcfce7 !important;
  color: #166534 !important;
}

.payment-status.bg-warning {
  background: #fef3c7 !important;
  color: #92400e !important;
}

.payment-status.bg-danger {
  background: #fee2e2 !important;
  color: #dc2626 !important;
}

/* Enhanced Table Styles */
.table {
  border-radius: var(--radius-md);
  overflow: hidden;
  border-collapse: separate;
  border-spacing: 0;
}

.table thead th {
  background: var(--color-gray-50);
  border-bottom: 2px solid var(--color-gray-200);
  font-weight: 600;
  color: var(--color-gray-700);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 16px 12px;
}

.table tbody td {
  padding: 12px;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
  font-size: 14px;
}

.table tbody tr:hover {
  background: var(--color-gray-50);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* Action Buttons */
.btn {
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: all 0.2s ease;
  border: none;
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.btn-success:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-1px);
}

.btn-outline-secondary {
  border: 1px solid #d1d5db;
  color: #6b7280;
  background: white;
}

.btn-outline-secondary:hover {
  background: #f9fafb;
  border-color: #9ca3af;
  color: var(--color-gray-700);
  transform: translateY(-1px);
}

.btn-outline-info {
  border: 1px solid var(--color-info);
  color: var(--color-info);
  background: white;
}

.btn-outline-info:hover {
  background: var(--color-info);
  color: white;
  transform: translateY(-1px);
}

/* =================================
   NOTIFICATION BELL STYLES
   ================================= */

.notification-bell {
  position: relative;
  cursor: pointer;
  padding: 8px;
  margin-left: 8px;
  transition: all 0.2s;
}

.notification-bell:hover {
  background: rgba(0, 0, 0, 0.05);
  border-radius: var(--radius-md);
}

.notification-bell i {
  font-size: 20px;
  color: var(--color-gray-600);
}

.notification-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--color-danger);
  color: white;
  border-radius: 10px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
  animation: notificationPulse 2s infinite;
  box-shadow: 0 2px 4px rgba(220, 53, 69, 0.4);
}

.notification-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--color-gray-50);
}

.notification-header h6 {
  margin: 0;
  font-weight: 600;
  font-size: 16px;
  color: var(--color-gray-800);
}

.notification-header .btn-link {
  font-size: 13px;
  text-decoration: none;
  padding: 0;
}

.notification-list {
  max-height: 400px;
  overflow-y: auto;
}

.notification-item {
  padding: 14px 20px;
  border-bottom: 1px solid #f1f3f5;
  cursor: pointer;
  transition: background 0.2s;
  position: relative;
}

.notification-item:last-child {
  border-bottom: none;
}

.notification-item:hover {
  background: var(--color-gray-50);
}

.notification-item.unread {
  background: #e7f3ff;
}

.notification-item.unread:hover {
  background: #d0e7ff;
}

.notification-item.unread::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  background: #0d6efd;
  border-radius: 50%;
}

.notification-content {
  display: flex;
  align-items: start;
  gap: 12px;
  padding-left: 8px;
}

.notification-item.unread .notification-content {
  padding-left: 16px;
}

.notification-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}

.notification-icon.email {
  background: #e7f3ff;
  color: #0d6efd;
}

.notification-icon.email_failed {
  background: #fee;
  color: var(--color-danger);
}

.notification-icon.payment {
  background: #d4edda;
  color: #28a745;
}

.notification-icon.status {
  background: #fff3cd;
  color: #ffc107;
}

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

.notification-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
  color: var(--color-gray-800);
}

.notification-message {
  font-size: 13px;
  color: var(--color-gray-500);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.4;
}

.notification-time {
  font-size: 12px;
  color: var(--color-gray-400);
}

.notification-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--color-gray-200);
  text-align: center;
  background: var(--color-gray-50);
}

.notification-footer a {
  color: #0d6efd;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.notification-footer a:hover {
  text-decoration: underline;
}

.empty-notifications {
  text-align: center;
  padding: 40px 20px;
  color: var(--color-gray-500);
}

.empty-notifications i {
  font-size: 48px;
  opacity: 0.3;
  margin-bottom: 12px;
  display: block;
}

.empty-notifications p {
  margin: 0;
  font-size: 14px;
}

/* =================================
   EMAIL/MESSAGE STYLES
   ================================= */

/* Email Delivery Status Indicators */
.message-failed {
  border-left: 3px solid var(--color-danger);
  background-color: #fff5f5;
}

.message-delivered {
  border-left: 3px solid var(--color-success);
}

.message-pending {
  border-left: 3px solid var(--color-warning);
}

.email-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
}

.email-status-badge i {
  font-size: 14px;
}

/* Message Item - Accordion Style */
.message-item {
  background: white;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
  transition: all 0.2s;
  display: block;
  width: 100%;
}

.message-item.message-unread {
  background: #e7f3ff;
  border-left: 4px solid #0d6efd;
}

.message-header {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  align-items: flex-start;
  transition: background 0.2s;
  width: 100%;
  box-sizing: border-box;
}

.message-header:hover {
  background: rgba(0,0,0,0.02);
}

.message-meta {
  flex: 1;
  min-width: 0;
}

.message-from {
  color: var(--color-gray-600);
  font-size: 14px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.message-from.fw-bold {
  font-weight: 700 !important;
  color: var(--color-gray-800);
}

.message-from i {
  font-size: 16px;
}

.message-subject {
  color: var(--color-gray-800);
  font-size: 15px;
  margin-bottom: 6px;
  line-height: 1.4;
}

.message-subject.fw-bold {
  font-weight: 600 !important;
}

.message-time-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.message-toggle-icon {
  margin-left: auto;
  color: var(--color-gray-500);
  font-size: 18px;
  transition: transform 0.2s;
}

.message-toggle-icon.rotated {
  transform: rotate(180deg);
}

.message-body {
  display: block;
  width: 100%;
  padding: 16px;
  border-top: 1px solid var(--color-gray-200);
  animation: slideDown 0.2s ease-out;
  box-sizing: border-box;
}

.message-content {
  display: block;
  width: 100%;
  background: var(--color-gray-50);
  padding: 16px;
  border-radius: 6px;
  color: var(--color-gray-600);
  line-height: 1.6;
  font-size: 14px;
  overflow-x: auto;
  box-sizing: border-box;
  word-wrap: break-word;
}

.message-content * {
  max-width: 100%;
}

.message-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 4px 0;
}

.message-content table {
  width: 100% !important;
  max-width: 100% !important;
  display: block !important;
  overflow-x: auto;
  border-collapse: collapse;
}

.message-content td {
  display: block !important;
  width: 100% !important;
}

.message-content p {
  margin: 0.5em 0;
}

.message-content p:first-child {
  margin-top: 0;
}

.message-content p:last-child {
  margin-bottom: 0;
}

.message-content a {
  color: inherit;
  text-decoration: underline;
}

/* Message thread container */
#message-thread {
  padding: 16px;
}

.message-thread {
  max-height: 600px;
  overflow-y: auto;
}

/* =================================
   NOTES STYLES
   ================================= */

.note-item {
  display: flex;
  gap: 15px;
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-md);
  background: #fff;
  transition: all 0.2s ease;
}

.note-item:hover {
  box-shadow: var(--shadow-md);
  border-color: #d1d5db;
}

.note-pinned {
  background: #fffbf0;
  border-color: #fbbf24;
  border-width: 1px;
}

.note-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
  text-transform: uppercase;
}

.note-content-wrapper {
  flex: 1;
  min-width: 0;
}

.note-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  gap: 10px;
}

.note-author {
  font-weight: 500;
  color: #111827;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.note-time {
  font-size: 13px;
  color: #6b7280;
  white-space: nowrap;
  flex-shrink: 0;
}

.note-content {
  color: var(--color-gray-700);
  line-height: 1.5;
  margin-bottom: 12px;
  word-wrap: break-word;
  white-space: pre-wrap;
  font-size: 14px;
}

.note-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.note-actions .btn-sm {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 6px;
  font-weight: 500;
}

.pinned-notes-section {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--color-gray-200);
}

.pinned-notes-section > div:first-child {
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #6b7280;
}

/* Modal styling for notes */
#noteModal .modal-body textarea {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  border-radius: 6px;
  border-color: #d1d5db;
}

#noteModal .modal-body textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Badge styling for notes count */
.nav-link[data-tab="notes"] .badge.bg-success {
  background: #10b981 !important;
  color: white !important;
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 10px;
  font-weight: 600;
  margin-left: 6px;
}

.nav-link:not(.active)[data-tab="notes"] .badge.bg-success {
  opacity: 1 !important;
  background: #10b981 !important;
  color: white !important;
}

/* =================================
   DIARY VIEW STYLES - COMPACT VERSION
   ================================= */

/* Main content padding */
.main-content {
  padding: 1.5rem !important;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.main-content > .container-fluid {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  min-height: 0;
}

/* Diary container - Prevent selection */
.diary-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  min-height: 0;
  height: 100%;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* Compact Diary Header */
.diary-header-compact {
  background: white;
  border-bottom: 2px solid var(--color-gray-300);
  padding: 6px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  height: 42px;
  box-shadow: var(--shadow-sm);
  min-height: 42px;
  max-height: 42px;
}

.diary-header-left,
.diary-header-right {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
  flex-wrap: nowrap;
}

.diary-header-compact .btn {
  padding: 5px 10px;
  font-size: 12px;
  white-space: nowrap;
  border-radius: 6px;
  flex-shrink: 0;
  min-width: auto;
}

.diary-header-compact .form-control {
  padding: 5px 10px;
  font-size: 12px;
  max-width: 140px;
  min-width: 140px;
  width: 140px;
  flex-shrink: 0;
}

/* Grid Wrapper */
.diary-grid-wrapper {
  flex: 1 !important;
  min-height: 0 !important;
  overflow: auto !important;
  position: relative;
  padding: 6px;
  background: #f5f5f5;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* Grid Container */
#diary-grid-container {
  width: 100% !important;
  position: relative;
}

/* Grid - Compact (100px label column) */
.diary-grid {
  display: grid;
  grid-template-columns: 100px repeat(var(--diary-slots, 28), 1fr);
  grid-auto-rows: auto;
  width: 100%;
  gap: 1px;
  background: #e0e0e0;
  font-size: 0.65rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* Header cells */
.diary-header-cell {
  background: var(--color-gray-50);
  font-weight: 600;
  padding: 3px 1px;
  text-align: center;
  border-bottom: 2px solid var(--color-gray-300);
  border-right: 1px solid var(--color-gray-200);
  position: sticky;
  top: 0;
  z-index: var(--z-fixed);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 7px;
  grid-row: 1;
}

.diary-header-cell.table-header {
  text-align: left;
  padding-left: 8px;
  justify-content: flex-start;
  position: sticky;
  left: 0;
  z-index: calc(var(--z-fixed) + 1);
  border-right: 2px solid #d1d5db;
  background: var(--color-gray-50);
  width: 100px;
  font-size: 10px;
}

.diary-header-cell.time-header {
  font-size: 7px;
  color: var(--color-gray-600);
  font-weight: 600;
}

/* Data cells - Compact (35px min height) */
.diary-cell {
  border-right: 1px solid var(--color-gray-200);
  border-bottom: 1px solid #f0f0f0;
  position: relative;
  min-width: 0;
  min-height: 35px;
  background: white;
}

/* Table label column */
.table-label {
  background: white;
  padding: 4px 6px;
  font-weight: 500;
  font-size: 11px;
  position: sticky;
  left: 0;
  z-index: var(--z-sticky);
  border-right: 2px solid #d1d5db;
  width: 100px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.table-name {
  font-weight: 600;
  font-size: 11px;
  color: #1f2937;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
  flex: 1;
  min-width: 0;
}

.table-capacity {
  font-size: 9px;
  color: #6b7280;
  line-height: 1.2;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Row backgrounds */
.enquiry-row {
  background: #fce4ec !important;
}

.unassigned-row {
  background: #fff9c4 !important;
}

.table-row {
  background: white;
}

/* Drag states */
.table-row.drag-over {
  background: #e3f2fd !important;
}

.enquiry-row.drag-over {
  background: #f8bbd0 !important;
}

.unassigned-row.drag-over {
  background: #fff59d !important;
}

/* Cell border markers */
.quarter-hour-marker {
  border-right: 1px solid #f0f0f0;
}

.half-hour-marker {
  border-right: 1px solid #e0e0e0;
}

.hour-marker {
  border-right: 2px solid #d1d5db;
}

/* Reservation blocks - Compact (33px height) */
.reservation-block {
  position: absolute;
  left: 3px;
  height: 33px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: white;
  border-radius: 3px;
  padding: 2px 4px;
  font-size: 11px;
  cursor: move;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 2px;
  z-index: var(--z-base);
  transition: transform 0.2s, box-shadow 0.2s;
  white-space: nowrap;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}

.reservation-block.reservation-locked {
  cursor: not-allowed !important;
  opacity: 0.9;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.reservation-block:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0,0,0,0.2);
  z-index: calc(var(--z-base) + 1);
}

.reservation-block.dragging {
  opacity: 0.5;
}

/* Reservation status colors */
.reservation-block.confirmed {
  background: linear-gradient(135deg, #5b6fd8 0%, #6a3d96 100%);
}

.reservation-block.pending {
  background: linear-gradient(135deg, #e67fe8 0%, #e63f5c 100%);
}

.reservation-block.enquiry {
  background: linear-gradient(135deg, #3a98eb 0%, #00d4e8 100%);
}

.reservation-block.seated {
  background: linear-gradient(135deg, #f0c34a 0%, #fc8c5c 100%);
}

.reservation-block.completed {
  background: linear-gradient(135deg, #48a86e 0%, #3d8ba8 100%);
}

/* Reservation content */
.reservation-guests {
  background: rgba(255,255,255,0.3);
  padding: 1px 3px;
  border-radius: 2px;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
  line-height: 1.2;
}

.reservation-name {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 1;
  min-width: 0;
  line-height: 1.2;
}

.reservation-tag {
  padding: 1px 3px;
  border-radius: 2px;
  font-size: 10px;
  font-weight: 600;
  flex-shrink: 0;
  margin-left: 4px;
  line-height: 1.2;
}

/* Now line */
.now-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-danger);
  z-index: var(--z-fixed);
  pointer-events: none;
  box-shadow: 0 0 4px rgba(255, 0, 0, 0.5);
}

/* =================================
   CAPACITY DASHBOARD STYLES
   ================================= */

.capacity-container {
  min-height: 100vh;
  background-color: var(--color-gray-50);
}

/* Stat Icons */
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-icon.primary {
  background-color: rgba(32, 107, 196, 0.1);
  color: #206bc4;
}

.stat-icon.success {
  background-color: rgba(47, 179, 68, 0.1);
  color: #2fb344;
}

.stat-icon.info {
  background-color: rgba(66, 153, 225, 0.1);
  color: #4299e1;
}

.stat-icon.warning {
  background-color: rgba(245, 159, 0, 0.1);
  color: #f59f00;
}

/* Capacity Grid Cards */
.capacity-grid-container {
  width: 100%;
}

#capacity-grid-container .row > .col {
  display: flex;
}

#capacity-grid-container .row > .col > .card {
  width: 100%;
  height: 280px;
  display: flex;
  flex-direction: column;
}

#capacity-grid-container .card-body {
  flex: 1;
  overflow: hidden;
}

/* Utilization Colors */
.bg-success-subtle {
  background-color: rgba(47, 179, 68, 0.1) !important;
}

.bg-info-subtle {
  background-color: rgba(66, 153, 225, 0.1) !important;
}

.bg-warning-subtle {
  background-color: rgba(245, 159, 0, 0.1) !important;
}

.bg-danger-subtle {
  background-color: rgba(214, 57, 57, 0.1) !important;
}

.border-success {
  border-color: #2fb344 !important;
}

.border-info {
  border-color: #4299e1 !important;
}

.border-warning {
  border-color: #f59f00 !important;
}

.border-danger {
  border-color: #d63939 !important;
}

/* Legend Box */
.capacity-legend-box {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  flex-shrink: 0;
}

/* Alert Styles */
.alert {
  border-radius: var(--radius-md);
  border: 1px solid;
}

.alert-danger {
  background-color: rgba(214, 57, 57, 0.1);
  border-color: rgba(214, 57, 57, 0.3);
  color: #d63939;
}

.alert-warning {
  background-color: rgba(245, 159, 0, 0.1);
  border-color: rgba(245, 159, 0, 0.3);
  color: #f59f00;
}

.alert-info {
  background-color: rgba(66, 153, 225, 0.1);
  border-color: rgba(66, 153, 225, 0.3);
  color: #4299e1;
}

.alert-success {
  background-color: rgba(47, 179, 68, 0.1);
  border-color: rgba(47, 179, 68, 0.3);
  color: #2fb344;
}

/* =================================
   UTILITY CLASSES
   ================================= */

.file-item.new {
  animation: slideInUp 0.3s ease;
}

.date-navigation {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.date-input {
  max-width: 150px;
}

.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.border-radius-lg {
  border-radius: var(--radius-lg) !important;
}

.shadow-soft {
  box-shadow: var(--shadow-md) !important;
}

.gradient-primary {
  background: linear-gradient(135deg, var(--color-primary-light) 0%, #7c3aed 100%) !important;
}

.gradient-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
}

/* =================================
   SCROLLBAR STYLING
   ================================= */

.conversation-list::-webkit-scrollbar,
.messages-list::-webkit-scrollbar,
#message-input::-webkit-scrollbar,
.message-thread::-webkit-scrollbar,
.content-list::-webkit-scrollbar,
.device-list::-webkit-scrollbar,
.activity-feed::-webkit-scrollbar,
.notification-list::-webkit-scrollbar {
  width: 6px;
}

.conversation-list::-webkit-scrollbar-track,
.messages-list::-webkit-scrollbar-track,
#message-input::-webkit-scrollbar-track,
.message-thread::-webkit-scrollbar-track,
.content-list::-webkit-scrollbar-track,
.device-list::-webkit-scrollbar-track,
.activity-feed::-webkit-scrollbar-track,
.notification-list::-webkit-scrollbar-track {
  background: transparent;
}

.conversation-list::-webkit-scrollbar-thumb,
.messages-list::-webkit-scrollbar-thumb,
#message-input::-webkit-scrollbar-thumb,
.message-thread::-webkit-scrollbar-thumb,
.content-list::-webkit-scrollbar-thumb,
.device-list::-webkit-scrollbar-thumb,
.activity-feed::-webkit-scrollbar-thumb,
.notification-list::-webkit-scrollbar-thumb {
  background: var(--color-gray-300);
  border-radius: 3px;
}

.conversation-list::-webkit-scrollbar-thumb:hover,
.messages-list::-webkit-scrollbar-thumb:hover,
#message-input::-webkit-scrollbar-thumb:hover,
.message-thread::-webkit-scrollbar-thumb:hover,
.content-list::-webkit-scrollbar-thumb:hover,
.device-list::-webkit-scrollbar-thumb:hover,
.activity-feed::-webkit-scrollbar-thumb:hover,
.notification-list::-webkit-scrollbar-thumb:hover {
  background: var(--color-gray-400);
}

/* =================================
   RESPONSIVE DESIGN
   ================================= */

@media (max-width: 1400px) {
  .reservation-name {
    font-size: 9px;
  }
  .reservation-tag {
    padding: 1px 3px;
    border-radius: 2px;
    font-size: 10px;
    font-weight: 600;
    flex-shrink: 0;
    margin-left: 4px;
    line-height: 1.2;
  }
}

@media (max-width: 1200px) {
  .weekly-schedule-table {
    font-size: 0.875rem;
  }
  
  .time-header, .day-header {
    padding: 8px 4px;
  }
  
  .day-name {
    font-size: 0.75rem;
  }
  
  .day-date {
    font-size: 0.65rem;
  }
  
  .diary-header-compact .btn {
    padding: 5px 10px;
    font-size: 12px;
  }
  
  .table-name {
    font-size: 10px;
  }
  
  .table-capacity {
    font-size: 8px;
  }
  
  .diary-grid {
    grid-template-columns: 85px repeat(var(--diary-slots, 28), 1fr);
  }
  
  .table-label {
    width: 85px;
    font-size: 10px;
    padding: 3px 5px;
    gap: 3px;
  }
  
  .diary-header-cell.table-header {
    width: 85px;
    font-size: 9px;
  }
}

@media (max-width: 992px) {
  .table-name {
    font-size: 9px;
  }
  
  .table-capacity {
    font-size: 7px;
  }
  
  .diary-grid {
    grid-template-columns: 70px repeat(var(--diary-slots, 28), 1fr);
  }
  
  .table-label {
    width: 70px;
    font-size: 9px;
  }
  
  .diary-header-cell.table-header {
    width: 70px;
    font-size: 8px;
  }
}
/* =================================
   MOBILE MENU TOGGLE
   ================================= */

.mobile-menu-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 999;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: white;
  border: 1px solid var(--color-gray-300);
  box-shadow: var(--shadow-lg);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
  background: var(--color-gray-50);
  transform: scale(1.05);
}

.mobile-menu-toggle i {
  font-size: 24px;
  color: var(--color-gray-700);
}

.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  animation: fadeIn 0.3s ease;
}

.mobile-menu-overlay.show {
  display: block;
}
@media (max-width: 992px) {
  /* Mobile Communications Hub */
  body.communications-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
  }
  
  body.communications-fullscreen .sidebar,
  body.communications-fullscreen .navbar,
  body.communications-fullscreen .page-header {
    display: none !important;
  }
  
  body.communications-fullscreen .main-content,
  body.communications-fullscreen #page-content {
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
  }
  
  body.communications-fullscreen .communications-hub {
    height: 100% !important;
    min-height: 100% !important;
    max-height: 100% !important;
    margin: 0 !important;
    width: 100% !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
  }
  
  body.communications-fullscreen .communications-container {
    height: 100% !important;
    width: 100% !important;
    border: none !important;
    border-radius: 0 !important;
    grid-template-columns: 1fr !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
  }
  
  .sidebar-header {
    padding-top: 0.5rem;
    padding-top: max(0.5rem, env(safe-area-inset-top));
  }
  
  .mobile-header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding-top: 8px;
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
  
  .exit-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f0f2f5;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
  }
  
  .exit-button:hover {
    background: #e4e6eb;
  }
  
  .exit-button i {
    font-size: 20px;
    color: var(--color-gray-600);
  }
  
  .mobile-header-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--color-gray-800);
    margin: 0;
    flex: 1;
  }
  
  .communications-container {
    grid-template-columns: 1fr;
    position: relative;
  }
  
  .communications-container.conversation-active .conversations-sidebar {
    display: none;
  }
  
  .communications-container:not(.conversation-active) .messages-panel {
    display: none;
  }
  
  .communications-container.conversation-active .messages-panel {
    display: flex;
  }
  
  .conversation-header .back-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f0f2f5;
    border: none;
    cursor: pointer;
    margin-right: 12px;
    transition: all 0.2s;
  }
  
  .conversation-header .back-button:hover {
    background: #e4e6eb;
  }
  
  .conversation-header .back-button i {
    font-size: 20px;
  }
  
  .message-bubble {
    max-width: 85%;
  }
  
  .messages-list {
    padding: 1rem;
  }
  
  .conversation-header {
    padding: 1rem;
    background: #f0f2f5;
  }
  
  .message-input-container {
    padding: 0.75rem 1rem;
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
    background: #f0f2f5;
  }
  
  .conversation-item {
    padding: 14px 16px;
  }
  
  .conversation-avatar {
    width: 48px;
    height: 48px;
  }
  
  #message-input {
    font-size: 16px;
    border-radius: 20px;
  }
  
  #reply-form .btn {
    width: 40px;
    height: 40px;
  }
  
  .session-expired-modal {
    margin: 1rem;
    padding: 1.5rem;
  }
  
  .sidebar {
    font-size: 0.875rem;
  }
  
  .accordion-content.expanded {
    max-height: 300px;
  }
  
  .device-panel {
    height: 300px;
    margin-bottom: 20px;
  }
  
  .content-panel {
    height: 300px;
    margin-bottom: 20px;
  }
  
  .reservation-header .d-flex {
    flex-direction: column;
    align-items: stretch !important;
    gap: 16px;
  }
  
  .reservation-status {
    justify-content: center;
  }
  
  .tab-content-container .row {
    margin: 0;
  }
  
  .tab-content-container .col-lg-4 {
    padding: 0 12px;
    margin-bottom: 16px;
  }
  
  .nav-pills {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .nav-pills .nav-link {
    font-size: 12px;
    padding: 8px 12px;
    margin: 2px;
  }
  
  .nav-pills .nav-link .badge {
    font-size: 8px;
    padding: 1px 4px;
    margin-left: 4px;
  }
  
  .message-item {
    flex-direction: column;
    gap: 8px;
  }
  
  .message-avatar {
    align-self: flex-start;
  }
  
  .payment-item {
    grid-template-columns: 1fr;
    gap: 8px;
    text-align: left;
  }
  
  .payment-header {
    display: none;
  }
  
  .table-responsive {
    border-radius: var(--radius-md);
  }
  
  .stats-card .card-body {
    padding: 16px;
  }
  
  .note-item {
    padding: 12px;
  }
  
  .note-avatar {
    width: 36px;
    height: 36px;
    font-size: 12px;
  }
  
  .note-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  
  .note-actions {
    justify-content: flex-start;
  }
  
  .note-actions .btn-sm {
    font-size: 11px;
    padding: 3px 8px;
  }
  
  .tables-grid {
    grid-template-columns: 1fr;
  }
  
  .unassigned-devices {
    grid-template-columns: 1fr;
  }
  
  .assigned-device {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .device-actions {
    align-self: stretch;
    justify-content: flex-end;
  }
  
  .zone-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .zone-stats {
    align-self: stretch;
    justify-content: space-between;
  }
  
  .group-stats {
    flex-direction: column;
    gap: 16px;
  }
  
  .stat-item {
    justify-content: center;
  }
  
  .group-header {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
  
  .group-master {
    text-align: center;
  }
  
  .group-actions {
    justify-content: center;
  }
  
  .playlist-actions {
    justify-content: center;
  }
  
  .btn-action {
    flex: 1;
    justify-content: center;
    min-width: 0;
  }
  
  .preview-container {
    flex-direction: column;
    gap: 1rem;
  }
  
  .preview-info {
    max-width: 100%;
  }
  
  .stat-circle {
    padding: 10px;
  }
  
  .stat-number {
    font-size: 1.25rem;
  }
  
  .stat-label {
    font-size: 0.7rem;
  }
  
  .activity-message {
    font-size: 0.8rem;
  }
  
  .activity-time {
    font-size: 0.7rem;
  }
  
  .device-overview .col-4 {
    padding: 0 0.25rem;
  }
  
  .network-status {
    padding: 8px;
  }
  
  .weekly-schedule-table {
    grid-template-columns: 60px repeat(7, 1fr);
  }
  
  .time-header {
    font-size: 0.75rem;
    padding: 8px 2px;
  }
  
  .day-header {
    padding: 8px 2px;
  }
  
  .day-name {
    font-size: 0.65rem;
    margin-bottom: 2px;
  }
  
  .day-date {
    font-size: 0.6rem;
  }
  
  .time-label {
    font-size: 0.65rem;
    padding: 4px 2px;
  }
  
  .day-cell {
    min-height: 40px;
  }
  
  .empty-time-slot {
    min-height: 40px;
  }
  
  .schedule-block {
    padding: 4px;
  }
  
  .schedule-playlist {
    font-size: 0.65rem;
  }
  
  .schedule-time {
    font-size: 0.6rem;
  }
  
  .rule-card {
    padding: 16px;
  }
  
  .rule-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .rule-actions {
    justify-content: flex-start;
  }
  
  .capacity-container .row.row-cols-7 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
  }
  
  .h2 {
    font-size: 1.5rem !important;
  }
  
  /* Full height layout mobile adjustments */
  sidebar {
    position: fixed;
    right: -100%;  /* ← Changed from left to right */
    left: auto;
    transition: right 0.3s ease;  /* ← Changed from left to right */
    z-index: 1000;
    width: 80%;
    max-width: 300px;
  }
  
  sidebar.show {
    right: 0;  /* ← Changed from left to right */
    box-shadow: var(--shadow-xl);
  }
  
  .main-content {
    width: 100%;
  }
  
  .notification-dropdown {
    left: 50%;
    transform: translateX(-50%);
    bottom: 60px;
    width: 90%;
    max-width: 360px;
  }
    .sidebar {
    position: fixed;
    right: -100%;  /* ← Changed to right */
    left: auto;     /* ← Added this */
    transition: right 0.3s ease;  /* ← Changed to right */
    z-index: 1000;
    width: 80%;
    max-width: 300px;
  }
  
  .sidebar.show {
    right: 0;  /* ← Changed to right */
    left: auto;  /* ← Added this */
    box-shadow: var(--shadow-xl);
  }

.main-content {
  width: 100%;
  padding-top: 70px; /* Space for menu button */
}

.mobile-menu-toggle {
  display: flex;
}



}

@media (max-width: 576px) {
  .page-header .d-flex {
    flex-direction: column;
    align-items: stretch !important;
    gap: 12px;
  }
  
  .page-header .d-flex.gap-2 {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .reservation-details-section .card-body {
    padding: 16px;
  }
  
  .form-control, .form-select {
    font-size: 16px;
  }
  
  .device-overview .row {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .device-overview .col-4 {
    padding: 0;
  }
  
  .activity-feed {
    max-height: 300px;
  }
  
  .weekly-schedule-table {
    grid-template-columns: 50px repeat(7, 1fr);
  }
  
  .day-header {
    padding: 6px 1px;
  }
  
  .day-name {
    font-size: 0.6rem;
  }
  
  .day-date {
    display: none;
  }
  
  .advanced-rules-container,
  .preview-container {
    padding: 16px;
  }
}

@media (min-width: 769px) {
  .mobile-header-controls {
    display: none;
  }
}

/* =================================
   FOCUS STATES & ACCESSIBILITY
   ================================= */

.schedule-block:focus,
.empty-time-slot:focus,
.rule-card:focus,
.btn:focus,
.form-control:focus,
.form-select:focus,
.nav-link:focus {
  outline: 2px solid #0d6efd;
  outline-offset: 2px;
}

/* =================================
   PRINT STYLES
   ================================= */

@media print {
  .btn-list,
  .rule-actions,
  .week-navigation,
  .page-header .d-flex > div:last-child,
  .nav-pills,
  .btn {
    display: none !important;
  }
  
  .weekly-schedule-table {
    break-inside: avoid;
  }
  
  .schedule-block {
    box-shadow: none !important;
  }
  
  .card {
    box-shadow: none !important;
    border: 1px solid var(--color-gray-200) !important;
  }
  
  .tab-pane {
    display: block !important;
    page-break-inside: avoid;
  }
}

/* =================================
   DARK MODE SUPPORT
   ================================= */

@media (prefers-color-scheme: dark) {
  .network-status {
    background: #2d2d2d;
    border-color: #404040;
    color: var(--color-gray-200);
  }
  
  .device-overview {
    background: #2d2d2d;
    border-color: #404040;
  }
  
  .activity-item {
    border-color: #404040;
  }
  
  .device-group-item {
    border-color: #404040;
  }
  
  .device-group-item .progress {
    background-color: #404040;
  }
}

/* =================================
   DIARY LANDSCAPE MODE - FULL SCREEN
   ================================= */

@media (max-width: 992px) and (orientation: landscape) {
  /* Hide everything except diary when in landscape */
  body.page-reservations-diary .sidebar,
  body.page-reservations-diary .mobile-menu-toggle {
    display: none !important;
  }
  
  body.page-reservations-diary .main-content {
    width: 100% !important;
    padding: 0 !important;
    height: 100vh !important;
  }
  
  body.page-reservations-diary #page-content {
    padding: 0 !important;
    height: 100vh !important;
  }
  
  body.page-reservations-diary .diary-container {
    height: 100vh !important;
  }
  
  /* Make header even more compact in landscape */
  body.page-reservations-diary .diary-header-compact {
    padding: 4px 8px;
    height: 36px;
    min-height: 36px;
    max-height: 36px;
  }
  
  body.page-reservations-diary .diary-header-compact .btn {
    padding: 4px 8px;
    font-size: 11px;
  }
  
  body.page-reservations-diary .diary-header-compact .form-control {
    padding: 4px 8px;
    font-size: 11px;
    max-width: 120px;
  }
  
  /* Even more compact grid */
  body.page-reservations-diary .diary-grid {
    font-size: 0.6rem;
  }
  
  body.page-reservations-diary .diary-header-cell {
    font-size: 6px;
    padding: 2px 1px;
  }
  
  body.page-reservations-diary .table-name {
    font-size: 9px;
  }
  
  body.page-reservations-diary .table-capacity {
    font-size: 7px;
  }
  
  body.page-reservations-diary .reservation-block {
    height: 30px;
    font-size: 10px;
  }
  
  body.page-reservations-diary .reservation-name {
    font-size: 10px;
  }
}

/* =================================
   DIARY LANDSCAPE MODE - ANDROID/SAMSUNG FIX
   ================================= */

@media (max-width: 992px) and (orientation: landscape) {
  /* CRITICAL: Prevent Android address bar interference */
  body.page-reservations-diary {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100dvh !important; /* dvh for Android dynamic viewport */
    overflow: hidden !important;
    -webkit-overflow-scrolling: touch;
  }
  
  body.page-reservations-diary html {
    overflow: hidden !important;
    height: 100dvh !important;
  }
  
  /* Hide sidebar and menu */
  body.page-reservations-diary .sidebar,
  body.page-reservations-diary .mobile-menu-toggle {
    display: none !important;
  }
  
  body.page-reservations-diary .page-wrapper {
    height: 100dvh !important;
    overflow: hidden !important;
  }
  
  body.page-reservations-diary .main-content {
    width: 100vw !important;
    padding: 0 !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    max-height: 100dvh !important;
  }
  
  body.page-reservations-diary #page-content {
    padding: 0 !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    max-height: 100dvh !important;
  }
  
  body.page-reservations-diary .diary-container {
    height: 100dvh !important;
    min-height: 100dvh !important;
    max-height: 100dvh !important;
  }
  
  /* Compact header for landscape */
  body.page-reservations-diary .diary-header-compact {
    padding: 4px 8px;
    padding-left: max(8px, env(safe-area-inset-left));
    padding-right: max(8px, env(safe-area-inset-right));
    height: 36px;
    min-height: 36px;
    max-height: 36px;
  }
  
  body.page-reservations-diary .diary-header-compact .btn {
    padding: 4px 8px;
    font-size: 11px;
  }
  
  body.page-reservations-diary .diary-header-compact .form-control {
    padding: 4px 8px;
    font-size: 11px;
    max-width: 120px;
  }
  
  /* Grid wrapper fills remaining space */
  body.page-reservations-diary .diary-grid-wrapper {
    height: calc(100dvh - 36px) !important;
    max-height: calc(100dvh - 36px) !important;
    padding-left: max(6px, env(safe-area-inset-left));
    padding-right: max(6px, env(safe-area-inset-right));
  }
  
  /* Compact grid elements */
  body.page-reservations-diary .diary-grid {
    font-size: 0.6rem;
  }
  
  body.page-reservations-diary .diary-header-cell {
    font-size: 6px;
    padding: 2px 1px;
  }
  
  body.page-reservations-diary .table-name {
    font-size: 9px;
  }
  
  body.page-reservations-diary .table-capacity {
    font-size: 7px;
  }
  
  body.page-reservations-diary .reservation-block {
    height: 30px;
    font-size: 10px;
  }
  
  body.page-reservations-diary .reservation-name {
    font-size: 10px;
  }
}

#page-content .container-fluid {
  flex: none;
}
/* =================================
   SMOOTH TRANSITIONS
   ================================= */

.signage-dashboard *,
.card {
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}