/* ==========================================================================
   DESIGN SYSTEM & VARIABLES (WARM LUXURY & GLASSMORPHISM)
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-app: #fcfcf9;
  --bg-sidebar: #1a1614; /* Warm charcoal dark chocolate */
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  
  --color-primary: #d97706; /* Bronze Amber Gold */
  --color-primary-rgb: 217, 119, 6;
  --color-primary-dark: #b45309;
  --color-primary-light: #fef3c7;
  
  --color-text-main: #2b2520;
  --color-text-muted: #7c7267;
  --color-text-light: #ffffff;
  
  --color-border: rgba(231, 229, 228, 0.7);
  --color-border-glow: rgba(217, 119, 6, 0.25);
  
  /* Status Colors */
  --color-success: #10b981;
  --color-success-light: #d1fae5;
  --color-warning: #f59e0b;
  --color-warning-light: #fef3c7;
  --color-danger: #ef4444;
  --color-danger-light: #fee2e2;
  
  /* System Tokens */
  --font-main: 'Inter', sans-serif;
  --font-display: 'Outfit', sans-serif;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 2px 8px rgba(26, 22, 20, 0.03);
  --shadow-md: 0 8px 30px rgba(26, 22, 20, 0.06);
  --shadow-lg: 0 16px 40px rgba(26, 22, 20, 0.12);
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   BASE & RESET
   ========================================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-app);
  color: var(--color-text-main);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* Scrollbar Style */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-app);
}
::-webkit-scrollbar-thumb {
  background: #e4e2dd;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary-muted);
}

/* ==========================================================================
   LAYOUT STRUCTURE
   ========================================================================== */

.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* ==========================================================================
   SIDEBAR COMPONENT
   ========================================================================== */

.sidebar {
  width: 280px;
  background-color: var(--bg-sidebar);
  color: var(--color-text-light);
  display: flex;
  flex-direction: column;
  padding: 32px 24px;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 48px;
}

.brand-icon {
  font-size: 28px;
  color: var(--color-primary);
  background: rgba(255, 255, 255, 0.05);
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-text h1 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.brand-text span {
  font-size: 11px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block;
  margin-top: 2px;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.menu-btn {
  background: none;
  border: none;
  color: #a8a29e;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-main);
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  transition: var(--transition-smooth);
}

.menu-btn i {
  font-size: 18px;
  width: 20px;
  transition: var(--transition-smooth);
}

.menu-btn:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--color-text-light);
}

.menu-btn.active {
  background-color: var(--color-primary);
  color: var(--color-text-light);
  box-shadow: 0 4px 20px rgba(217, 119, 6, 0.35);
}

.menu-btn.active i {
  transform: scale(1.1);
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 24px;
}

.whatsapp-status {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

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

.status-indicator.online {
  background-color: var(--color-success);
  box-shadow: 0 0 12px var(--color-success);
}

.status-details p {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-light);
}

.status-details span {
  font-size: 10px;
  color: #a8a29e;
  display: block;
}

/* ==========================================================================
   MAIN MAIN MAIN CONTENT AREA
   ========================================================================== */

.main-content {
  flex-grow: 1;
  margin-left: 280px;
  padding: 40px;
  max-width: calc(100% - 280px);
}

/* Top Header */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 36px;
}

.header-title h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--color-text-main);
}

.header-title p {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.header-profile {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  padding: 8px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

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

.profile-name {
  font-size: 14px;
  font-weight: 600;
  display: block;
}

.profile-role {
  font-size: 11px;
  color: var(--color-text-muted);
  display: block;
}

.profile-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background-color: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-family: var(--font-display);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border: 1px solid rgba(217, 119, 6, 0.15);
}

/* ==========================================================================
   SPA VIEWS TRANSITION
   ========================================================================== */

.tab-content {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

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

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

/* ==========================================================================
   TAB: DASHBOARD VIEW
   ========================================================================== */

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 36px;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-border-glow);
}

.stat-icon-wrapper {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.stat-icon-wrapper.gold {
  background-color: #fef3c7;
  color: #d97706;
}

.stat-icon-wrapper.amber {
  background-color: #ffe4e6;
  color: #e11d48;
}

.stat-icon-wrapper.teal {
  background-color: #ccfbf1;
  color: #0d9488;
}

.stat-icon-wrapper.bronze {
  background-color: #e0f2fe;
  color: #0284c7;
}

.stat-info h3 {
  font-size: 13px;
  color: var(--color-text-muted);
  font-weight: 500;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  margin-top: 4px;
  letter-spacing: -0.5px;
}

.stat-subtext {
  font-size: 11px;
  color: var(--color-text-muted);
  display: block;
  margin-top: 6px;
}

/* Progress bar inside stats */
.progress-bar-container {
  width: 120px;
  height: 6px;
  background-color: #f3f4f6;
  border-radius: 3px;
  margin-top: 8px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background-color: #e11d48;
  border-radius: 3px;
  transition: width 1s ease-out;
}

/* Dashboard Details Section */
.dashboard-details {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.details-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

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

.card-header h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

/* Room Types Summary List */
.room-types-summary {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background-color: rgba(26, 22, 20, 0.02);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.summary-item .label {
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
}

.summary-item .label i {
  color: var(--color-primary);
}

.summary-item .val {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-muted);
}

/* ==========================================================================
   TAB: ACTIONS / CONTROLS
   ========================================================================== */

.section-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 16px;
}

.section-actions-complex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 20px;
}

.filter-group {
  display: flex;
  gap: 12px;
  flex-grow: 1;
}

/* Search Box Component */
.search-box {
  position: relative;
  max-width: 320px;
  width: 100%;
}

.search-box i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  font-size: 14px;
}

.search-box input {
  width: 100%;
  padding: 10px 16px 10px 42px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background-color: var(--bg-card);
  font-family: var(--font-main);
  font-size: 14px;
  transition: var(--transition-smooth);
  color: var(--color-text-main);
}

.search-box input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.1);
}

/* Select Box */
.select-box select {
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background-color: var(--bg-card);
  font-family: var(--font-main);
  font-size: 14px;
  outline: none;
  transition: var(--transition-smooth);
  color: var(--color-text-main);
}

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

/* Button Components */
.btn {
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-text-light);
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.2);
}

.btn-primary:hover {
  background-color: var(--color-primary-dark);
  box-shadow: 0 6px 16px rgba(217, 119, 6, 0.3);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: #e7e5e4;
  color: #44403c;
}

.btn-secondary:hover {
  background-color: #d6d3d1;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  background: white;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: var(--transition-smooth);
  font-size: 12px;
}

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

.btn-icon.delete:hover {
  background-color: var(--color-danger-light);
  color: var(--color-danger);
  border-color: rgba(239, 68, 68, 0.2);
}

/* ==========================================================================
   TAB: ROOMS GRID
   ========================================================================== */

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

.room-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.room-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-border-glow);
}

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

.room-card-header .number {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
}

.room-type-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 30px;
  background-color: var(--color-primary-light);
  color: var(--color-primary-dark);
}

.room-details {
  margin-bottom: 20px;
}

.room-detail-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.room-detail-row strong {
  color: var(--color-text-main);
}

.room-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--color-border);
  padding-top: 16px;
}

.room-price-meta {
  display: flex;
  flex-direction: column;
}

.room-price-meta span {
  font-size: 10px;
  color: var(--color-text-muted);
  text-transform: uppercase;
}

.room-price-meta strong {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-primary-dark);
}

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

/* ==========================================================================
   TAB: TABLE / LISTS (CUSTOMERS & RESERVATIONS)
   ========================================================================== */

.table-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  padding: 16px 24px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
  background-color: rgba(26, 22, 20, 0.01);
}

.data-table td {
  padding: 16px 24px;
  font-size: 14px;
  color: var(--color-text-main);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.data-table tbody tr {
  transition: var(--transition-smooth);
}

.data-table tbody tr:hover {
  background-color: rgba(26, 22, 20, 0.015);
}

.actions-col {
  text-align: right;
  width: 100px;
}

/* Badges styling */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 30px;
  font-size: 11px;
  font-weight: 600;
}

.badge-primary {
  background-color: var(--color-primary-light);
  color: var(--color-primary-dark);
}

.badge-success {
  background-color: var(--color-success-light);
  color: var(--color-success);
}

.badge-warning {
  background-color: var(--color-warning-light);
  color: var(--color-warning);
}

.badge-danger {
  background-color: var(--color-danger-light);
  color: var(--color-danger);
}

/* ==========================================================================
   MODAL COMPONENT (GLASSMORPHISM CARD)
   ========================================================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(26, 22, 20, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-smooth);
}

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

.modal-card {
  width: 500px;
  max-width: 90%;
  background: white;
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
  transform: translateY(24px);
  transition: var(--transition-smooth);
  overflow-y: auto;
  max-height: 90vh;
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

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

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text-main);
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--color-text-muted);
  cursor: pointer;
  line-height: 1;
}

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

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

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

.form-group input,
.form-group select {
  width: 100%;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  font-family: var(--font-main);
  font-size: 14px;
  outline: none;
  transition: var(--transition-smooth);
  color: var(--color-text-main);
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.1);
}

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

.form-row .col {
  flex: 1;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 28px;
}

/* Price Preview Box inside Reservation Modal */
.price-preview-box {
  background: #fbfbfa;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 20px;
}

.preview-item {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.preview-item strong {
  color: var(--color-text-main);
}

.price-preview-box hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 10px 0;
}

.preview-item.total {
  font-size: 14px;
  color: var(--color-text-main);
  font-weight: 600;
}

.preview-item.total strong {
  color: var(--color-primary-dark);
  font-size: 16px;
}

/* ==========================================================================
   TOAST NOTIFICATION SYSTEM
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 2000;
}

.toast {
  background: white;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--color-primary);
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  font-weight: 500;
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 280px;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast.success {
  border-left-color: var(--color-success);
}

.toast.success i {
  color: var(--color-success);
}

.toast.error {
  border-left-color: var(--color-danger);
}

.toast.error i {
  color: var(--color-danger);
}

/* ==========================================================================
   RESPONSIVE DESIGN (MOBILE ADAPTATION)
   ========================================================================== */

@media (max-width: 1024px) {
  .dashboard-details {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 72px;
    padding: 24px 12px;
  }
  .brand-text,
  .status-details,
  .menu-btn {
    font-size: 0;
    padding: 12px;
    justify-content: center;
  }
  .menu-btn i {
    font-size: 20px;
    margin: 0;
  }
  .main-content {
    margin-left: 72px;
    max-width: calc(100% - 72px);
    padding: 24px;
  }
  .section-actions-complex {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-group {
    flex-direction: column;
  }
  .search-box {
    max-width: 100%;
  }
}

/* ==========================================================================
   WHATSAPP CONNECTION STYLES
   ========================================================================== */
.status-indicator.offline {
  background-color: var(--color-danger);
  box-shadow: 0 0 12px var(--color-danger);
}

.status-indicator.warning {
  background-color: var(--color-warning);
  box-shadow: 0 0 12px var(--color-warning);
}

/* ==========================================================================
   CHAT CRM STYLES
   ========================================================================== */
.chat-crm-container {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: calc(100vh - 180px);
  min-height: 500px;
  background-color: var(--bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-top: 1rem;
}

.chat-sidebar {
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  background-color: var(--bg-app);
}

.chat-search {
  padding: 16px;
  border-bottom: 1px solid var(--color-border);
  position: relative;
}

.chat-search i {
  position: absolute;
  left: 28px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
}

.chat-search input {
  width: 100%;
  padding: 10px 12px 10px 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background-color: var(--bg-card);
  color: var(--color-text-main);
  font-size: 14px;
  outline: none;
  transition: var(--transition-smooth);
}

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

.chat-list {
  flex-grow: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.chat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: var(--transition-smooth);
  border-bottom: 1px solid rgba(0, 0, 0, 0.02);
}

.chat-item:hover {
  background-color: rgba(217, 119, 6, 0.04);
}

.chat-item.active {
  background-color: rgba(217, 119, 6, 0.08);
  border-left: 4px solid var(--color-primary);
}

.chat-item-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background-color: var(--color-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}

.chat-item-details {
  flex-grow: 1;
  min-width: 0;
}

.chat-item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}

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

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

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

.chat-item-badges {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.chat-item-badge-human {
  font-size: 10px;
  background-color: #fef3c7;
  color: #d97706;
  border: 1px solid #fde68a;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 600;
}

.chat-item-badge-agent {
  font-size: 10px;
  background-color: #e0f2fe;
  color: #0284c7;
  border: 1px solid #bae6fd;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 600;
}

.chat-main {
  display: flex;
  flex-direction: column;
  background-color: var(--bg-card);
  height: 100%;
  position: relative;
}

.empty-chat-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
  padding: 40px;
  text-align: center;
  color: var(--color-text-muted);
}

.empty-chat-state i {
  font-size: 4rem;
  color: var(--color-primary);
  opacity: 0.3;
  margin-bottom: 16px;
}

.empty-chat-state h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text-main);
  margin-bottom: 8px;
}

.chat-main-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-card);
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

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

.chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--color-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.chat-messages-area {
  flex-grow: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background-color: #fafaf9;
}

.chat-bubble {
  max-width: 65%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.5;
  position: relative;
  box-shadow: var(--shadow-sm);
  word-break: break-word;
}

.chat-bubble.in {
  background-color: white;
  color: var(--color-text-main);
  align-self: flex-start;
  border-bottom-left-radius: 0;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.chat-bubble.out {
  background-color: #fef3c7;
  color: #78350f;
  align-self: flex-end;
  border-bottom-right-radius: 0;
  border: 1px solid rgba(217, 119, 6, 0.1);
}

.chat-bubble-time {
  display: block;
  font-size: 10px;
  color: var(--color-text-muted);
  text-align: right;
  margin-top: 6px;
}

.chat-input-bar {
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
  display: flex;
  gap: 12px;
  background-color: var(--bg-card);
}

.chat-input-bar input {
  flex-grow: 1;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background-color: var(--bg-app);
  color: var(--color-text-main);
  outline: none;
  font-family: var(--font-main);
  font-size: 14px;
  transition: var(--transition-smooth);
}

.chat-input-bar input:focus {
  border-color: var(--color-primary);
  background-color: var(--bg-card);
}

