/* ===== CSS VARIABLES - DESIGN SYSTEM ===== */
:root {
  /* === FONT FAMILIES === */
  /* Font chính được sử dụng cho toàn bộ website */
  --font-primary: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  
  /* === COLOR PALETTE === */
  /* Màu chính của hệ thống - dùng cho header, text chính */
  --color-primary: #102E9E;
  /* Màu phụ - dùng cho tiêu đề, links, buttons */
  --color-secondary: #1976D2;
  /* Màu nhấn - dùng cho focus states, highlights */
  --color-accent: #2196F3;
  /* Màu trắng cơ bản */
  --color-white: #ffffff;
  
  /* === GRADIENT COLORS === */
  /* Gradient cho phần header/banner */
  --color-header-gradient: linear-gradient(340deg, #ffffff 30%, #CCE5FF 80%);
  /* Gradient cho header của bảng danh sách bệnh nhân */
  --color-table-header-gradient: linear-gradient(135deg, #1976D2, #2196F3);
  /* Gradient cho dòng bệnh nhân đang khám - màu đỏ nổi bật */
  --color-current-patient-gradient: linear-gradient(135deg, #ff6b6b, #ee5a24);
  /* Gradient hiệu ứng glow cho bệnh nhân đang khám */
  --color-current-patient-glow: linear-gradient(135deg, #ff8a80, #ff7043);
  /* Gradient cho dropdown khi được chọn */
  --color-dropdown-selected: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  
  /* === TEXT COLORS === */
  /* Màu chữ chính - dùng cho tiêu đề, labels */
  --text-primary: #102E9E;
  /* Màu chữ phụ - dùng cho sub-headings */
  --text-secondary: #1976D2;
  /* Màu chữ trắng - dùng trên nền tối */
  --text-white: #ffffff;
  /* Màu chữ xám - dùng cho placeholder, disabled text */
  --text-gray: #666;
  /* Màu nền xám nhạt - dùng cho background các section */
  --text-light-gray: #f8f9fa;
  
  /* === STATUS COLORS === */
  /* Màu đỏ cho trạng thái "Đang Khám" */
  --color-status-examining: #f44336;
  /* Màu xanh cho trạng thái "Chờ Khám" */
  --color-status-waiting: #2196F3;
  
  /* === PRIORITY COLORS === */
  /* Màu cho bệnh nhân không có ưu tiên */
  --color-priority-normal: #666;
  /* Màu xanh cho "Có Đặt Lịch" */
  --color-priority-appointment: #2196F3;
  /* Màu đỏ cho "Cấp Cứu" */
  --color-priority-emergency: #f44336;
  /* Màu cam cho "Trẻ Em Dưới 6 Tuổi" */
  --color-priority-child: #ff9800;
  /* Màu tím cho "Người Khuyết Tật" */
  --color-priority-disabled: #9c27b0;
  /* Màu nâu cho "Người Lớn Tuổi" */
  --color-priority-elderly: #795548;
  /* Màu hồng cho "Phụ Nữ Có Thai" */
  --color-priority-pregnant: #e91e63;
  
  /* === SUCCESS COLORS === */
  /* Màu xanh lá cho trạng thái thành công */
  --color-success: #4caf50;
  /* Màu nền xanh lá nhạt cho trạng thái thành công */
  --color-success-background: rgba(76, 175, 80, 0.1);
  
  /* === FONT SIZES === */
  /* Cỡ chữ cực nhỏ - dùng cho sub-labels, footnotes */
  --font-size-xs: clamp(0.75rem, 1.5vw, 1rem);
  /* Cỡ chữ nhỏ - dùng cho filter labels, small buttons */
  --font-size-sm: clamp(0.85rem, 1.8vw, 1.15rem);
  /* Cỡ chữ cơ bản - dùng cho text thông thường */
  --font-size-base: clamp(0.95rem, 2.2vw, 1.3rem);
  /* Cỡ chữ trung bình - dùng cho department selector, doctor info */
  --font-size-md: clamp(1.1rem, 2.6vw, 1.5rem);
  /* Cỡ chữ lớn - dùng cho label cells, real-time clock */
  --font-size-lg: clamp(1.25rem, 3vw, 1.7rem);
  /* Cỡ chữ rất lớn - dùng cho table content, doctor info */
  --font-size-xl: clamp(1.4rem, 3.4vw, 1.9rem);
  /* Cỡ chữ siêu lớn - dùng cho table headers, branch title */
  --font-size-2xl: clamp(1.6rem, 3.8vw, 2.2rem);
  /* Cỡ chữ khổng lồ - dùng cho page title chính */
  --font-size-3xl: clamp(1.8rem, 4.2vw, 2.6rem);
  
  /* === FONT WEIGHTS === */
  /* Font weight bình thường - dùng cho text thông thường */
  --font-weight-normal: 400;
  /* Font weight trung bình - dùng cho labels, sub-headings */
  --font-weight-medium: 500;
  /* Font weight đậm vừa - dùng cho priority text */
  --font-weight-semibold: 600;
  /* Font weight đậm - dùng cho headings, important text */
  --font-weight-bold: 700;
  
  /* === SPACING === */
  /* Khoảng cách cực nhỏ - dùng cho gaps nhỏ */
  --spacing-xs: 3px;
  /* Khoảng cách nhỏ - dùng cho margin tops nhỏ */
  --spacing-sm: 5px;
  /* Khoảng cách cơ bản - dùng cho padding, margin thông thường */
  --spacing-base: 10px;
  /* Khoảng cách trung bình - dùng cho section padding */
  --spacing-md: 15px;
  /* Khoảng cách lớn - dùng cho no-data padding */
  --spacing-lg: 20px;
  /* Khoảng cách rất lớn - dùng cho major separations */
  --spacing-xl: 30px;
  /* Khoảng cách khổng lồ - dùng cho page title margin */
  --spacing-2xl: 40px;
  
  /* === BORDER RADIUS === */
  /* Bo góc nhỏ - dùng cho input fields, clock */
  --border-radius-sm: 4px;
  /* Bo góc cơ bản - dùng cho table container, no-data boxes */
  --border-radius-base: 6px;
  /* Bo góc trung bình - dùng cho dropdowns, doctor info */
  --border-radius-md: 8px;
  /* Bo góc lớn - dùng cho main sections, patient list */
  --border-radius-lg: 10px;
  /* Bo góc rất lớn - dùng cho container chính */
  --border-radius-xl: 15px;
  
  /* === SHADOWS === */
  /* Đổ bóng nhỏ - dùng cho clock, subtle elements */
  --shadow-sm: 0 2px 8px rgba(16, 46, 158, 0.3);
  /* Đổ bóng trung bình - dùng cho hover effects */
  --shadow-md: 0 4px 12px rgba(33, 150, 243, 0.2);
  /* Đổ bóng lớn - dùng cho container chính */
  --shadow-lg: 0 15px 30px rgba(0,0,0,0.1);
  /* Đổ bóng dropdown - dùng cho dropdown menus */
  --shadow-dropdown: 0 4px 12px rgba(0,0,0,0.15);
  /* Đổ bóng bảng - dùng cho patient list section */
  --shadow-table: 0 2px 10px rgba(0,0,0,0.08);
  
  /* === TRANSITIONS === */
  /* Chuyển động nhanh - dùng cho dropdown animations */
  --transition-fast: all 0.2s ease;
  /* Chuyển động cơ bản - dùng cho hover effects, general transitions */
  --transition-base: all 0.3s ease;
  
  /* === Z-INDEX === */
  /* Layer cho dropdown menus - phải nằm trên các elements khác */
  --z-index-dropdown: 1000;
  /* Layer cho sticky headers - phải nằm trên table content */
  --z-index-sticky: 10;
}

/* ===== GLOBAL STYLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-primary);
  background: #ffffff;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

.container {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  margin: 0;
  background: #ffffff;
  border-radius: var(--border-radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ===== HEADER STYLES ===== */
.header {
  background: var(--color-header-gradient);
  color: var(--text-primary);
  padding: 1vh 2vw;
  flex-shrink: 0;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 2vw;
  width: 100%;
  margin: 0 auto;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 2vw;
  flex-grow: 1;
}

.logo {
  height: clamp(40px, 8vh, 80px);
  width: auto;
  flex-shrink: 0;
  max-width: 15vw;
  transition: all 0.3s ease;
}

/* Logo size consistent for all pages */

.header-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-grow: 1;
}

.hospital-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin: 0;
  line-height: 1.1;
}

/* Hospital title consistent for all pages */

/* ===== BRANCH SELECTOR STYLES ===== */
.branch-selector-title {
  position: relative;
}

.branch-display-title {
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  margin: 0;
  line-height: 1.1;
  user-select: none;
  transition: var(--transition-base);
}

/* Branch title consistent for all pages */

.branch-display-title:hover {
  color: var(--text-secondary);
}

.branch-dropdown-title {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-white);
  border: 1px solid #ddd;
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-dropdown);
  z-index: var(--z-index-dropdown);
  margin-top: var(--spacing-sm);
  max-height: 200px;
  overflow-y: auto;
  font-size: var(--font-size-base);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: var(--transition-fast);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border: none;
  outline: none;
  min-width: 300px;
  padding: 0;
}

.branch-dropdown-title.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  display: block;
  -webkit-appearance: menulist;
  -moz-appearance: menulist;
  appearance: menulist;
}

.branch-dropdown-title option {
  padding: 12px 18px;
  color: var(--color-secondary);
  font-size: 1.1em;
  font-weight: var(--font-weight-medium);
  background: var(--color-white);
}

.branch-dropdown-title option:hover {
  background: var(--color-dropdown-selected) !important;
  color: var(--text-white) !important;
}

.branch-dropdown-title option:checked {
  background: var(--color-dropdown-selected) !important;
  color: var(--text-white) !important;
}

.branch-dropdown-title option:selected {
  background: var(--color-dropdown-selected) !important;
  color: var(--text-white) !important;
}

.branch-dropdown-title option:focus {
  background: var(--color-dropdown-selected) !important;
  color: var(--text-white) !important;
}

.address, .phone {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
  margin: 0;
  line-height: 1.2;
}

/* ===== SMALL FILTERS AND CONTROLS ===== */
.small-filters {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  z-index: 10;
}

.small-filter-item {
  display: flex;
  align-items: center;
  justify-content: center;
}

.small-filter-label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-secondary);
  margin-right: var(--spacing-sm);
}

.small-filter-input {
  padding: 4px 8px;
  border: 1px solid #ddd;
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size-sm);
  width: 250px;
  background: var(--color-white);
}

.small-filter-input:focus {
  outline: none;
  border-color: var(--color-accent);
}

.real-time-clock {
  padding: clamp(0.3vh, 0.8vh, 1vh) clamp(0.8vw, 1.2vw, 2vw);
  border-radius: var(--border-radius-sm);
  font-size: clamp(0.8rem, 1.8vw, 1.4rem);
  color: var(--text-primary);
  font-weight: var(--font-weight-bold);
  text-align: center;
  letter-spacing: 1px;
  box-shadow: var(--shadow-sm);
  animation: clockGlow 2s ease-in-out infinite;
  white-space: nowrap;
  background: rgba(255,255,255,0.3);
  min-width: clamp(120px, 15vw, 200px);
}

@keyframes clockGlow {
  0%, 100% { 
    box-shadow: var(--shadow-sm);
  }
  50% { 
    box-shadow: 0 4px 12px rgba(16, 46, 158, 0.5);
  }
}

/* Logout Button */
.logout-button {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 16px 16px 8px;
    width: calc(100% - 32px);
    justify-content: center;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

.logout-button:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

.logout-button i {
    font-size: 1rem;
}
/* === CONNECTION STATUS STYLES === */
.connection-status {
  padding: clamp(0.3vh, 0.6vh, 0.8vh) clamp(0.6vw, 1vw, 1.5vw);
  border-radius: var(--border-radius-sm);
  font-size: clamp(0.7rem, 1.4vw, 1rem);
  font-weight: var(--font-weight-semibold);
  text-align: center;
  white-space: nowrap;
  min-width: clamp(100px, 12vw, 160px);
  transition: all 0.3s ease;
  margin-left: clamp(0.5vw, 1vw, 1.5vw);
}

.connection-status.connected {
  background: var(--color-success-background);
  color: var(--color-success);
  border: 1px solid var(--color-success);
}

.connection-status.disconnected {
  background: linear-gradient(135deg, #ff6b6b, #ee5a24);
  color: var(--text-white);
  border: 1px solid #ff4757;
  animation: connectionAlert 1s ease-in-out infinite;
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

@keyframes connectionAlert {
  0%, 100% { 
    opacity: 1;
    transform: scale(1);
  }
  50% { 
    opacity: 0.8;
    transform: scale(1.02);
  }
}

/* ===== PAGE-SPECIFIC STYLES ===== */

/* Homepage styles */
.homepage-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.5rem 0.5rem;
  display: flex;
  flex-direction: column;
}

.homepage-hero {
  text-align: center;
  padding: 0.3rem 0;
  margin-bottom: 0.5rem;
}

.homepage-title {
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
  font-weight: var(--font-weight-bold);
  line-height: 1.1;
}

.homepage-subtitle {
  font-size: var(--font-size-base);
  color: var(--text-gray);
  margin-bottom: 0;
  line-height: 1.4;
}

.homepage-section {
  margin-bottom: 0.4rem;
}

.homepage-section-title {
  font-size: clamp(1rem, 2vw, 1.4rem);
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 0.6rem;
  font-weight: var(--font-weight-bold);
}

.homepage-modules {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.module-row {
  display: flex;
  gap: var(--spacing-md);
  justify-content: center;
  flex-wrap: wrap;
}

.single-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.2rem;
  max-width: 1400px;
  margin: 0 auto;
  justify-content: center;
}

.module-title {
  width: 100%;
  text-align: center;
  font-size: var(--font-size-md);
  color: var(--text-secondary);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--spacing-sm);
}

.homepage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, 320px);
  gap: 1.2rem;
  max-width: 1400px;
  margin: 0 auto;
  justify-content: center;
}

/* Compact card design for better fit */
.homepage-card {
  background: var(--color-white);
  padding: 1rem;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  text-align: center;
  transition: var(--transition-base);
  border: 1px solid #e0e0e0;
  width: 320px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  margin: 0 auto;
  min-height: 200px;
}

.homepage-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.homepage-card-icon {
  width: clamp(40px, 6vw, 60px);
  height: clamp(40px, 6vw, 60px);
  margin: 0 auto 0.75rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.homepage-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: var(--transition-base);
}

.homepage-card:hover .homepage-card-icon img {
  transform: scale(1.1);
}

.homepage-card-title {
  font-size: clamp(1.1rem, 1.9vw, 1.3rem);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.homepage-card-description {
  font-size: clamp(0.9rem, 1.6vw, 1.1rem);
  color: var(--text-gray);
  margin-bottom: 0.6rem;
  line-height: 1.4;
}

.homepage-card-button {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--color-secondary);
  color: var(--text-white);
  text-decoration: none;
  border-radius: var(--border-radius-sm);
  font-weight: var(--font-weight-medium);
  transition: var(--transition-base);
  font-size: clamp(0.85rem, 1.3vw, 1rem);
  margin-top: auto;
}

.homepage-card-button:hover {
  background: var(--color-primary);
  transform: scale(1.05);
}

/* ===== FEATURES SECTION - COMPACT CIRCULAR ICON DESIGN ===== */
.features-card {
  text-align: center;
  transition: var(--transition-base);
  padding: var(--spacing-sm);
}

.features-card:hover {
  transform: translateY(-3px);
}

.features-card-icon-wrapper {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--color-white);
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto var(--spacing-sm) auto;
  box-shadow: var(--shadow-md);
  transition: var(--transition-base);
  border: 2px solid var(--color-secondary);
}

.features-card:hover .features-card-icon-wrapper {
  transform: scale(1.1);
  box-shadow: var(--shadow-lg);
}

/* ===== VIEW MORE BUTTON STYLES ===== */
.view-more-section {
  display: flex;
  justify-content: center;
  margin-top: 0.5rem;
  padding: 0.3rem 0;
}

.view-more-button {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, var(--color-secondary), var(--color-accent));
  color: var(--text-white);
  border: none;
  border-radius: 20px;
  font-size: clamp(0.8rem, 1.3vw, 1rem);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: var(--transition-base);
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.3);
  font-family: var(--font-primary);
}

.view-more-button:hover {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 46, 158, 0.4);
}

.view-more-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(16, 46, 158, 0.3);
}

.view-more-text {
  font-weight: var(--font-weight-medium);
}

.view-more-icon {
  font-size: var(--font-size-sm);
  transition: transform 0.3s ease;
}

.view-more-button:hover .view-more-icon {
  transform: translateY(2px);
}

.features-card-icon {
  width: clamp(36px, 5vw, 48px);
  height: clamp(36px, 5vw, 48px);
  margin: 0 auto 0.6rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.features-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: var(--transition-base);
}

.features-card:hover .features-card-icon img {
  transform: scale(1.1);
}

.features-card-title {
  font-size: clamp(0.9rem, 1.5vw, 1.1rem);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin-bottom: 0.3rem;
  line-height: 1.1;
}

.features-card-description {
  font-size: clamp(0.75rem, 1.2vw, 0.9rem);
  color: var(--text-gray);
  line-height: 1.2;
  margin: 0;
}

/* Features grid layout */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.8rem;
  margin-top: 0.2rem;
}

/* Dashboard styles */
.dashboard-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--spacing-lg);
}

.dashboard-title {
  font-size: var(--font-size-2xl);
  color: var(--text-secondary);
  margin-bottom: var(--spacing-lg);
  font-weight: var(--font-weight-bold);
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
}

.dashboard-stat-card {
  background: var(--color-white);
  padding: var(--spacing-lg);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-sm);
  border-left: 4px solid;
  transition: var(--transition-base);
}

.dashboard-stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.dashboard-stat-card.stat-today {
  border-left-color: #2196F3;
}

.dashboard-stat-card.stat-waiting {
  border-left-color: #4CAF50;
}

.dashboard-stat-card.stat-completed {
  border-left-color: #9C27B0;
}

.dashboard-stat-card.stat-emergency {
  border-left-color: #F44336;
}

.dashboard-stat-title {
  font-size: var(--font-size-sm);
  color: var(--text-gray);
  text-transform: uppercase;
  font-weight: var(--font-weight-medium);
  margin-bottom: var(--spacing-xs);
}

.dashboard-stat-number {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--spacing-xs);
}

.dashboard-stat-number.stat-today {
  color: #2196F3;
}

.dashboard-stat-number.stat-waiting {
  color: #4CAF50;
}

.dashboard-stat-number.stat-completed {
  color: #9C27B0;
}

.dashboard-stat-number.stat-emergency {
  color: #F44336;
}

.dashboard-description {
  background: var(--color-white);
  padding: var(--spacing-lg);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-sm);
  margin-top: var(--spacing-lg);
}

.dashboard-description-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
}

.dashboard-description-text {
  font-size: var(--font-size-base);
  color: var(--text-gray);
  line-height: 1.6;
}

/* ===== MAIN CONTENT STYLES ===== */
.main-content {
  padding: var(--spacing-md);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.page-title {
  font-size: var(--font-size-xl);
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: var(--spacing-lg);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Page title consistent for all pages */

/* ===== MAIN FILTER SECTION ===== */
.main-filter-section {
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-base);
  position: relative;
  flex-shrink: 0;
}

.filter-table {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  border-collapse: collapse;
  table-layout: fixed;
  border: none;
}

.filter-table td {
  padding: var(--spacing-base);
  vertical-align: middle;
  border: none;
}

.filter-table tr {
  border: none;
}

.empty-cell {
  width: 15%;
}

.label-cell {
  width: 20%;
  text-align: right;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: var(--font-primary);
  padding-right: var(--spacing-md);
}

/* Label cell consistent for all pages */

.content-cell {
  width: 50%;
  text-align: left;
  padding-left: var(--spacing-md);
}

/* ===== DEPARTMENT SELECTOR STYLES ===== */
.department-selector {
  position: relative;
  width: 100%;
}

.department-display {
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  transition: var(--transition-base);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: var(--font-primary);
  user-select: none;
}

.department-display:hover {
  border-color: var(--text-secondary);
  box-shadow: var(--shadow-md);
}

.department-display.active {
  border-color: var(--text-secondary);
  box-shadow: var(--shadow-md);
}

.department-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-white);
  border: 1px solid #ddd;
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-dropdown);
  z-index: var(--z-index-dropdown);
  margin-top: var(--spacing-sm);
  max-height: 200px;
  overflow-y: auto;
  font-size: var(--font-size-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: var(--transition-fast);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border: none;
  outline: none;
  padding: 0;
}

.department-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  display: block;
  -webkit-appearance: menulist;
  -moz-appearance: menulist;
  appearance: menulist;
}

.department-dropdown option {
  padding: 12px 18px;
  color: var(--color-secondary);
  font-size: 0.8em;
  font-weight: var(--font-weight-medium);
  background: var(--color-white);
}

.department-dropdown option:hover {
  background: var(--color-dropdown-selected) !important;
  color: var(--text-white) !important;
}

.department-dropdown option:checked {
  background: var(--color-dropdown-selected) !important;
  color: var(--text-white) !important;
}

.department-dropdown option:selected {
  background: var(--color-dropdown-selected) !important;
  color: var(--text-white) !important;
}

.department-dropdown option:focus {
  background: var(--color-dropdown-selected) !important;
  color: var(--text-white) !important;
}

/* ===== DOCTOR INFO STYLES ===== */
.doctor-info-content {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: var(--font-primary);
}

.doctor-info {
  color: var(--text-primary);
  padding: 1vh 1.5vw;
  border-radius: var(--border-radius-md);
  margin-top: var(--spacing-base);
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: none;
  font-family: var(--font-primary);
}

.doctor-info .label {
  font-weight: var(--font-weight-bold);
  margin-right: var(--spacing-base);
  font-size: 0.8em;
}

#doctor-name {
  font-weight: var(--font-weight-bold);
  font-size: 1em;
}

/* ===== PATIENT LIST SECTION ===== */
.patient-list-section {
  background: var(--color-white);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-table);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.table-container {
  flex-grow: 1;
  overflow-y: auto;
  border: 1px solid #e0e0e0;
  border-radius: var(--border-radius-base);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-white);
}

.table-header {
  position: sticky;
  top: 0;
  background: var(--color-table-header-gradient);
  z-index: var(--z-index-sticky);
}

.table-header th {
  padding: 1vh 1vw;
  color: var(--text-white);
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  text-align: center;
  border-right: 1px solid rgba(255,255,255,0.2);
}

/* Table header consistent for all pages */

.table-header th:last-child {
  border-right: none;
}

tbody tr {
  transition: var(--transition-base);
  border-bottom: 1px solid #f0f0f0;
}

tbody tr:hover {
  background: var(--text-light-gray);
}

td {
  padding: 0.8vh 0.6vw;
  text-align: center;
  font-size: var(--font-size-lg);
}

/* Table cell consistent for all pages */

.current-patient {
  background: var(--color-current-patient-gradient) !important;
  color: var(--text-white) !important;
  animation: glow 2s ease-in-out infinite;
  position: relative;
}

.current-patient td {
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-xl);
  color: var(--text-white) !important;
}

/* Current patient cell consistent for all pages */

.waiting-patient-merged {
  background: var(--text-light-gray);
}

@keyframes glow {
  0%, 100% { 
    box-shadow: 0 0 3px rgba(255, 107, 107, 0.7), 
                0 0 6px rgba(255, 107, 107, 0.5), 
                0 0 9px rgba(255, 107, 107, 0.3);
    background: var(--color-current-patient-gradient);
  }
  50% { 
    box-shadow: 0 0 6px rgba(255, 107, 107, 0.9), 
                0 0 12px rgba(255, 107, 107, 0.7), 
                0 0 18px rgba(255, 107, 107, 0.5);
    background: var(--color-current-patient-glow);
  }
}

/* ===== PRIORITY AND STATUS STYLES ===== */
.priority-normal { color: var(--color-priority-normal); }
.priority-appointment { color: var(--color-priority-appointment); font-weight: var(--font-weight-semibold); }
.priority-emergency { color: var(--color-priority-emergency); font-weight: var(--font-weight-bold); }
.priority-child { color: var(--color-priority-child); font-weight: var(--font-weight-semibold); }
.priority-disabled { color: var(--color-priority-disabled); font-weight: var(--font-weight-semibold); }
.priority-elderly { color: var(--color-priority-elderly); font-weight: var(--font-weight-semibold); }
.priority-pregnant { color: var(--color-priority-pregnant); font-weight: var(--font-weight-semibold); }

.status-examining {
  color: var(--color-status-examining);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
}

.status-waiting {
  color: var(--color-status-waiting);
  font-weight: var(--font-weight-semibold);
}

.no-data {
  text-align: center;
  padding: var(--spacing-lg);
  color: var(--text-gray);
  font-size: var(--font-size-lg);
  background: var(--text-light-gray);
  border-radius: var(--border-radius-base);
  margin: var(--spacing-base);
}

/* Chart Loading and Error States */
.chart-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  height: 100%;
}

.chart-error {
  margin: 10px;
}

.chart-error button:hover {
  background: #b91c1c !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
}

/* Spinner animation for loading states */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.icon {
  font-size: var(--font-size-xl);
}

/* ===== MODERN MENU SYSTEM ===== */
/* Menu Button (Hamburger) */
.logo-menu-button {
  background: none;
  border: none;
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.logo-menu-button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
  border-radius: 12px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.logo-menu-button:hover::before {
  opacity: 1;
}

.logo-menu-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(16, 46, 158, 0.15);
}

.logo-menu-button:active {
  transform: translateY(0);
}

/* Modern Mobile Menu Overlay */
.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* Modern Menu Slider */
.mobile-menu-slider {
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  width: min(380px, 85vw);
  background: linear-gradient(145deg, #ffffff, #f8fafc);
  box-shadow: 
    0 25px 50px rgba(0, 0, 0, 0.15),
    inset 1px 0 0 rgba(255, 255, 255, 0.2);
  transform: translateX(-100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 0 24px 24px 0;
}

.mobile-menu-overlay.show .mobile-menu-slider {
  transform: translateX(0);
}

/* Scrollbar Styling */
.mobile-menu-slider::-webkit-scrollbar {
  width: 6px;
}

.mobile-menu-slider::-webkit-scrollbar-track {
  background: transparent;
}

.mobile-menu-slider::-webkit-scrollbar-thumb {
  background: rgba(16, 46, 158, 0.2);
  border-radius: 3px;
}

.mobile-menu-slider::-webkit-scrollbar-thumb:hover {
  background: rgba(16, 46, 158, 0.3);
}

/* Modern Menu Header */
.menu-header {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: white;
  padding: 24px 24px 20px;
  position: sticky;
  top: 0;
  z-index: 10;
  border-radius: 0 24px 0 0;
  box-shadow: 0 4px 20px rgba(16, 46, 158, 0.15);
}

.menu-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
  border-radius: 0 24px 0 0;
  pointer-events: none;
}

.menu-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #ffffff, #e0f2fe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.menu-close-btn {
  border: none;
  background: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.menu-close-btn:hover {
  transform: scale(1.1);
}

/* Modern Menu Navigation */
.mobile-menu-nav {
  display: flex;
  flex-direction: column;
  padding: 8px 0 24px;
  gap: 4px;
}

/* Modern Home Link */
.mobile-menu-link.menu-home-link {
  margin: 16px 16px 8px;
  background: linear-gradient(135deg, #538bc3, #0863ca);
  color: white;
  font-weight: 600;
  padding: 16px 20px;
  border-radius: 16px;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 4px 14px rgba(16, 185, 129, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
}

.mobile-menu-link.menu-home-link::before {
  content: '';
  position: absolute;
  color: white;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-menu-link.menu-home-link:hover::before {
  opacity: 1;
}

.mobile-menu-link.menu-home-link:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 8px 25px rgba(16, 185, 129, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Modern Menu Sections */
.menu-section {
  margin: 0 12px 8px;
  background: white;
  border-radius: 16px;
  overflow: visible; /* Changed from hidden to visible to prevent nested sections from being clipped */
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.04),
    0 1px 2px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
  position: relative; /* Added for proper z-index stacking */
}

.menu-section:hover {
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.08),
    0 2px 4px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

/* Ensure nested sections don't get transformed with parent */
.menu-section .menu-section-content {
  transform: none;
  overflow: auto;
}

.menu-section:hover .menu-section.nested-section {
  transform: none;
}

.menu-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 18px 20px;
  background: white;
  border: none;
  transition: all 0.3s ease;
  user-select: none;
  position: relative;
}

.menu-section-header:hover {
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
}

.menu-section-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: #1e293b;
  letter-spacing: -0.01em;
}

.menu-section.active .menu-section-title {
  color: var(--color-primary);
}

.menu-section-toggle {
  font-size: 12px;
  color: #64748b;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: #f1f5f9;
  padding: 6px;
  border-radius: 6px;
  min-width: 24px;
  text-align: center;
}

.menu-section.collapsed .menu-section-toggle {
  transform: rotate(-90deg);
  background: #e2e8f0;
}

.menu-section.active .menu-section-toggle {
  background: rgba(16, 46, 158, 0.1);
  color: var(--color-primary);
}

.menu-section-content {
  max-height: 400px;
  overflow-y: auto;
  overflow-x: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(145deg, #fafbfc, #f8fafc);
  border-radius: 0 0 16px 16px; /* Round bottom corners */
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f1f5f9;
}

/* Custom scrollbar for webkit browsers */
.menu-section-content::-webkit-scrollbar {
  width: 6px;
}

.menu-section-content::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}

.menu-section-content::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.menu-section-content::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.menu-section.collapsed .menu-section-content {
  max-height: 0;
  overflow: hidden; /* Ensure content is truly hidden when collapsed */
}

/* Modern Menu Links */
.mobile-menu-link {
  display: block;
  text-decoration: none;
  font-size: 0.95rem;
  color: #475569;
  font-weight: 500;
  padding: 14px 20px;
  border: none;
  transition: all 0.3s ease;
  background: transparent;
  position: relative;
  margin: 0 8px;
  border-radius: 12px;
}

.mobile-menu-link.submenu {
  padding-left: 45px; /* Increased to match enhanced styles */
  font-size: 0.9rem;
  color: #64748b;
  margin: 2px 12px;
  border-radius: 10px;
  position: relative;
}

.mobile-menu-link.submenu::before {
  content: '';
  position: absolute;
  left: 28px; /* Moved further right from border-left */
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  background: #cbd5e1;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.mobile-menu-link:hover {
  color: var(--color-primary);
  background: linear-gradient(135deg, rgba(16, 46, 158, 0.05), rgba(33, 150, 243, 0.03));
  transform: translateX(4px);
}

.mobile-menu-link.submenu:hover::before {
  background: var(--color-primary);
  transform: translateY(-50%) scale(1.2);
}

/* Active States */
.mobile-menu-link.active {
  color: var(--color-primary);
  font-weight: 600;
  background: linear-gradient(135deg, rgba(16, 46, 158, 0.1), rgba(33, 150, 243, 0.05));
  position: relative;
}

.mobile-menu-link.active::after {
  content: '';
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 20px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  border-radius: 2px;
  box-shadow: 0 2px 8px rgba(16, 46, 158, 0.3);
}

.mobile-menu-link.submenu.active::before {
  background: var(--color-primary);
  color: white;
  box-shadow: 0 0 12px rgba(16, 46, 158, 0.4);
}

.mobile-menu-link.submenu.active::after {
  left: 20px;
  width: 3px;
  height: 16px;
}

/* Loading Animation */
.menu-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  color: #64748b;
}

.menu-loading::before {
  content: '';
  width: 24px;
  height: 24px;
  border: 3px solid #e2e8f0;
  border-top: 3px solid var(--color-primary);
  border-radius: 50%;
  margin-right: 12px;
  animation: modernSpin 1s linear infinite;
}

@keyframes modernSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Modern Responsive Adjustments */
@media (max-width: 480px) {
  .mobile-menu-slider {
    width: 90vw;
    border-radius: 0 20px 20px 0;
  }
  
  .menu-header {
    padding: 20px 20px 16px;
    border-radius: 0 20px 0 0;
  }
  
  .menu-section {
    margin: 0 8px 6px;
    border-radius: 12px;
  }
  
  .mobile-menu-link.menu-home-link {
    margin: 12px 12px 8px;
    border-radius: 12px;
  }
}

/* Dark Mode Support
@media (prefers-color-scheme: dark) {
  .mobile-menu-slider {
    background: linear-gradient(145deg, #1e293b, #0f172a);
  }
  
  .menu-section {
    background: #334155;
    box-shadow: 
      0 2px 8px rgba(0, 0, 0, 0.3),
      0 1px 2px rgba(0, 0, 0, 0.4);
  }
  
  .menu-section-header {
    background: #334155;
  }
  
  .menu-section-header:hover {
    background: linear-gradient(135deg, #475569, #3f495a);
  }
  
  .menu-section-title {
    color: #e2e8f0;
  }
  
  .mobile-menu-link {
    color: #cbd5e1;
  }
  
  .mobile-menu-link.submenu {
    color: #94a3b8;
  }
} */

/* ===== RESPONSIVE DESIGN ===== */
/* Extra Large screens - 24-27 inch monitors and above */
@media (min-width: 2560px) {
  :root {
    --font-size-xs: clamp(1rem, 1.8vw, 1.3rem);
    --font-size-sm: clamp(1.1rem, 2.1vw, 1.4rem);
    --font-size-base: clamp(1.2rem, 2.5vw, 1.6rem);
    --font-size-md: clamp(1.4rem, 2.9vw, 1.9rem);
    --font-size-lg: clamp(1.6rem, 3.3vw, 2.1rem);
    --font-size-xl: clamp(1.8rem, 3.7vw, 2.4rem);
    --font-size-2xl: clamp(2rem, 4.1vw, 2.8rem);
    --font-size-3xl: clamp(2.3rem, 4.6vw, 3.3rem);
  }
  
  .container {
    width: 90%;
    max-width: 2400px;
  }
  
  .header-content {
    gap: 4vw;
    padding: 0 2vw;
  }
  
  .logo {
    height: clamp(60px, 10vh, 120px);
    max-width: 12vw;
  }
  
  .hospital-title {
    font-size: clamp(2.2rem, 4.2vw, 3rem);
  }
  
  .real-time-clock {
    font-size: clamp(1.5rem, 3vw, 2.4rem);
    padding: 1vh 2vw;
  }
  
  .homepage-title {
    font-size: clamp(2.5rem, 4.8vw, 3.6rem);
  }
  
  .homepage-card {
    min-height: clamp(250px, 25vh, 350px);
    padding: 10px;
  }
  
  .homepage-card-icon {
    width: clamp(60px, 8vw, 80px);
    height: clamp(60px, 8vw, 80px);
    margin: 0 auto 1rem auto;
  }
  
  .homepage-card-title {
    font-size: clamp(1.2rem, 2.5vw, 2rem);
  }
  
  /* Queuing System specific enhancements for 2560px+ */
  .table-header th {
    font-size: clamp(2rem, 4.2vw, 2.8rem);
  }
  
  td {
    font-size: clamp(1.6rem, 3.3vw, 2.2rem);
  }
  
  .current-patient td {
    font-size: clamp(1.8rem, 3.7vw, 2.5rem);
  }
  
  .branch-display-title {
    font-size: clamp(2rem, 4.2vw, 2.8rem);
  }
  
  .department-display {
    font-size: clamp(1.8rem, 3.7vw, 2.5rem);
  }
  
  .doctor-info {
    font-size: clamp(2.2rem, 4.6vw, 3.2rem);
  }
  
  .label-cell {
    font-size: clamp(1.6rem, 3.3vw, 2.2rem);
  }
}

/* Ultra Large screens - 32+ inch monitors, 4K+ displays */
@media (min-width: 3440px) {
  :root {
    --font-size-xs: clamp(1.2rem, 2.1vw, 1.6rem);
    --font-size-sm: clamp(1.3rem, 2.4vw, 1.7rem);
    --font-size-base: clamp(1.5rem, 2.8vw, 1.9rem);
    --font-size-md: clamp(1.7rem, 3.2vw, 2.2rem);
    --font-size-lg: clamp(1.9rem, 3.6vw, 2.5rem);
    --font-size-xl: clamp(2.1rem, 4vw, 2.8rem);
    --font-size-2xl: clamp(2.4rem, 4.5vw, 3.2rem);
    --font-size-3xl: clamp(2.8rem, 5vw, 3.8rem);
  }
/*   
  .container {
    width: 85%;
    max-width: 3200px;
  }
   */
  .hospital-title {
    font-size: clamp(2.8rem, 5.2vw, 3.8rem);
  }
  
  .real-time-clock {
    font-size: clamp(1.8rem, 3.6vw, 2.8rem);
  }
  
  .homepage-title {
    font-size: clamp(3rem, 5.5vw, 4.2rem);
  }
  
  .homepage-card-title {
    font-size: clamp(1.5rem, 3vw, 2.4rem);
  }
  
  .homepage-card-icon {
    width: clamp(70px, 10vw, 100px);
    height: clamp(70px, 10vw, 100px);
    margin: 0 auto 1.2rem auto;
  }
  
  /* Queuing System specific enhancements for 3440px+ */
  .table-header th {
    font-size: clamp(2.4rem, 4.5vw, 3.2rem);
  }
  
  td {
    font-size: clamp(1.9rem, 3.6vw, 2.5rem);
  }
  
  .current-patient td {
    font-size: clamp(2.1rem, 4vw, 2.8rem);
  }
  
  .branch-display-title {
    font-size: clamp(2.4rem, 4.5vw, 3.2rem);
  }
  
  .department-display {
    font-size: clamp(2.1rem, 4vw, 2.8rem);
  }
  
  .doctor-info {
    font-size: clamp(2.6rem, 5vw, 3.6rem);
  }
  
  .label-cell {
    font-size: clamp(1.9rem, 3.6vw, 2.5rem);
  }
}

/* Super Ultra Large screens - 5K+ displays and massive monitors */
@media (min-width: 5120px) {
  :root {
    --font-size-xs: clamp(1.5rem, 2.5vw, 2rem);
    --font-size-sm: clamp(1.6rem, 2.8vw, 2.1rem);
    --font-size-base: clamp(1.8rem, 3.2vw, 2.4rem);
    --font-size-md: clamp(2rem, 3.6vw, 2.7rem);
    --font-size-lg: clamp(2.2rem, 4vw, 3rem);
    --font-size-xl: clamp(2.5rem, 4.5vw, 3.4rem);
    --font-size-2xl: clamp(2.8rem, 5vw, 3.8rem);
    --font-size-3xl: clamp(3.2rem, 5.5vw, 4.5rem);
  }
  
  .hospital-title {
    font-size: clamp(3.5rem, 6vw, 4.8rem);
  }
  
  .real-time-clock {
    font-size: clamp(2.2rem, 4.2vw, 3.4rem);
  }
  
  .homepage-title {
    font-size: clamp(3.8rem, 6.5vw, 5.2rem);
  }
  
  .homepage-card-title {
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  }
  
  .homepage-card-icon {
    width: clamp(80px, 12vw, 120px);
    height: clamp(80px, 12vw, 120px);
    margin: 0 auto 1.5rem auto;
  }
  
  /* Queuing System specific enhancements for 5120px+ */
  .table-header th {
    font-size: clamp(2.8rem, 5vw, 3.8rem);
  }
  
  td {
    font-size: clamp(2.2rem, 4vw, 3rem);
  }
  
  .current-patient td {
    font-size: clamp(2.5rem, 4.5vw, 3.4rem);
  }
  
  .branch-display-title {
    font-size: clamp(2.8rem, 5vw, 3.8rem);
  }
  
  .department-display {
    font-size: clamp(2.5rem, 4.5vw, 3.4rem);
  }
  
  .doctor-info {
    font-size: clamp(3.2rem, 5.5vw, 4.2rem);
  }
  
  .label-cell {
    font-size: clamp(2.2rem, 4vw, 3rem);
  }
}

/* Large screens - minor adjustments only */
@media (min-width: 1920px) {
  :root {
    --font-size-xs: clamp(0.85rem, 1.6vw, 1.15rem);
    --font-size-sm: clamp(0.95rem, 1.9vw, 1.25rem);
    --font-size-base: clamp(1.05rem, 2.3vw, 1.4rem);
    --font-size-md: clamp(1.2rem, 2.7vw, 1.6rem);
    --font-size-lg: clamp(1.4rem, 3.1vw, 1.8rem);
    --font-size-xl: clamp(1.6rem, 3.5vw, 2rem);
    --font-size-2xl: clamp(1.8rem, 3.9vw, 2.3rem);
    --font-size-3xl: clamp(2rem, 4.3vw, 2.7rem);
  }
  
  .container {
    width: 95%;
    max-width: 1800px;
  }
  
  .header-content {
    gap: 3vw;
  }
  
  .logo {
    height: clamp(50px, 9vh, 100px);
    max-width: 13vw;
  }
  
  .hospital-title {
    font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  }
  
  .real-time-clock {
    font-size: clamp(1.2rem, 2.4vw, 1.8rem);
  }
  
  /* Queuing System specific enhancements for 1920px+ */
  .table-header th {
    font-size: clamp(1.8rem, 4vw, 2.4rem);
  }
  
  td {
    font-size: clamp(1.4rem, 3.1vw, 1.9rem);
  }
  
  .current-patient td {
    font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  }
  
  .branch-display-title {
    font-size: clamp(1.8rem, 4vw, 2.4rem);
  }
  
  .department-display {
    font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  }
  
  .doctor-info {
    font-size: clamp(2rem, 4.3vw, 2.7rem);
  }
  
  .label-cell {
    font-size: clamp(1.4rem, 3.1vw, 1.9rem);
  }
}

/* Desktop optimization - smaller homepage cards with responsive fonts */
@media (min-width: 1200px) {
  .single-row {
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: 1.4rem;
    justify-content: center;
    max-width: 1600px;
  }
  
  .homepage-grid {
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: 1.4rem;
    justify-content: center;
    max-width: 1600px;
  }
  
  .homepage-card {
    padding: 1.2rem;
  }
  
  .homepage-card-title {
    font-size: 1.2rem;
    margin-bottom: 0.4rem;
  }
  
  .homepage-card-description {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
  }
  
  .homepage-card-button {
    font-size: 0.9rem;
    padding: 0.4rem 0.7rem;
  }
  
  .homepage-card-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 0.6rem auto;
  }
}

/* Medium to large tablets and small desktops */
@media (max-width: 1199px) {
  .header-content {
    gap: 1.5vw;
  }
  
  .empty-cell {
    width: 10%;
  }
  
  .label-cell {
    width: 25%;
  }
  
  .content-cell {
    width: 55%;
  }
}

/* Tablet Landscape (768px - 991px) */
@media (max-width: 991px) {
  :root {
    --font-size-xs: clamp(0.6rem, 1.8vw, 0.8rem);
    --font-size-sm: clamp(0.7rem, 2.1vw, 0.9rem);
    --font-size-base: clamp(0.8rem, 2.4vw, 1rem);
    --font-size-md: clamp(0.9rem, 2.7vw, 1.1rem);
    --font-size-lg: clamp(1rem, 3vw, 1.2rem);
    --font-size-xl: clamp(1.1rem, 3.3vw, 1.3rem);
    --font-size-2xl: clamp(1.2rem, 3.6vw, 1.4rem);
    --font-size-3xl: clamp(1.3rem, 3.9vw, 1.6rem);
  }
  
  .logo {
    height: clamp(45px, 7vh, 70px);
    max-width: 18vw;
  }
  
  .header-content {
    gap: 2vw;
  }
  
  .hospital-title {
    font-size: clamp(1rem, 2.2vw, 1.4rem);
  }
  
  .small-filters {
    top: 1vh;
    right: 1vw;
  }
  
  /* Queuing System specific enhancements for tablets (991px) */
  .table-header th {
    font-size: clamp(1.3rem, 3.6vw, 1.5rem);
  }
  
  td {
    font-size: clamp(1.1rem, 3vw, 1.3rem);
  }
  
  .current-patient td {
    font-size: clamp(1.2rem, 3.3vw, 1.4rem);
  }
  
  .branch-display-title {
    font-size: clamp(1.3rem, 3.6vw, 1.5rem);
  }
  
  .department-display {
    font-size: clamp(1.2rem, 3.3vw, 1.4rem);
  }
}

/* Tablet Portrait (576px - 767px) */
@media (max-width: 767px) {
  :root {
    --font-size-xs: clamp(0.55rem, 2.2vw, 0.75rem);
    --font-size-sm: clamp(0.65rem, 2.6vw, 0.85rem);
    --font-size-base: clamp(0.75rem, 3vw, 0.95rem);
    --font-size-md: clamp(0.85rem, 3.4vw, 1.05rem);
    --font-size-lg: clamp(0.95rem, 3.8vw, 1.15rem);
    --font-size-xl: clamp(1.05rem, 4.2vw, 1.25rem);
    --font-size-2xl: clamp(1.15rem, 4.6vw, 1.35rem);
    --font-size-3xl: clamp(1.25rem, 5vw, 1.5rem);
  }
  
  body {
    padding: 3px;
  }
  .container {
    height: calc(100vh - 6px);
  }
  .header {
    padding: 10px 15px;
  }
  .header-content {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }
  .logo {
    height: clamp(55px, 8vh, 80px);
    max-width: 25vw;
  }
  .hospital-title {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
  }
  .branch-display-title {
    font-size: clamp(0.8rem, 3vw, 1.1rem);
    justify-content: center;
    text-align: center;
  }
  .address, .phone {
    font-size: clamp(0.6rem, 2.5vw, 0.8rem);
  }
  .branch-selector-title {
    margin-left: 0;
    margin-top: 0;
  }
  .main-content {
    padding: 5px;
  }
  .small-filters {
    position: absolute;
    top: 10px;
    right: 10px;
    margin-left: 0;
    margin-bottom: 0;
  }
  .small-filter-item {
    flex-direction: column;
    gap: 3px;
  }
  .small-filter-label {
    font-size: 0.6em;
  }
  .real-time-clock {
    font-size: clamp(0.8rem, 2.5vw, 1.2rem);
    padding: clamp(4px, 1vh, 8px) clamp(8px, 2vw, 12px);
    min-width: clamp(100px, 20vw, 150px);
  }
  .main-filter-section {
    padding: 5px;
    margin-bottom: 8px;
  }
  .filter-table,
  .filter-table td {
    width: 100%;
    border: 0px;
  }
  .empty-cell {
    width: 5%;
  }
  .label-cell {
    width: 30%;
    font-size: clamp(0.9rem, 3.4vw, 1.1rem);
    text-align: center;
    padding-right: 5px;
  }
  .content-cell {
    width: 65%;
    text-align: left;
    padding-left: 5px;
  }
  .department-display {
    font-size: clamp(0.85rem, 3.4vw, 1.05rem);
    padding: 0px 0px;
    min-width: 200px;
    width: 100%;
  }
  .doctor-info {
    font-size: clamp(0.85rem, 3.4vw, 1.05rem);
    padding: 6px 10px;
    margin-top: 8px;
    min-width: 200px;
    width: 100%;
  }
  .doctor-info-content {
    font-size: 0.8em;
    min-width: 200px;
    width: 100%;
  }
  .doctor-info .label {
    font-size: clamp(0.75rem, 3vw, 0.95rem);
  }
  #doctor-name {
    font-size: clamp(0.95rem, 3.8vw, 1.15rem);
  }
  .table-header th {
    font-size: clamp(1.2rem, 4.6vw, 1.4rem);
    padding: 9px 7px;
  }
  td {
    font-size: clamp(1.1rem, 4.2vw, 1.3rem);
    padding: 8px 6px;
  }
  .current-patient td {
    font-size: clamp(1.3rem, 4.8vw, 1.5rem);
  }
  .no-data {
    font-size: clamp(1rem, 4vw, 1.2rem);
    padding: 15px;
  }
  .department-dropdown {
    min-width: 250px;
    width: 100%;
  }
  .department-dropdown option {
    font-size: clamp(0.9rem, 3.4vw, 1.1rem);
    padding: 10px 14px;
  }
  .branch-dropdown-title {
    min-width: 250px;
    width: 100%;
  }
  .branch-dropdown-title option {
    font-size: 0.7em;
    padding: 10px 14px;
  }
}

/* Mobile Large (480px - 575px) */
@media (max-width: 575px) {
  :root {
    --font-size-xs: clamp(0.5rem, 2.8vw, 0.7rem);
    --font-size-sm: clamp(0.6rem, 3.2vw, 0.8rem);
    --font-size-base: clamp(0.7rem, 3.6vw, 0.9rem);
    --font-size-md: clamp(0.8rem, 4vw, 1rem);
    --font-size-lg: clamp(0.9rem, 4.4vw, 1.1rem);
    --font-size-xl: clamp(1rem, 4.8vw, 1.2rem);
    --font-size-2xl: clamp(1.1rem, 5.2vw, 1.3rem);
    --font-size-3xl: clamp(1.2rem, 5.6vw, 1.4rem);
  }
  
  .container {
    border-radius: 8px;
  }
  .header {
    padding: 8px 12px;
  }
  .logo {
    height: clamp(45px, 9vh, 70px);
    max-width: 30vw;
  }
  .hospital-title {
    font-size: clamp(0.9rem, 2.8vw, 1.2rem);
  }
  .branch-display-title {
    font-size: 0.9em;
    justify-content: center;
    text-align: center;
  }
  .address, .phone {
    font-size: 0.6em;
  }
  .main-content {
    padding: 5px;
  }
  .small-filters {
    position: absolute;
    top: 8px;
    right: 8px;
  }
  .small-filter-label {
    font-size: 0.5em;
  }
  .real-time-clock {
    font-size: clamp(0.7rem, 3vw, 1rem);
    padding: clamp(3px, 0.8vh, 6px) clamp(6px, 2.5vw, 10px);
    min-width: clamp(90px, 22vw, 130px);
  }
  .main-filter-section {
    padding: 8px;
  }
  .label-cell {
    font-size: 0.7em;
  }
  .department-display {
    font-size: 0.7em;
    padding: 0px 0px;
    min-width: 180px;
    width: 100%;
  }
  .doctor-info {
    font-size: 0.7em;
    padding: 5px 8px;
    min-width: 180px;
    width: 100%;
  }
  .doctor-info-content {
    font-size: 0.7em;
    min-width: 180px;
    width: 100%;
  }
  .doctor-info .label {
    font-size: 0.6em;
  }
  #doctor-name {
    font-size: 1em;
  }
  .table-header th {
    font-size: 1.1em;
    padding: 8px 6px;
  }
  td {
    font-size: 1em;
    padding: 7px 5px;
  }
  .current-patient td {
    font-size: 1.1em;
  }
  .no-data {
    font-size: 0.8em;
    padding: 12px;
  }
  .department-dropdown {
    min-width: 220px;
    width: 100%;
  }
  .department-dropdown option {
    font-size: 0.6em;
    padding: 8px 12px;
  }
  .branch-dropdown-title {
    min-width: 220px;
    width: 100%;
  }
  .branch-dropdown-title option {
    font-size: 0.6em;
    padding: 8px 12px;
  }
}

/* Mobile Small (320px - 479px) */
@media (max-width: 479px) {
  :root {
    --font-size-xs: clamp(0.45rem, 3.2vw, 0.65rem);
    --font-size-sm: clamp(0.55rem, 3.6vw, 0.75rem);
    --font-size-base: clamp(0.65rem, 4vw, 0.85rem);
    --font-size-md: clamp(0.75rem, 4.4vw, 0.95rem);
    --font-size-lg: clamp(0.85rem, 4.8vw, 1.05rem);
    --font-size-xl: clamp(0.95rem, 5.2vw, 1.15rem);
    --font-size-2xl: clamp(1.05rem, 5.6vw, 1.25rem);
    --font-size-3xl: clamp(1.15rem, 6vw, 1.35rem);
  }
  
  body {
    padding: 2px;
  }
  .container {
    height: calc(100vh - 4px);
    border-radius: 6px;
  }
  .header {
    padding: 6px 10px;
  }
  .logo {
    height: clamp(40px, 10vh, 65px);
    max-width: 35vw;
  }
  .hospital-title {
    font-size: clamp(0.8rem, 3vw, 1.1rem);
  }
  .branch-display-title {
    font-size: 0.7em;
    line-height: 1;
    justify-content: center;
    text-align: center;
  }
  .address, .phone {
    font-size: 0.5em;
  }
  .main-content {
    padding: 6px;
  }
  .small-filters {
    position: absolute;
    top: 6px;
    right: 6px;
    gap: 2px;
  }
  .small-filter-label {
    font-size: 0.4em;
  }
  .real-time-clock {
    font-size: clamp(0.6rem, 3.5vw, 0.9rem);
    padding: clamp(2px, 0.6vh, 4px) clamp(4px, 3vw, 8px);
    min-width: clamp(80px, 25vw, 110px);
  }
  .main-filter-section {
    padding: 6px;
  }
  .label-cell {
    font-size: 0.7em;
    gap: 5px;
  }
  .department-display {
    font-size: 0.6em;
    padding: 0px 0px;
    min-width: 160px;
    width: 100%;
  }
  .doctor-info {
    font-size: 0.6em;
    padding: 4px 6px;
    min-width: 160px;
    width: 100%;
  }
  .doctor-info-content {
    font-size: 0.7em;
    min-width: 160px;
    width: 100%;
  }
  .doctor-info .label {
    font-size: 0.5em;
  }
  #doctor-name {
    font-size: 0.9em;
  }
  .table-header th {
    font-size: 1em;
    padding: 7px 5px;
  }
  td {
    font-size: 0.9em;
    padding: 6px 4px;
  }
  .current-patient td {
    font-size: 1em;
  }
  .no-data {
    font-size: 0.7em;
    padding: 10px;
  }
  .department-dropdown {
    min-width: 200px;
    width: 100%;
  }
  .department-dropdown option {
    font-size: 0.55em;
    padding: 6px 10px;
  }
  .branch-dropdown-title {
    min-width: 200px;
    width: 100%;
  }
  .branch-dropdown-title option {
    font-size: 0.55em;
    padding: 6px 10px;
  }
}

/* Mobile Extra Small (below 320px) */
@media (max-width: 319px) {
  .branch-display-title {
    font-size: 0.8em;
  }
  .main-filter-label {
    font-size: 0.8em;
  }
  .main-filter-input {
    font-size: 0.8em;
  }
  .doctor-info {
    font-size: 0.8em;
  }
  .doctor-info .label {
    font-size: 0.5em;
  }
  #doctor-name {
    font-size: 0.8em;
  }
  .table-header th {
    font-size: 0.9em;
  }
  td {
    font-size: 0.8em;
  }
}

/* ===== RESPONSIVE DESIGN FOR PAGE-SPECIFIC STYLES ===== */
@media (max-width: 768px) {
  .homepage-container {
    padding: var(--spacing-sm) var(--spacing-xs);
    min-height: calc(100vh - 100px);
  }
  
  .homepage-hero {
    padding: var(--spacing-sm) 0;
    margin-bottom: var(--spacing-sm);
  }
  
  .homepage-title {
    font-size: clamp(1.1rem, 4vw, 1.4rem);
  }
  
  .homepage-subtitle {
    font-size: clamp(0.8rem, 3vw, 1rem);
  }
  
  .homepage-section {
    margin-bottom: var(--spacing-md);
  }
  
  .homepage-section-title {
    font-size: clamp(1rem, 3.5vw, 1.2rem);
    margin-bottom: var(--spacing-sm);
  }
  
  .module-row {
    flex-direction: column;
    gap: var(--spacing-sm);
  }
  
  .single-row {
   grid-template-columns: repeat(2, 1fr);
   gap: var(--spacing-sm);
   max-width: 100%;
   /* Ensure each row stretches full width on small screens so separate .single-row blocks align
     when there are different numbers of items per row. Remove auto centering which caused
     visual offsets between rows. */
   margin: 0;
   justify-content: stretch;
   width: 100%;
   padding: 0;
  }
  
  .homepage-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
  }
  
  .homepage-card {
   min-height: 180px;
   padding: 10px;
   /* Remove horizontal auto-centering and ensure cards fill their grid cells so
     card columns line up across separate .single-row containers. */
   margin: 0;
   width: 100%;
   align-items: stretch;
  }

  .homepage-card-icon {
    width: clamp(40px, 8vw, 56px);
    height: clamp(40px, 8vw, 56px);
    margin: 0 auto var(--spacing-xs) auto;
  }

  .homepage-card-title {
    font-size: clamp(0.9rem, 3.5vw, 1.1rem);
    margin-bottom: var(--spacing-xs);
  }

  .homepage-card-description {
    font-size: clamp(0.7rem, 2.8vw, 0.9rem);
    line-height: 1.4;
    margin-bottom: var(--spacing-xs);
  }

  .homepage-card-button {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: clamp(0.6rem, 2.5vw, 0.8rem);
  }  .features-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-sm);
  }

  .features-card {
    padding: var(--spacing-xs);
  }

  .view-more-section {
    margin-top: var(--spacing-md);
    padding: var(--spacing-sm) 0;
  }

  .view-more-button {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-sm);
  }
  
  .features-card-icon-wrapper {
    width: 60px;
    height: 60px;
  }
  
  .features-card-icon {
    width: 32px;
    height: 32px;
    margin: 0 auto 0.4rem auto;
  }
  
  .features-card-title {
    font-size: var(--font-size-sm);
  }
  
  .features-card-description {
    font-size: var(--font-size-xs);
  }
}
  
  .homepage-title {
    font-size: var(--font-size-2xl);
  }
  
  .dashboard-container {
    padding: var(--spacing-sm);
  }
  
  .dashboard-stats {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
  }
  
  .dashboard-stat-card {
    padding: var(--spacing-sm);
  }
  
  .dashboard-stat-number {
    font-size: var(--font-size-2xl);
  }

/* Tablet size - between mobile and desktop */
@media (min-width: 481px) and (max-width: 767px) {
  .single-row {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
    max-width: 600px;
    margin: 0 auto;
  }

  .homepage-card {
    min-height: 200px;
    padding: 10px;
  }

  .homepage-card-icon {
    font-size: clamp(2.5rem, 5vw, 3.2rem);
    margin-bottom: var(--spacing-sm);
  }

  .homepage-card-title {
    font-size: clamp(1rem, 3.2vw, 1.3rem);
    margin-bottom: var(--spacing-sm);
  }

  .homepage-card-description {
    font-size: clamp(0.8rem, 2.6vw, 1rem);
    margin-bottom: var(--spacing-sm);
  }

  .homepage-card-button {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: clamp(0.7rem, 2.4vw, 0.9rem);
  }

  .view-more-button {
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: clamp(0.9rem, 2.8vw, 1.1rem);
  }
}

@media (max-width: 480px) {
  .single-row {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-xs);
  }

  .homepage-card {
    padding: 10px;
    min-height: 160px;
  }
  
  .homepage-card-icon {
    font-size: clamp(1.8rem, 7vw, 2.5rem);
    margin-bottom: var(--spacing-xs);
  }
  
  .homepage-card-title {
    font-size: clamp(0.8rem, 4vw, 1rem);
    margin-bottom: var(--spacing-xs);
  }

  .homepage-card-description {
    font-size: clamp(0.6rem, 3.2vw, 0.8rem);
    line-height: 1.3;
    margin-bottom: var(--spacing-xs);
  }

  .homepage-card-button {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: clamp(0.55rem, 2.8vw, 0.7rem);
  }

  .view-more-section {
    margin-top: var(--spacing-sm);
    padding: var(--spacing-xs) 0;
  }

  .view-more-button {
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: clamp(0.7rem, 3.5vw, 0.9rem);
    gap: var(--spacing-xs);
  }
  
  .dashboard-title {
    font-size: clamp(1.2rem, 5vw, 1.5rem);
  }
  
  .dashboard-stat-number {
    font-size: clamp(1.4rem, 6vw, 1.8rem);
  }
}

/* ===== DASHBOARD SPECIFIC STYLES ===== */
/* Thêm các style này vào cuối file style.css hiện tại */

/* Dashboard Grid Layouts */
.dashboard-grid-1 { 
  display: grid; 
  grid-template-columns: repeat(1, 1fr); 
  gap: 1.5rem; 
}

.dashboard-grid-2 { 
  display: grid; 
  grid-template-columns: repeat(2, 1fr); 
  gap: 1.5rem; 
}

.dashboard-grid-3 { 
  display: grid; 
  grid-template-columns: repeat(3, 1fr); 
  gap: 1.5rem; 
}

.dashboard-grid-4 { 
  display: grid; 
  grid-template-columns: repeat(4, 1fr); 
  gap: 1.5rem; 
}

/* Responsive Grid */
@media (min-width: 768px) {
  .dashboard-grid-md-2 { 
    grid-template-columns: repeat(2, 1fr); 
  }
}

@media (min-width: 1024px) {
  .dashboard-grid-lg-2 { 
    grid-template-columns: repeat(2, 1fr); 
  }
  .dashboard-grid-lg-3 { 
    grid-template-columns: repeat(3, 1fr); 
  }
  .dashboard-grid-lg-4 { 
    grid-template-columns: repeat(4, 1fr); 
  }
}

/* Dashboard Performance Cards */
.dashboard-perf-card {
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  padding: 1.5rem;
  border-left: 4px solid;
  transition: box-shadow 0.3s ease;
}

.dashboard-perf-card:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.dashboard-perf-card.border-blue { border-left-color: #3B82F6; }
.dashboard-perf-card.border-green { border-left-color: #10B981; }
.dashboard-perf-card.border-orange { border-left-color: #F59E0B; }
.dashboard-perf-card.border-red { border-left-color: #EF4444; }

.dashboard-perf-card-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dashboard-perf-card-info {
  flex: 1;
}

.dashboard-perf-card-label {
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.dashboard-perf-card-label.text-blue { color: #2563EB; }
.dashboard-perf-card-label.text-green { color: #059669; }
.dashboard-perf-card-label.text-orange { color: #D97706; }
.dashboard-perf-card-label.text-red { color: #DC2626; }

.dashboard-perf-card-number {
  font-size: 1.875rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 0.25rem;
}

.dashboard-perf-card-trend {
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: 0.25rem;
}

.dashboard-perf-card-trend.trend-up { color: #10B981; }
.dashboard-perf-card-trend.trend-down { color: #EF4444; }
.dashboard-perf-card-trend.trend-stable { color: #F59E0B; }

.dashboard-perf-card-icon {
  padding: 0.75rem;
  border-radius: 50%;
}

.dashboard-perf-card-icon.bg-blue { background-color: #DBEAFE; }
.dashboard-perf-card-icon.bg-green { background-color: #D1FAE5; }
.dashboard-perf-card-icon.bg-orange { background-color: #FEF3C7; }
.dashboard-perf-card-icon.bg-red { background-color: #FEE2E2; }

.dashboard-perf-card-icon i {
  font-size: 1.25rem;
}

.dashboard-perf-card-icon i.text-blue { color: #2563EB; }
.dashboard-perf-card-icon i.text-green { color: #059669; }
.dashboard-perf-card-icon i.text-orange { color: #D97706; }
.dashboard-perf-card-icon i.text-red { color: #DC2626; }

/* Chart Containers */
.dashboard-chart-container {
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  padding: 1.5rem;
}

.dashboard-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.dashboard-chart-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
}

.dashboard-chart-legend {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.dashboard-legend-item {
  display: flex;
  align-items: center;
}

.dashboard-legend-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  margin-right: 0.5rem;
}

.dashboard-legend-dot.blue { background-color: #3B82F6; }
.dashboard-legend-dot.green { background-color: #10B981; }

.dashboard-legend-text {
  font-size: 0.875rem;
  font-weight: 500;
}

.dashboard-legend-text.text-blue { color: #2563EB; }
.dashboard-legend-text.text-green { color: #059669; }

/* Chart Stats Grid */
.dashboard-chart-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.dashboard-chart-stats.stats-3 {
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.dashboard-stat-item {
  text-align: center;
  padding: 0.75rem;
  border-radius: 0.5rem;
}

.dashboard-stat-item.bg-blue { background-color: #EFF6FF; }
.dashboard-stat-item.bg-green { background-color: #ECFDF5; }
.dashboard-stat-item.bg-purple { background-color: #FAF5FF; }
.dashboard-stat-item.bg-pink { background-color: #FDF2F8; }
.dashboard-stat-item.bg-indigo { background-color: #EEF2FF; }

.dashboard-stat-number {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.dashboard-stat-number.text-blue { color: #2563EB; }
.dashboard-stat-number.text-green { color: #059669; }
.dashboard-stat-number.text-purple { color: #7C3AED; }
.dashboard-stat-number.text-pink { color: #DB2777; }
.dashboard-stat-number.text-indigo { color: #4F46E5; }
.dashboard-stat-number.text-red { color: #DC2626; }

.dashboard-stat-label {
  font-size: 0.75rem;
  color: inherit;
}



/* Surgery Stats List */
.dashboard-surgery-stats {
  margin-top: 1rem;
}

.dashboard-surgery-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.dashboard-surgery-item:last-child {
  margin-bottom: 0;
}

.dashboard-surgery-label {
  font-size: 0.875rem;
  color: #6B7280;
}

.dashboard-surgery-value {
  font-size: 1.125rem;
  font-weight: 700;
}

/* Dashboard Main Title */
.dashboard-main-title {
  font-size: 2.25rem;
  font-weight: 700;
  color: #1E3A8A;
  margin-bottom: 1rem;
}

.dashboard-main-subtitle {
  font-size: 1.25rem;
  color: #6B7280;
  margin-bottom: 0.5rem;
}

/* Responsive adjustments for dashboard */
@media (max-width: 768px) {
  .dashboard-grid-1,
  .dashboard-grid-2,
  .dashboard-grid-3,
  .dashboard-grid-4 {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .dashboard-chart-stats {
    grid-template-columns: 1fr;
  }
  
  .dashboard-chart-stats.stats-3 {
    grid-template-columns: 1fr;
  }
  
  .dashboard-chart-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .dashboard-chart-legend {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .dashboard-main-title {
    font-size: 1.875rem;
  }
  
  .dashboard-main-subtitle {
    font-size: 1.125rem;
  }
}

@media (max-width: 480px) {
  .dashboard-perf-card {
    padding: 1rem;
  }
  
  .dashboard-chart-container {
    padding: 1rem;
  }
  
  .dashboard-perf-card-number {
    font-size: 1.5rem;
  }
  
  .dashboard-stat-number {
    font-size: 1.25rem;
  }
}

/* ===== BALANCED SCORECARD DASHBOARD STYLES ===== */

/* Dashboard Main Content Override for BSC */
.main-content {
    padding: var(--spacing-md);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Dashboard Header - Enhanced */
.dashboard-header {
    text-align: center;
    margin-bottom: 2rem;
}

.dashboard-main-title {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.dashboard-main-subtitle {
    font-size: var(--font-size-md);
    color: var(--text-gray);
    margin-bottom: 1rem;
}

/* Perspective Sections */
.perspective-section {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-left: 4px solid var(--color-primary);
}

.perspective-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: white;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-md);
    padding: 1rem;
    border-left: 3px solid var(--color-secondary);
    transition: var(--transition-base);
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.metric-title {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.metric-value {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
    margin-bottom: 0.25rem;
}

.metric-benchmark {
    font-size: var(--font-size-sm);
    color: var(--text-gray);
}

/* Chart Containers */
.chart-container {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.chart-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin-bottom: 1rem;
    text-align: center;
}

/* Grid Layouts for Charts */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

/* KPI Summary Cards */
.kpi-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: white;
    padding: 1.5rem;
    border-radius: var(--border-radius-lg);
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition-base);
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.kpi-number {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    margin-bottom: 0.5rem;
}

.kpi-label {
    font-size: var(--font-size-sm);
    opacity: 0.9;
}

/* Responsive Design for Balanced Scorecard */
@media (max-width: 768px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
    
    .kpi-summary {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .perspective-section {
        padding: 1rem;
    }
    
    .chart-container {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .kpi-summary {
        grid-template-columns: 1fr;
    }
    
    .main-content {
        padding: 0.5rem;
    }
    
    .perspective-section {
        padding: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .chart-container {
        padding: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .metrics-grid {
        gap: 1rem;
        margin-bottom: 1rem;
    }
    
    .metric-card {
        padding: 0.75rem;
    }
}

/* ===== UTILITY CLASSES ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-base); }
.mb-4 { margin-bottom: var(--spacing-md); }
.mb-5 { margin-bottom: var(--spacing-lg); }

.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-base); }
.mt-4 { margin-top: var(--spacing-md); }
.mt-5 { margin-top: var(--spacing-lg); }

.p-1 { padding: var(--spacing-xs); }
.p-2 { padding: var(--spacing-sm); }
.p-3 { padding: var(--spacing-base); }
.p-4 { padding: var(--spacing-md); }
.p-5 { padding: var(--spacing-lg); }

.rounded { border-radius: var(--border-radius-sm); }
.rounded-md { border-radius: var(--border-radius-md); }
.rounded-lg { border-radius: var(--border-radius-lg); }

.shadow { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.bg-white { background-color: var(--color-white); }
.bg-primary { background-color: var(--color-primary); }
.bg-secondary { background-color: var(--color-secondary); }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-white { color: var(--text-white); }
.text-gray { color: var(--text-gray); }

.font-normal { font-weight: var(--font-weight-normal); }
.font-medium { font-weight: var(--font-weight-medium); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-bold { font-weight: var(--font-weight-bold); }

.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-base { font-size: var(--font-size-base); }
.text-md { font-size: var(--font-size-md); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.text-2xl { font-size: var(--font-size-2xl); }
.text-3xl { font-size: var(--font-size-3xl); }

/* ===== SPACING FIXES - Thêm vào cuối style.css ===== */

/* Dashboard Container Spacing */
.homepage-container {
  padding: 2rem 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* Text Center Utility */
.text-center {
  text-align: center;
}

/* Dashboard Header Spacing */
.dashboard-header {
  text-align: center;
  margin-bottom: 3rem;
}

.dashboard-main-title {
  margin-bottom: 1rem;
}

.dashboard-main-subtitle {
  margin-bottom: 2rem;
}

/* Grid Spacing Enhancements */
.dashboard-grid-1,
.dashboard-grid-2,
.dashboard-grid-3,
.dashboard-grid-4 {
  margin-bottom: 3rem;
}

.dashboard-grid-1:last-child,
.dashboard-grid-2:last-child,
.dashboard-grid-3:last-child,
.dashboard-grid-4:last-child {
  margin-bottom: 0;
}

/* Chart Container Internal Spacing */
.dashboard-chart-container {
  margin-bottom: 0; /* Reset margin since grid handles spacing */
}

.dashboard-chart-title {
  margin-bottom: 1.5rem;
}

.dashboard-chart-header {
  margin-bottom: 1.5rem;
}

/* Performance Card Enhancements */
.dashboard-perf-card {
  margin-bottom: 0; /* Reset margin since grid handles spacing */
  min-height: 140px;
  display: flex;
  align-items: center;
}

.dashboard-perf-card-info {
  flex: 1;
}

.dashboard-perf-card-label {
  margin-bottom: 0.5rem;
}

.dashboard-perf-card-number {
  margin-bottom: 0.5rem;
  line-height: 1;
}

.dashboard-perf-card-trend {
  margin-top: 0.25rem;
}

/* Chart Stats Spacing */
.dashboard-chart-stats {
  margin-top: 1.5rem;
}

.dashboard-stat-item {
  padding: 1rem;
}

.dashboard-stat-number {
  margin-bottom: 0.5rem;
  line-height: 1;
}

.dashboard-stat-label {
  margin: 0;
  line-height: 1.2;
}

/* Surgery Stats Spacing */
.dashboard-surgery-stats {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

.dashboard-surgery-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid #f3f4f6;
}

.dashboard-surgery-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

/* Utility Classes for Manual Spacing Control */
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 0.75rem !important; }
.mb-4 { margin-bottom: 1rem !important; }
.mb-5 { margin-bottom: 1.25rem !important; }
.mb-6 { margin-bottom: 1.5rem !important; }
.mb-8 { margin-bottom: 2rem !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 0.75rem !important; }
.mt-4 { margin-top: 1rem !important; }
.mt-5 { margin-top: 1.25rem !important; }
.mt-6 { margin-top: 1.5rem !important; }
.mt-8 { margin-top: 2rem !important; }

.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }

.px-1 { padding-left: 0.25rem; padding-right: 0.25rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }

/* Responsive Spacing Adjustments */
@media (max-width: 768px) {
  .homepage-container {
    padding: 1.5rem 1rem;
  }
  
  .dashboard-header {
    margin-bottom: 2rem;
  }
  
  .dashboard-grid-1,
  .dashboard-grid-2,
  .dashboard-grid-3,
  .dashboard-grid-4 {
    margin-bottom: 2rem;
    gap: 1rem;
  }
  
  .dashboard-chart-stats {
    margin-top: 1rem;
  }
  
  .dashboard-stat-item {
    padding: 0.75rem;
  }
  
  .dashboard-perf-card {
    min-height: 120px;
  }
}

@media (max-width: 480px) {
  .homepage-container {
    padding: 1rem 0.75rem;
  }
  
  .dashboard-header {
    margin-bottom: 1.5rem;
  }
  
  .dashboard-grid-1,
  .dashboard-grid-2,
  .dashboard-grid-3,
  .dashboard-grid-4 {
    margin-bottom: 1.5rem;
    gap: 0.75rem;
  }
  
  .dashboard-perf-card {
    min-height: 100px;
    padding: 1rem;
  }
  
  .dashboard-chart-container {
    padding: 1rem;
  }
}

/* ===== FOOTER STYLES ===== */
footer {
    background: linear-gradient(135deg, var(--color-primary) 0%, #1A237E 100%);
    color: var(--color-white);
    margin-top: var(--spacing-3xl);
    border-top: 3px solid var(--color-secondary);
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
}

footer .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-lg) var(--spacing-md);
    text-align: center;
    position: relative;
    z-index: 1;
}

footer p {
    margin: 0;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    opacity: 0.9;
    line-height: 1.6;
}

/* Responsive adjustments for footer */
@media (max-width: 768px) {
    footer .container {
        padding: var(--spacing-md) var(--spacing-sm);
    }
    
    footer p {
        font-size: var(--font-size-sm);
    }
}

/* ===== WORKFLOW BULLETIN BOARD STYLES ===== */
.workflow-bulletin-board {
    margin: 20px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.bulletin-header {
    background: var(--color-table-header-gradient);
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--color-secondary);
}

.bulletin-title h2 {
    color: var(--text-white);
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bulletin-title i {
    font-size: 1.3rem;
}

.bulletin-controls {
    display: flex;
    gap: 10px;
}

.btn-refresh, .btn-auto-refresh {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: var(--text-white);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-refresh:hover, .btn-auto-refresh:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.btn-auto-refresh.active {
    background: rgba(76, 175, 80, 0.8);
    border-color: rgba(76, 175, 80, 1);
}

.bulletin-status {
    background: #f8f9fa;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e9ecef;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

.status-dot.loading {
    background: #ffc107;
}

.status-dot.success {
    background: #28a745;
}

.status-dot.error {
    background: #dc3545;
}

.status-text {
    font-size: 0.9rem;
    color: var(--text-gray);
    font-weight: 500;
}

.last-updated {
    font-size: 0.85rem;
    color: var(--text-gray);
    font-style: italic;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.bulletin-table-container {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 600px;
    max-width: 100%;
    white-space: nowrap;
    /* Improve scrollbar styling */
}

.bulletin-table-container::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

.bulletin-table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.bulletin-table-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.bulletin-table-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.workflow-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 0.85rem;
    table-layout: auto;
}

.workflow-table thead {
    background: var(--color-table-header-gradient);
    position: sticky;
    top: 0;
    z-index: 10;
}

.workflow-table th {
    color: var(--text-white);
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    white-space: nowrap;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.workflow-table th:last-child {
    border-right: none;
}

.workflow-table tbody tr {
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s ease;
}

.workflow-table tbody tr:hover {
    background-color: #f5f5f5;
}

.workflow-table tbody tr:nth-child(even) {
    background-color: #fdfdfd;
}

.workflow-table tbody tr:nth-child(even):hover {
    background-color: #f0f0f0;
}

.workflow-table td {
    padding: 10px 8px;
    border-right: 1px solid #e9ecef;
    vertical-align: middle;
    white-space: nowrap;
    overflow: visible;
}

.workflow-table td:last-child {
    border-right: none;
}

/* Column specific styles */
.col-no {
    width: 60px;
    text-align: center;
    font-weight: 600;
    color: var(--color-secondary);
}

.col-setup-step, .col-latest-step, .col-process-step {
    min-width: 120px;
    max-width: 150px;
}

.col-setup-duration, .col-process-duration {
    width: 100px;
    text-align: center;
}

.col-correction {
    min-width: 100px;
    max-width: 120px;
}

.col-est-start, .col-est-end, .col-process-end {
    width: 140px;
    font-family: monospace;
    font-size: 0.8rem;
}

.col-status {
    width: 120px;
    text-align: center;
}

/* New columns for Account and Balance Account */
.col-account-no {
    width: 100px;
    min-width: 100px;
    text-align: center;
    font-family: monospace;
    font-size: 0.85rem;
}

.col-account-name {
    width: 100px;
    min-width: 100px;
    text-align: center;
    font-family: monospace;
    font-size: 0.85rem;
}

.col-table-name {
    width: 120px;
    min-width: 120px;
}

.col-source-code {
    width: 80px;
    min-width: 80px;
    text-align: center;
}

.col-login-id {
    width: 100px;
    min-width: 100px;
    text-align: center;
}

.col-module-type-description {
    width: 120px;
    min-width: 120px;
}

.col-bal-account-no {
    width: 100px;
    min-width: 100px;
    text-align: center;
    font-family: monospace;
    font-size: 0.85rem;
}

.col-bal-account-name {
    width: 140px;
    min-width: 140px;
}

.col-progress {
    width: 80px;
    min-width: 80px;
    text-align: center;
    font-weight: 600;
}

.col-name {
    width: 160px;
    min-width: 160px;
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.status-done {
    background: linear-gradient(135deg, #4caf50, #43a047);
    color: white;
    box-shadow: 0 2px 4px rgba(76, 175, 80, 0.3);
}

.status-late {
    background: linear-gradient(135deg, #f44336, #e53935);
    color: white;
    box-shadow: 0 2px 4px rgba(244, 67, 54, 0.3);
    animation: pulse-late 2s infinite;
}

.status-progress {
    background: linear-gradient(135deg, #2196f3, #1976d2);
    color: white;
    box-shadow: 0 2px 4px rgba(33, 150, 243, 0.3);
}

@keyframes pulse-late {
    0% { box-shadow: 0 2px 4px rgba(244, 67, 54, 0.3); }
    50% { box-shadow: 0 4px 8px rgba(244, 67, 54, 0.6); }
    100% { box-shadow: 0 2px 4px rgba(244, 67, 54, 0.3); }
}

.no-data {
    background: #f8f9fa !important;
}

.no-data td {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-gray);
}

.no-data i {
    font-size: 2rem;
    color: #dee2e6;
    margin-bottom: 10px;
    display: block;
}

.bulletin-pagination {
    background: #f8f9fa;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #e9ecef;
}

.pagination-info {
    font-size: 0.9rem;
    color: var(--text-gray);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-page {
    background: var(--color-white);
    border: 1px solid #dee2e6;
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-page:not(:disabled):hover {
    background: var(--color-secondary);
    color: var(--text-white);
    border-color: var(--color-secondary);
}

.btn-page:disabled {
    background: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.page-info {
    font-size: 0.85rem;
    color: var(--text-gray);
    font-weight: 500;
}

.page-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-gray);
}

.page-input {
    width: 60px;
    padding: 6px 8px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    text-align: center;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.page-input:focus {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

.page-input::-webkit-inner-spin-button,
.page-input::-webkit-outer-spin-button {
    opacity: 1;
}

/* Group header styles */
.group-header-row {
    background: #f8f9fa;
}

.group-header {
    background: linear-gradient(to right, #f8f9fa, #ffffff);
    font-weight: 600;
    cursor: pointer;
    padding: 12px 16px !important;
    border-bottom: 2px solid #dee2e6;
    user-select: none;
    transition: background-color 0.2s ease;
    text-align: left !important;
}

.group-header:hover {
    background: linear-gradient(to right, #e9ecef, #f8f9fa);
}

.group-toggle {
    display: inline-block;
    margin-right: 8px;
    transition: transform 0.3s ease;
    color: #6c757d;
}

.group-item-row {
    transition: all 0.2s ease;
}

.group-item-row:hover {
    background-color: #f8f9fa;
}

/* Responsive design for workflow bulletin board */
@media (max-width: 1200px) {
    .workflow-table {
        font-size: 0.8rem;
    }
    
    .workflow-table th,
    .workflow-table td {
        padding: 8px 6px;
    }
    
    .col-setup-step, .col-latest-step, .col-process-step {
        max-width: 120px;
    }
    
    /* Ensure horizontal scroll on smaller screens */
    .bulletin-table-container {
        max-height: 500px;
    }
}

@media (max-width: 768px) {
    .workflow-bulletin-board {
        margin: 10px 5px;
        border-radius: 8px;
    }
    
    .bulletin-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
        padding: 16px 20px;
    }
    
    /* Force horizontal scroll on mobile */
    .bulletin-table-container {
        max-height: 400px;
        overflow-x: scroll !important;
    }
    
    .workflow-table {
        min-width: 1400px; /* Force minimum width to ensure scroll */
    }
    
    .bulletin-title h2 {
        font-size: 1.2rem;
    }
    
    .bulletin-status {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
        padding: 12px 16px;
    }
    
    .status-text {
        font-size: 0.8rem;
    }
    
    .last-updated {
        font-size: 0.75rem;
    }
    
    .bulletin-pagination {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }
    
    .workflow-table {
        font-size: 0.7rem;
    }
    
    .workflow-table th,
    .workflow-table td {
        padding: 6px 4px;
        font-size: 0.7rem;
    }
    
    .status-badge {
        font-size: 0.6rem !important;
        padding: 2px 4px !important;
    }
}

@media (max-width: 480px) {
    .bulletin-table-container {
        max-height: 400px;
    }
    
    .workflow-table th,
    .workflow-table td {
        font-size: 0.65rem;
        padding: 4px 3px;
    }
    
    .col-setup-step, .col-latest-step, .col-process-step {
        max-width: 80px;
    }
    
    .col-est-start, .col-est-end, .col-process-end {
        width: 100px;
        font-size: 0.6rem;
    }
    
    .col-status {
        width: 100px;
    }
    
    .status-badge {
        font-size: 0.55rem !important;
        padding: 1px 3px !important;
    }
}

/* ===== WORKFLOW FILTER CONTROLS ===== */
.bulletin-controls {
    margin-bottom: 0px;
    max-width: 700px;
}

.filter-controls {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 20px; 
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.filter-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 150px;
}

.filter-group label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.filter-select,
.filter-input {
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
    transition: all 0.3s ease;
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

.filter-actions {
    display: flex;
    gap: 10px;
    align-items: end;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-secondary), var(--color-accent));
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1565C0, #1976D2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #5a6268, #343a40);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

/* ===== GROUPED DATA STYLING ===== */
.group-header {
    background: linear-gradient(135deg, #667eea 0%, #0011a9 100%);
    color: white;
}

.group-header:hover {
    background: linear-gradient(135deg, #667eea 0%, #0011a9 100%);
    transform: none;
    box-shadow: none;
}

.group-header td {
    padding: 12px 15px;
    font-weight: 600;
    font-size: 0.9rem;
}

.group-title-content {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 24px;
}

.group-count {
    font-weight: 400;
    opacity: 0.9;
    margin-left: auto;
    font-size: 0.85rem;
}

.grouped-row {
    background-color: #f8f9fa;
}

.grouped-row:nth-child(even) {
    background-color: #ffffff;
}

.grouped-row:hover {
    background-color: #e3f2fd;
}




/* ===== WORKFLOW TABLE STYLING ===== */
.workflow-table {
    font-size: 0.75rem; /* Reduced font size */
    line-height: 1.2;
    table-layout: fixed;
    width: 100%;
}

.workflow-table th {
    font-size: 1rem;
    font-weight: 600;
    padding: 8px 6px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.workflow-table td {
    font-size: 1rem;
    padding: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Specific columns that should show full text when resized */
.col-name, .col-table-name, .col-login-id, .col-module-type-description, .col-est-start, .col-est-end, .col-latest-step, .col-process-step, .col-setup-step, .col-setup-duration {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: initial !important;
    word-wrap: break-word;
    word-break: break-word;
}

.workflow-table th {
    overflow: hidden;
    position: relative;
}

.workflow-table td {
    font-size: 1rem;
    padding: 6px 4px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

/* Column specific widths */
.col-no { width: 200px; }
.col-name { width: 120px; }
.col-account-name { width: 120px; }
.col-table-name { width: 120px; }
.col-source-code { width: 80px; }
.col-login-id { width: 80px; }
.col-module-type-description { width: 100px; }
.col-setup-step { width: 100px; text-align: center; }
.col-setup-duration { width: 100px; }
.col-latest-step { width: 100px; text-align: center; }
.col-process-step { width: 100px; text-align: center; }
.col-progress { width: 80px; text-align: center; font-weight: 600; color: var(--color-secondary); }
.col-est-start { width: 180px; }
.col-est-end { width: 180px; }
.col-status { width: 150px; }

/* Status badges - smaller */
.status-badge {
    font-size: 1rem !important;
    padding: 2px 4px !important;
    border-radius: 3px;
    white-space: nowrap;
}

.status-badge i {
    font-size: 1rem;
    margin-right: 2px;
}

/* Column resizer */
.column-resizer:hover {
    background-color: var(--color-secondary);
    opacity: 0.3;
}

/* ===== RESPONSIVE DESIGN FOR FILTERS ===== */
@media (max-width: 768px) {
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        min-width: 100%;
    }
    
    .filter-actions {
        justify-content: center;
        margin-top: 15px;
    }
    
    .btn {
        flex: 1;
        justify-content: center;
    }
    
    /* Make table scroll horizontally on mobile */
    .bulletin-table-container {
        overflow-x: auto;
    }
    
    .workflow-table {
        min-width: 1200px; /* Ensure minimum width for all columns */
        font-size: 0.7rem;
    }
    
    .workflow-table th,
    .workflow-table td {
        font-size: 0.7rem;
        padding: 5px 3px;
    }
    
    .group-header td {
        font-size: 0.8rem;
        padding: 10px 8px;
    }
    
    .group-title-content {
        font-size: 0.8rem;
    }
    
    .group-count {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .filter-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .workflow-table {
        font-size: 0.6rem;
    }
    
    .workflow-table th,
    .workflow-table td {
        font-size: 0.6rem;
        padding: 3px 2px;
    }
    
    .status-badge {
        font-size: 0.55rem !important;
        padding: 1px 3px !important;
    }
    
    .status-badge i {
        font-size: 0.55rem;
    }
    
    .pagination-info,
    .page-info {
        font-size: 0.8rem;
    }
    
    .bulletin-pagination {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

/* ===== MOBILE FILTER MODAL STYLES ===== */
.mobile-filter-btn {
    display: none;
    background: linear-gradient(135deg, var(--color-secondary), var(--color-accent));
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.3);
}

.mobile-filter-btn:hover {
    background: linear-gradient(135deg, #1565C0, #1976D2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.4);
}

.mobile-filter-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: var(--color-table-header-gradient);
    color: white;
    padding: 16px 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.close-modal-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.close-modal-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 20px;
}

.modal-body .filter-group {
    margin-bottom: 16px;
    min-width: auto;
}

.modal-body .filter-group label {
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: var(--text-primary);
    font-weight: 600;
}

.modal-body .filter-select,
.modal-body .filter-input {
    width: 100%;
    padding: 10px 12px;
    font-size: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    background: white;
    transition: all 0.3s ease;
}

.modal-body .filter-select:focus,
.modal-body .filter-input:focus {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 12px;
}

.modal-footer .btn {
    flex: 1;
    justify-content: center;
    padding: 12px 16px;
    font-size: 1rem;
}

/* ===== RESPONSIVE DESIGN FOR MOBILE FILTERS ===== */
@media (max-width: 768px) {
    .bulletin-controls .desktop-filters {
        display: none;
    }
    
    .mobile-filter-btn {
        display: flex;
        align-items: center;
        gap: 8px;
        width: 100%;
        justify-content: center;
    }
    
    .bulletin-header {
        padding: 16px 20px;
    }
    
    .bulletin-title h2 {
        font-size: 1.2rem;
    }
    
    /* Improve mobile table display */
    .workflow-bulletin-board {
        margin: 10px 5px;
        border-radius: 8px;
    }
    
    .bulletin-status {
        padding: 12px 16px;
        font-size: 0.85rem;
    }
    
    .status-text {
        font-size: 0.8rem;
    }
    
    .last-updated {
        font-size: 0.75rem;
    }
    
    .bulletin-table-container {
        max-height: 500px;
    }
    
    .workflow-table th {
        font-size: 0.7rem;
        padding: 6px 4px;
    }
    
    .workflow-table td {
        font-size: 0.7rem;
        padding: 6px 4px;
    }
    
    .status-badge {
        font-size: 0.6rem !important;
        padding: 2px 4px !important;
    }
}

@media (max-width: 480px) {
    .workflow-bulletin-board {
        margin: 5px;
    }
    
    .bulletin-header {
        padding: 12px 15px;
    }
    
    .bulletin-title h2 {
        font-size: 1rem;
    }
    
    .bulletin-status {
        padding: 10px 15px;
    }
    
    .workflow-table th {
        font-size: 0.65rem;
        padding: 5px 3px;
    }
    
    .workflow-table td {
        font-size: 0.65rem;
        padding: 5px 3px;
    }
    
    .status-badge {
        font-size: 0.55rem !important;
        padding: 1px 3px !important;
    }
    
    .bulletin-pagination {
        padding: 10px 15px;
    }
    
    .pagination-controls .btn-page {
        font-size: 0.75rem;
        padding: 6px 10px;
    }
}

@media (min-width: 769px) {
    .mobile-filter-btn {
        display: none !important;
    }
    
    .desktop-filters {
        display: flex !important;
    }
}

/* ===== inboxer DETAIL PAGE STYLES ===== */
/* Layout cho trang inboxer detail với sidebar thông tin */
.inboxer-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background-color: var(--text-light-gray);
}

.inboxer-container {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* === inboxer DETAIL CONTAINER (Main inboxer Area) === */
.inboxer-detail-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    transition: all 0.3s ease;
    padding-top: 0 !important;
    overflow: hidden;
}

.inboxer-detail-container.active {
    flex: 1;
}

.inboxer-detail-container.with-info {
    flex: 1;
}

/* Header của inboxer detail - Reference style */
.inboxer-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px 8px;
    background-color: #f5faff;
    position: sticky;
    top: 0;
    z-index: 10;
}

.inboxer-detail-header .left {
    display: flex;
    align-items: center;
    flex: 1;
}

.inboxer-detail-header .left-back {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    margin-right: 12px;
    cursor: pointer;
}

.inboxer-detail-header .left-back svg {
    width: 20px;
    height: 20px;
    color: #344054;
}

.inboxer-detail-header .left-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 10px;
    overflow: hidden;
}

.inboxer-detail-header .left-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.inboxer-detail-header .left .left-info {
    display: flex;
    flex-direction: column;
}

.inboxer-detail-header .left .left-info-name {
    color: #344054;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    margin: 0;
}

.inboxer-detail-header .left .left-info-group {
    color: #667085;
    font-size: 12px;
    font-weight: 400;
    line-height: 18px;
    margin: 0;
}

.inboxer-detail-header .right {
    display: flex;
    align-items: center;
}

.inboxer-detail-header .right .right-icon {
    cursor: pointer;
    margin-right: 8px;
}

.inboxer-detail-header .right .right-icon svg {
    width: 20px;
    height: 20px;
    color: #667085;
}

/* Content area của inboxer */
.inboxer-detail-content {
    margin-top: 8px;
    flex: 1;
    overflow-y: auto;
    background: white;
}

.inboxer-detail-content-list {
    padding: 16px 24px 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Message items - Structure cho cuộc trò chuyện 2 người */
.inboxer-detail-content-list .item {
    display: flex;
    gap: 12px;
    animation: fadeIn 0.3s ease;
    max-width: 100%;
}

.inboxer-detail-content-list .item:last-child {
    margin-bottom: 60px;
}

/* Tin nhắn của mình - item--me */
.inboxer-detail-content-list .item.item--me {
    flex-direction: row-reverse;
    justify-content: flex-start;
}

.inboxer-detail-content-list .item.item--me .item-avatar {
    display: none;
}

.inboxer-detail-content-list .item.item--me .item-content {
    max-width: 70%;
    align-self: flex-end;
}

.inboxer-detail-content-list .item.item--me .item-content .info {
    justify-content: flex-end;
}

.inboxer-detail-content-list .item.item--me .item-content .info-name {
    display: none !important;
}

.inboxer-detail-content-list .item.item--me .item-content .messages-item {
    background-color: #0d3aff !important;
    border-radius: 8px 8px 0px 8px !important;
    margin-left: auto;
}

.inboxer-detail-content-list .item.item--me .item-content .messages-item p {
    color: #ffffff !important;
}

/* Tin nhắn của người khác */
.inboxer-detail-content-list .item:not(.item--me) .item-content {
    max-width: 30%;
}

.inboxer-detail-content-list .item:not(.item--me) .item-content .messages-item {
    border-radius: 0px 8px 8px 8px;
}

/* Avatar cho tin nhắn */
.inboxer-detail-content-list .item .item-avatar {
    width: 40px;
    height: 40px;
    position: relative;
}

.inboxer-detail-content-list .item .item-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* Content của tin nhắn */
.inboxer-detail-content-list .item .item-content {
    flex: 1;
}

.inboxer-detail-content-list .item .item-content .info {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    gap: 8px;
}

.inboxer-detail-content-list .item .item-content .info-name {
    color: #344054;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    flex: 1;
}

.inboxer-detail-content-list .item .item-content .info-time {
    color: #667085;
    font-size: 12px;
    font-weight: 400;
    line-height: 18px;
}

/* Container cho multiple messages từ cùng user */
.inboxer-detail-content-list .item .item-content .messages {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Individual message bubble */
.inboxer-detail-content-list .item .item-content .messages-item {
    display: flex;
    padding: 10px 14px;
    gap: 8px;
    border-radius: 0px 8px 8px 8px;
    box-shadow: 0px 1px 3px 0px rgba(16, 24, 40, 0.1), 0px 1px 2px 0px rgba(16, 24, 40, 0.06);
}

/* Text messages */
.inboxer-detail-content-list .item .item-content .messages .messages-item--text {
    background: #f2f4f7;
}

.inboxer-detail-content-list .item .item-content .messages .messages-item--text p {
    color: #101828;
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    margin: 0;
}

/* File messages */
.inboxer-detail-content-list .item .item-content .messages .messages-item--file {
    border: 1px solid #eaecf0;
    gap: 12px;
    cursor: pointer;
    background: white;
}

.inboxer-detail-content-list .item .item-content .messages .messages-item--file .file-icon {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 100rem;
    background: #e8f5ff;
}

.inboxer-detail-content-list .item .item-content .messages .messages-item--file .file-icon::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 28px;
    height: 28px;
    background: #d5ebff;
    border-radius: 100rem;
    z-index: 0;
}

.inboxer-detail-content-list .item .item-content .messages .messages-item--file .file-icon svg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    z-index: 1;
}

.inboxer-detail-content-list .item .item-content .messages .messages-item--file .file-info {
    display: flex;
    flex-direction: column;
}

.inboxer-detail-content-list .item .item-content .messages .messages-item--file .file-info .file-name {
    color: #344054;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    margin: 0;
}

.inboxer-detail-content-list .item .item-content .messages .messages-item--file .file-info .file-size {
    color: #667085;
    font-size: 12px;
    font-weight: 400;
    line-height: 18px;
    margin: 0;
}

.inboxer-detail-content-list .item .item-content .messages .messages-item--file .file-info .file-status {
    color: var(--color-secondary);
    font-size: 12px;
    font-weight: 500;
    line-height: 18px;
    margin-top: 2px;
}

/* Typing indicator */
.inboxer-detail-content-list .item .item-content .messages .messages-item--typing {
    width: max-content;
    padding: 10px;
    background-color: #f2f4f7 !important;
}

.inboxer-detail-content-list .item .item-content .messages .messages-item--typing img {
    width: 20px;
}

/* Image messages */
.inboxer-detail-content-list .item .item-content .messages .messages-item--image {
    max-width: 240px;
    border-radius: 8px !important;
    overflow: hidden;
    width: fit-content;
    padding: 0;
    position: relative;
    background: transparent;
}

.inboxer-detail-content-list .item.item--me .item-content .messages .messages-item--image {
    margin-left: auto;
    border-radius: 8px 8px 0px 8px !important;
}

.inboxer-detail-content-list .item:not(.item--me) .item-content .messages .messages-item--image {
    border-radius: 0px 8px 8px 8px !important;
}

.inboxer-detail-content-list .item .item-content .messages .messages-item--image img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
    cursor: pointer;
    transition: transform 0.2s ease;
    border-radius: 0px 8px 8px 8px;
}

.item--me .inboxer-detail-content-list .item .item-content .messages .messages-item--image img {
    border-radius: 8px 0px 8px 8px;
}

.inboxer-detail-content-list .item .item-content .messages .messages-item--image img:hover {
    transform: scale(1.02);
}

.inboxer-detail-content-list .item .item-content .messages .messages-item--image img.loading-image {
    min-height: 100px;
    background-color: #f2f4f7;
}

.inboxer-detail-content-list .item .item-content .messages .messages-item--image .image-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--color-secondary);
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 4px;
}

/* Spacing cho multiple images */
.inboxer-detail-content-list .item .item-content .messages .messages-item--image + .messages-item--image {
    margin-top: 4px;
}

/* Footer input area - Reference style */
.inboxer-detail-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    margin-top: 8px;
    border-top: 1px solid #eaecf0;
    padding-bottom: 16px;
    background: white;
    position: sticky;
    bottom: 0;
    z-index: 10;
}

.inboxer-detail-footer-input {
    flex: 1;
    display: flex;
    padding: 10px 14px;
    align-items: center;
    gap: 8px;
    border-radius: 100px;
    border: 1px solid #d0d5dd;
    background: #ffffff;
    box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);
    position: relative;
}

.inboxer-detail-footer-input svg {
    width: 20px;
    height: 20px;
    cursor: pointer;
    color: #667085;
}

.inboxer-detail-footer-input input[type="text"] {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    color: #667085;
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    width: calc(100% - 28px);
}

.inboxer-detail-footer-input input[type="text"]::placeholder {
    color: #667085;
}

.inboxer-detail-footer-send {
    width: 44px;
    height: 44px;
    border-radius: 100rem;
    background-color: #3068ff;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: 12px;
    cursor: pointer;
    flex-shrink: 0;
    border: none;
    outline: none;
    transition: all 0.2s ease;
}

.inboxer-detail-footer-send:hover {
    background-color: #2556e6;
    transform: scale(1.05);
}

.inboxer-detail-footer-send:active {
    transform: scale(0.95);
}

.inboxer-detail-footer-send svg {
    width: 20px;
    height: 20px;
    color: white;
}

/* Dropdown for attachments - Reference style */
#input-dropdown {
    position: absolute;
    bottom: calc(100% + 10px);
    left: -12px;
    z-index: 10;
    border-radius: 32px;
    box-shadow: 0px 1px 3px 0px rgba(16, 24, 40, 0.1), 0px 1px 2px 0px rgba(16, 24, 40, 0.06);
}

#input-dropdown.hide {
    display: none;
}

#input-dropdown .input-dropdown-content {
    padding: 32px 20px;
    min-width: 200px;
    background-color: #ffffff;
    border-radius: 32px;
}

#input-dropdown .triangle-container::before {
    content: "";
    position: absolute;
    top: calc(100% - 22px);
    left: 16px;
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 40px solid white;
    z-index: -1;
}

#input-dropdown .triangle-container::after {
    content: "";
    position: absolute;
    top: calc(100% - 22px);
    left: 16px;
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 40px solid rgba(0, 0, 0, 0.2);
    z-index: -2;
    filter: blur(4px);
    transform: translateY(4px);
}

#input-dropdown .input-dropdown-item {
    display: flex;
    align-items: center;
    width: 100%;
    border-bottom: 1px solid #eaecf0;
    padding: 10px 0;
    cursor: pointer;
    gap: 8px;
}

#input-dropdown .input-dropdown-item:first-child {
    padding-top: 0;
}

#input-dropdown .input-dropdown-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

#input-dropdown .input-dropdown-item:last-child svg {
    width: 24px;
    height: 24px;
}

#input-dropdown .input-dropdown-item .input-dropdown-item-text {
    color: #1d2939;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    flex: 1;
}

#input-dropdown .input-dropdown-item svg {
    width: 28px;
    height: 28px;
    object-fit: cover;
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === inboxer INFO SIDEBAR === */
.inboxer-info-container {
    width: 0;
    background: white;
    border-left: 1px solid #eaecf0;
    transition: all 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.inboxer-info-container.active {
    width: 350px;
    display: flex;
}

.inboxer-info-header {
    padding: 16px;
    border-bottom: 1px solid #eaecf0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.inboxer-info-header .left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.inboxer-info-header .back-to-inboxer {
    cursor: pointer;
    width: 24px;
    height: 24px;
}

.inboxer-info-header .title {
    font-size: 16px;
    font-weight: 600;
    color: #101828;
}

.inboxer-info-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.inboxer-info-content .inboxer-info-basic {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.inboxer-info-content .inboxer-info-basic .avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
}

.inboxer-info-content .inboxer-info-basic .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.inboxer-info-content .inboxer-info-basic .info .name {
    font-size: 18px;
    font-weight: 600;
    color: #101828;
    margin: 0;
}

.inboxer-info-content .inboxer-info-basic .info .department {
    font-size: 14px;
    color: #667085;
    margin-top: 4px;
}

.inboxer-info-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-section {
    margin-bottom: 20px;
}

.info-section.hide {
    display: none;
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: #344054;
    margin-bottom: 8px;
}

.section-content {
    background: #f9fafb;
    border-radius: 8px;
    padding: 12px;
}

.section-content .id {
    font-size: 12px;
    font-weight: 600;
    color: #475467;
    margin: 0;
}

.section-content .name {
    font-size: 14px;
    color: #101828;
    margin-top: 4px;
}

.members-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f9fafb;
    border-radius: 8px;
    padding: 12px;
}

.members-list .member-item {
    background: white;
    border-radius: 6px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid #eaecf0;
}

.member-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
}

.member-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.member-info {
    flex: 1;
}

.member-name {
    color: #101828;
    font-size: 14px;
    line-height: 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

.member-role {
    font-size: var(--font-size-xs);
    color: #667085;
    margin: 0;
}

.no-members {
    color: #667085;
    font-size: 14px;
    text-align: center;
    padding: 16px;
    font-style: italic;
}

.assignment-info,
.project-info,
.task-info {
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
}

.assignment-info .id,
.project-info .id,
.task-info .id {
    font-size: 12px;
    color: #475467;
    margin-bottom: 4px;
    font-weight: 600;
}

.assignment-info .name,
.project-info .name,
.task-info .name {
    font-size: 14px;
    font-weight: 500;
    color: #101828;
    margin: 0;
}

/* Status indicators */
.status {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #fff;
}

.status.is-online {
    background-color: #12b76a;
}

.status.is-offline {
    background-color: #d0d5dd;
}

/* Image modal */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
}

.image-modal.show {
    display: flex;
}

.image-modal img {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
}

/* Scroll container styling */
.scroll-container {
    scrollbar-width: thin;
    scrollbar-color: #eaecf0 transparent;
}

.scroll-container::-webkit-scrollbar {
    width: 8px;
}

.scroll-container::-webkit-scrollbar-track {
    background: transparent;
}

.scroll-container::-webkit-scrollbar-thumb {
    background-color: #eaecf0;
    border-radius: 10px;
}

.scroll-container::-webkit-scrollbar-thumb:hover {
    background-color: #d0d5dd;
}

/* Icon styling */
.icon--gray {
    color: #667085;
}

.icon--white {
    color: white;
}

/* === RESPONSIVE DESIGN FOR inboxer DETAIL - Reference style === */
@media (max-width: 768px) {
    .inboxer-container {
        flex-direction: column;
    }
    
    .inboxer-info-container {
        position: fixed;
        top: 52px;
        right: 0;
        bottom: 0;
        width: 0;
        z-index: 20;
        border-left: none;
        border-top: 1px solid #eaecf0;
    }
    
    .inboxer-info-container.active {
        width: 100%;
    }
    
    .inboxer-detail-container {
        width: 100%;
    }
    
    .inboxer-detail-header {
        padding: 10px 16px 6px;
    }
    
    .inboxer-detail-header .left-avatar {
        width: 28px;
        height: 28px;
        margin-right: 8px;
    }
    
    .inboxer-detail-header .left .left-info-name {
        font-size: 13px;
    }
    
    .inboxer-detail-header .left .left-info-group {
        font-size: 11px;
    }
    
    .inboxer-detail-content-list {
        padding: 12px 16px 0;
        gap: 12px;
    }
    
    .inboxer-detail-content-list .item .item-avatar {
        width: 36px;
        height: 36px;
    }
    
    .inboxer-detail-content-list .item .item-content .messages-item {
        font-size: 15px;
        padding: 8px 12px;
    }
    
    .inboxer-detail-content-list .item .item-content .messages .messages-item--image {
        max-width: 200px;
    }
    
    .inboxer-detail-footer {
        padding: 12px 16px;
    }
    
    .inboxer-detail-footer-input {
        padding: 8px 12px;
    }
    
    .inboxer-detail-footer-input input[type="text"] {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .inboxer-detail-footer-send {
        width: 40px;
        height: 40px;
        margin-left: 8px;
    }
    
    .inboxer-detail-footer-send svg {
        width: 18px;
        height: 18px;
    }
    
    .inboxer-info-content {
        padding: 12px;
    }
    
    .inboxer-info-content .inboxer-info-basic .avatar {
        width: 56px;
        height: 56px;
    }
}

@media (max-width: 480px) {
    .inboxer-detail-header {
        padding: 8px 12px 6px;
    }
    
    .inboxer-detail-header .left .left-info-name {
        font-size: 12px;
    }
    
    .inboxer-detail-header .left .left-info-group {
        font-size: 10px;
    }
    
    .inboxer-detail-content-list {
        padding: 8px 12px 0;
        gap: 10px;
    }
    
    .inboxer-detail-content-list .item .item-avatar {
        width: 32px;
        height: 32px;
    }
    
    .inboxer-detail-content-list .item .item-content .messages-item {
        font-size: 14px;
        padding: 6px 10px;
    }
    
    .inboxer-detail-content-list .item .item-content .messages .messages-item--text p {
        font-size: 14px;
    }
    
    .inboxer-detail-content-list .item .item-content .messages .messages-item--image {
        max-width: 180px;
    }
    
    .inboxer-detail-footer {
        padding: 8px 12px;
    }
    
    .inboxer-detail-footer-input {
        padding: 6px 10px;
    }
    
    .inboxer-detail-footer-input svg {
        width: 18px;
        height: 18px;
    }
    
    .inboxer-detail-footer-send {
        width: 36px;
        height: 36px;
        margin-left: 6px;
    }
    
    .inboxer-detail-footer-send svg {
        width: 16px;
        height: 16px;
    }
}

/* ===== NESTED MENU SECTIONS STYLES ===== */
/* Nested sections styling */
.menu-section.nested-section {
    border-left: 2px solid #e9ecef;
    border-radius: 8px;
    margin: 4px 0;
    background: #fafbfc;
    box-shadow: none;
    transform: none !important; /* Prevent inherit transform from parent */
    position: relative;
    z-index: 1;
}

.menu-section.nested-section .menu-section-header {
    padding: 12px 16px;
    font-size: 14px;
    background: #f8f9fa;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.menu-section.nested-section .menu-section-header:hover {
    background: #f1f5f9;
}

.menu-section.nested-section .menu-section-title {
    font-size: 14px;
    font-weight: 500;
    color: #5f6368;
}

.menu-section.nested-section .menu-section-toggle {
    font-size: 11px;
    color: #80868b;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-section.nested-section .menu-section-content {
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

/* Custom scrollbar for nested sections */
.menu-section.nested-section .menu-section-content::-webkit-scrollbar {
    width: 4px;
}

.menu-section.nested-section .menu-section-content::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 2px;
}

.menu-section.nested-section .menu-section-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

.menu-section.nested-section .menu-section-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.menu-section.nested-section.collapsed .menu-section-content {
    max-height: 0;
    overflow: hidden;
}

.menu-section.nested-section.collapsed .menu-section-toggle {
    transform: rotate(-90deg);
}

.menu-section.nested-section.active .menu-section-toggle {
    color: var(--color-primary);
}

.menu-section.nested-section:not(.collapsed) .menu-section-toggle {
    transform: rotate(0deg);
}

/* Prevent parent hover effects from affecting nested sections */
.menu-section:hover .menu-section.nested-section {
    transform: none !important;
    box-shadow: none;
}

/* Enhanced submenu styles */
.mobile-menu-link.submenu {
    transition: all 0.3s ease;
    border-bottom: 1px solid #f1f3f4;
    font-size: 13px;
    margin: 1px 8px !important; /* Override earlier margin */
    padding: 10px 16px 10px 45px !important; /* Increased left padding more to accommodate bullet spacing */
    border-radius: 6px;
    position: relative;
}

.mobile-menu-link.submenu:hover {
    background: linear-gradient(135deg, rgba(25, 118, 210, 0.05), rgba(33, 150, 243, 0.03));
    color: #1976d2;
    transform: translateX(2px);
    border-bottom-color: transparent;
}

.mobile-menu-link.submenu.active {
    background: linear-gradient(135deg, rgba(25, 118, 210, 0.1), rgba(33, 150, 243, 0.05));
    color: #1976d2;
    border-left: 3px solid #1976d2;
    font-weight: 600;
    border-bottom-color: transparent;
    padding-left: 42px !important; /* Slightly reduced since border-left takes 3px */
}

.mobile-menu-link.submenu::before {
    content: '';
    position: absolute;
    left: 28px !important; /* Moved further right to separate from border-left */
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    background: #cbd5e1;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.mobile-menu-link.submenu:hover::before {
    background: #1976d2;
    transform: translateY(-50%) scale(1.5);
}

.mobile-menu-link.submenu.active::before {
    background: #1976d2;
    transform: translateY(-50%) scale(1.5);
}

/* ===== SAOMAI DASHBOARD STYLES ===== */
/* Tab Navigation Styles */
.tab-navigation {
    display: flex;
    background: white;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 0;
    overflow: hidden;
    position: sticky;
    top: 0;
    z-index: 100;
}

.tab-button {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: #f8f9fa;
    color: #666;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-right: 1px solid #dee2e6;
}

.tab-button:last-child {
    border-right: none;
}

.tab-button.active {
    background: #007bff;
    color: white;
}

.tab-button:hover:not(.active) {
    background: #e9ecef;
    color: #333;
}

/* Tab Content Styles */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.main-content {
    padding: 20px;
    margin-top: 20px;
    position: relative; /* Ensure proper stacking context */
    overflow: visible; /* Allow dropdowns to extend beyond main content */
}

.filter-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    position: relative; /* Ensure proper stacking context */
    overflow: visible; /* Allow dropdown to extend beyond section */
}

.filter-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 300px;
    position: relative; /* Needed for dropdown positioning */
}

.filter-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.required {
    color: red;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-control:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

/* Multiselect Dropdown Styles */
.multiselect {
    display: none;
}

.multiselect-display {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    position: relative;
    min-height: 38px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding-right: 30px; /* Space for arrow */
}

.multiselect-display.text-only {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    flex-wrap: nowrap;
}

.multiselect-display:after {
    content: "▼";
    color: #666;
    position: absolute;
    right: 12px;
    pointer-events: none;
}

/* Selected Tags/Chips Styles */
.multiselect-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.multiselect-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: linear-gradient(135deg, #66afea 0%, #163999 100%);
    color: white;
    border-radius: 4px;
    font-size: 13px;
    max-width: 200px;
    transition: all 0.2s ease;
}

.multiselect-tag:hover {
    background: linear-gradient(135deg, #5b64b4 0%, #21358d 100%);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.multiselect-tag-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.multiselect-tag-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    line-height: 1;
    padding: 0;
    border: none;
    color: white;
    transition: all 0.2s ease;
}

.multiselect-tag-remove:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.multiselect-placeholder {
    color: #999;
    font-style: italic;
}

.multiselect-display.disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    color: #666;
}

.multiselect-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.dropdown-search {
    padding: 10px;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
}

.dropdown-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.dropdown-options {
    max-height: 200px;
    overflow-y: auto;
}

.multiselect-option {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.multiselect-option input[type="checkbox"] {
    margin: 0;
}

.multiselect-option:hover {
    background-color: #f8f9fa;
}

.multiselect-option.selected {
    background-color: #007bff;
    color: white;
}

.multiselect-option:last-child {
    border-bottom: none;
}

.loading-text {
    padding: 15px;
    text-align: center;
    color: #666;
    font-style: italic;
}

.dropdown-pagination {
    padding: 10px;
    border-top: 1px solid #eee;
    background: #f8f9fa;
    display: flex;
    justify-content: center;
    position: sticky;
    bottom: 0;
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pagination-btn {
    padding: 5px 10px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.pagination-btn:hover:not(:disabled) {
    background: #e9ecef;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Mobile specific multiselect enhancements */
@media (max-width: 768px) {
    .multiselect-dropdown {
        max-height: 250px;
        border-radius: 0 0 8px 8px;
        box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    }
    
    .dropdown-search {
        padding: 15px;
    }
    
    .dropdown-search input {
        padding: 12px 15px;
        font-size: 16px; /* Prevents zoom on iOS */
        border-radius: 6px;
        border: 2px solid #e1e5e9;
    }
    
    .dropdown-search input:focus {
        border-color: #007bff;
        outline: none;
    }
    
    .multiselect-option {
        padding: 15px 20px;
        font-size: 16px;
        border-bottom: 1px solid #e9ecef;
        min-height: 50px;
        display: flex;
        align-items: center;
    }
    
    .multiselect-option input[type="checkbox"] {
        transform: scale(1.3);
        margin-right: 12px;
    }
    
    .loading-text {
        padding: 20px;
        font-size: 16px;
    }
    
    .dropdown-pagination {
        padding: 15px;
    }
    
    .pagination-btn {
        padding: 8px 15px;
        font-size: 14px;
        border-radius: 6px;
        min-width: 60px;
    }
    
    #customerPageInfo, #vendorPageInfo {
        font-size: 14px;
        color: #666;
        min-width: 80px;
        text-align: center;
    }
    
    /* Mobile tag styles */
    .multiselect-tag {
        font-size: 14px;
        padding: 6px 10px;
        max-width: 180px;
    }
    
    .multiselect-tag-remove {
        width: 18px;
        height: 18px;
        font-size: 13px;
    }
}

.multiselect-display.disabled:after {
    color: #999;
}

.multiselect-display.has-selection {
    color: #333;
    font-weight: 500;
}

.multiselect-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 300px; /* Ensure dropdown does not exceed this height */
    overflow-y: auto; /* Enable scrolling for overflow */
    z-index: 9999; /* Increased z-index to appear above other elements */
    display: none !important; /* Force override with !important */
    box-shadow: 0 4px 8px rgba(0,0,0,0.15); /* Add shadow for better visibility */
}

.multiselect-dropdown[style*="block"] {
    display: block !important; /* Force show when style attribute contains block */
}

.dropdown-search {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

.dropdown-search input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.dropdown-search input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,.25);
}

.dropdown-options {
    max-height: 180px;
    overflow-y: auto;
}

.dropdown-pagination {
    padding: 8px 12px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
    text-align: center;
    font-size: 12px;
    color: #666;
}

.pagination-buttons {
    margin-top: 5px;
}

.pagination-btn {
    padding: 4px 8px;
    margin: 0 2px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 3px;
    font-size: 11px;
}

.pagination-btn:hover {
    background: #f0f0f0;
}

.pagination-btn:disabled {
    background: #f8f9fa;
    color: #999;
    cursor: not-allowed;
}

.loading-text {
    padding: 12px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.multiselect-option {
    padding: 8px 12px;
    background: white;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.multiselect-option:hover {
    background-color: #f8f9fa;
}

.multiselect-option.selected {
    background-color: #007bff;
    color: white;
}

.multiselect-option:last-child {
    border-bottom: none;
}

.filter-group {
    position: relative;
}

.form-text {
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

.text-muted {
    color: #6c757d !important;
}

.date-range {
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-range .form-control {
    flex: 1;
}

.to {
    color: #666;
    font-size: 14px;
}

.filter-actions {
    text-align: center;
    margin-top: 20px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #0056b3;
}

.btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

.chart-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.chart-container:last-child {
    grid-column: span 2;
}

.chart-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
    text-align: center;
}

/* Note: Vendor Payable, Summary Cards, Cash Conversion, and Table styles moved to Performance Analysis section at end of file */

/* Dashboard Styles */
.dashboard-container {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.charts-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

/* Global responsive chart title styling */
.apexcharts-title-text {
    font-family: inherit !important;
    font-weight: 600 !important;
    fill: #333 !important;
    dominant-baseline: central !important;
}

@media (min-width: 1200px) {
    .apexcharts-title-text {
        font-size: 18px !important;
    }
}

@media (min-width: 769px) and (max-width: 1199px) {
    .apexcharts-title-text {
        font-size: 16px !important;
    }
}

.chart-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.chart-info {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    flex-wrap: wrap;
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 120px;
}

.info-label {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 4px;
}

.info-value {
    font-size: 16px;
    font-weight: bold;
    color: #495057;
}

.chart-card-large {
    grid-column: span 2;
}

.chart-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f3f4f6;
}

.chart-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.chart-filters {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-select {
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    min-width: 100px;
}

.filter-select[type="date"] {
    min-width: 130px;
}

.filter-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.filter-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.filter-btn:hover {
    background: #2563eb;
}

.chart-header h3 {
    margin: 0;
    color: #1f2937;
    font-size: 18px;
    font-weight: 600;
}

.chart-header h3 i {
    margin-right: 8px;
    color: #3b82f6;
}

.chart-type-controls {
    display: flex;
    gap: 5px;
}

.chart-type-btn {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 8px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6c757d;
}

.chart-type-btn:hover {
    background: #e9ecef;
    color: #495057;
}

.chart-type-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    margin-top: 15px;
    color: #6b7280;
    font-size: 14px;
}

.error-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    color: #dc2626;
}

.error-icon {
    font-size: 24px;
    margin-bottom: 10px;
}

.error-text {
    margin-bottom: 15px;
    font-size: 14px;
}

.retry-btn {
    background: #dc2626;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
}

.retry-btn:hover {
    background: #b91c1c;
}

/* Chart container styling */
#cashbank-chart, #inventory-chart, #accounts-chart, #detail-cost-ledger-chart, #percent-item-slow-chart, #sales-rest-center-chart, #revenue-comparison-chart, #revenue-date-comparison-chart, #cost-comparison-chart, #revenue-counter-chart, #sales-revenue-rc-chart, #vendor-revenue-chart, #sales-category-chart, #sales-form-chart, #sales-group7-chart, #cashflow-chart {
    min-height: 400px;
    width: 100%;
}

#revenue-counter-chart, #sales-revenue-rc-chart, #vendor-revenue-chart, #sales-category-chart, #sales-form-chart, #sales-group7-chart, #cashflow-chart, #revenue-date-comparison-chart, #cost-comparison-chart {
    min-height: 550px;
}

.chart-card {
    min-height: auto;
    height: auto;
}

.chart-card-large {
    min-height: auto;
    height: auto;
}

/* Mobile Filter Button */
.mobile-filter-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
    display: none;
    margin-left: auto;
}

.mobile-filter-btn:hover {
    background: #2563eb;
}

/* Desktop Filters */
.desktop-filters {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* Filter Modal Styles */
.filter-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.filter-modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.filter-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.filter-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.filter-modal-header h3 i {
    margin-right: 8px;
}

.filter-modal-close {
    color: white;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.filter-modal-close:hover {
    opacity: 1;
}

.filter-modal-body {
    padding: 20px 20px 0 20px;
}

.filter-section {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
}

.filter-section h4 {
    margin: 0 0 15px 0;
    color: #374151;
    font-size: 14px;
    font-weight: 600;
}

.filter-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

.filter-row label {
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.filter-input {
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    color: #374151;
    transition: all 0.2s ease;
}

.filter-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
    padding: 20px;
    border-top: 1px solid #e5e7eb;
}

.apply-filter-mobile {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.apply-filter-mobile:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.cancel-filter-mobile {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.cancel-filter-mobile:hover {
    background: #e5e7eb;
    transform: translateY(-1px);
}

/* Mobile Chart Optimizations */
@media (max-width: 768px) {
    /* Chart header mobile optimizations */
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        margin-bottom: 15px;
        padding-bottom: 15px;
    }

    .chart-header h3 {
        font-size: 16px !important;
        line-height: 1.4;
        word-wrap: break-word;
        max-width: 100%;
        margin: 0;
        text-align: left;
        white-space: normal;
    }

    .chart-controls {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 10px;
    }

    .chart-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        width: 100%;
    }

    .filter-select, .filter-input {
        width: 100%;
        min-width: auto;
        font-size: 16px; /* Prevent zoom on iOS */
    }

    .chart-type-controls {
        flex-shrink: 0;
        align-self: flex-end;
    }

    /* ApexCharts mobile title styling */
    .apexcharts-title-text {
        font-size: 14px !important;
        text-anchor: middle !important;
        font-weight: bold !important;
    }

    /* Ensure chart titles are visible and properly styled */
    .chart-card .apexcharts-title {
        margin-bottom: 10px !important;
    }

    /* Enhanced Tab Navigation for Mobile */
    .tab-navigation {
        flex-direction: column;
        background: white;
        border-radius: 12px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.1);
        margin-bottom: 20px;
        overflow: hidden;
        position: relative;
    }
    
    /* Mobile Tab Dropdown Style */
    .mobile-tab-dropdown {
        display: block;
        position: relative;
    }
    
    .mobile-tab-selected {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px 20px;
        background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
        color: white;
        font-weight: 600;
        font-size: 16px;
        cursor: pointer;
        border: none;
        width: 100%;
        box-sizing: border-box;
        transition: all 0.3s ease;
    }
    
    .mobile-tab-selected:hover {
        background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    }
    
    .mobile-tab-selected:after {
        content: "▼";
        font-size: 14px;
        transition: transform 0.3s ease;
    }
    
    .mobile-tab-selected.open:after {
        transform: rotate(180deg);
    }
    
    .mobile-tab-options {
        display: none;
        background: white;
        border-top: 1px solid #e9ecef;
        max-height: 300px;
        overflow-y: auto;
        box-shadow: inset 0 4px 8px rgba(0,0,0,0.05);
    }
    
    .mobile-tab-options.open {
        display: block;
        animation: slideDown 0.3s ease;
    }
    
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .tab-button {
        border-right: none;
        border-bottom: 1px solid #e9ecef;
        font-size: 15px;
        padding: 16px 20px;
        text-align: left;
        width: 100%;
        background: white;
        color: #495057;
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
        border: none;
        cursor: pointer;
    }
    
    .tab-button:before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 4px;
        background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
        transform: scaleY(0);
        transition: transform 0.3s ease;
    }
    
    .tab-button.active:before {
        transform: scaleY(1);
    }
    
    .tab-button:last-child {
        border-bottom: none;
    }
    
    .tab-button.active {
        background: linear-gradient(135deg, rgba(0,123,255,0.1) 0%, rgba(0,86,179,0.1) 100%);
        color: #007bff;
        font-weight: 600;
    }
    
    .tab-button:hover:not(.active) {
        background: #f8f9fa;
        color: #007bff;
        transform: translateX(5px);
    }
    
    /* Hide desktop tab navigation on mobile */
    .desktop-tab-navigation {
        display: none;
    }
    
    .main-content {
        padding: 10px;
    }
    
    /* Enhanced Mobile Filter Section Styles */
    .filter-section {
        padding: 15px;
        margin-bottom: 15px;
        border-radius: 6px;
        position: relative;
        overflow: hidden;
        transition: all 0.3s ease;
    }
    
    /* Collapsible Filter Styles */
    .filter-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px;
        background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
        color: white;
        border-radius: 8px 8px 0 0;
        cursor: pointer;
        user-select: none;
        margin: -15px -15px 15px -15px;
        position: sticky;
        top: 0;
        z-index: 10;
        box-shadow: 0 2px 8px rgba(0,123,255,0.2);
    }
    
    .filter-header h4 {
        margin: 0;
        font-size: 16px;
        color: white;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .filter-toggle {
        background: none;
        border: none;
        color: white;
        font-size: 18px;
        cursor: pointer;
        padding: 5px;
        border-radius: 4px;
        transition: all 0.2s ease;
        transform-origin: center;
    }
    
    .filter-toggle:hover {
        background: rgba(255,255,255,0.1);
    }
    
    .filter-toggle.collapsed {
        transform: rotate(180deg);
    }
    
    .filter-body {
        transition: all 0.3s ease;
        overflow: hidden;
    }
    
    .filter-body.collapsed {
        max-height: 0;
        padding: 0 15px;
        margin: 0 -15px;
        opacity: 0;
    }
    
    .filter-body:not(.collapsed) {
        max-height: 2000px;
        opacity: 1;
    }
    
    .filter-row {
        flex-direction: column;
        gap: 15px;
        margin-bottom: 15px;
    }
    
    .filter-group {
        min-width: auto;
        width: 100%;
    }
    
    .filter-group label {
        font-size: 14px;
        margin-bottom: 8px;
        font-weight: 600;
        color: #333;
    }
    
    /* Enhanced form controls for mobile */
    .form-control {
        padding: 12px 15px;
        font-size: 16px; /* Prevents zoom on iOS */
        border-radius: 6px;
        border: 2px solid #e1e5e9;
        background: #fff;
        transition: border-color 0.2s ease;
        width: 100%;
        box-sizing: border-box;
    }
    
    .form-control:focus {
        border-color: #007bff;
        outline: none;
        box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    }
    
    /* Enhanced multiselect for mobile */
    .multiselect-display {
        padding: 12px 15px;
        font-size: 16px;
        border-radius: 6px;
        border: 2px solid #e1e5e9;
        min-height: 48px;
        position: relative;
        background: #fff;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: space-between;
        box-sizing: border-box;
    }
    
    .multiselect-display:after {
        content: "▼";
        color: #666;
        font-size: 14px;
        position: absolute;
        right: 15px;
        pointer-events: none;
    }
    
    .multiselect-display.disabled {
        background-color: #f8f9fa;
        color: #6c757d;
        cursor: not-allowed;
        border-color: #dee2e6;
    }
    
    /* Date range inputs for mobile */
    .date-range {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    
    .date-range .to {
        align-self: center;
        margin: 5px 0;
        font-weight: 500;
        color: #666;
        font-size: 14px;
    }
    
    .date-range input[type="date"] {
        flex: 1;
        min-width: 0;
    }
    
    /* Filter actions mobile optimization */
    .filter-actions {
        margin-top: 20px;
        display: flex;
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }
    
    .filter-actions .btn {
        width: 100%;
        padding: 15px 20px;
        font-size: 16px;
        font-weight: 600;
        border-radius: 8px;
        border: none;
        cursor: pointer;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }
    
    .filter-actions .btn-primary {
        background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
        color: white;
        box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    }
    
    .filter-actions .btn-primary:hover:not(:disabled) {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
    }
    
    .filter-actions .btn:disabled {
        background: #e9ecef;
        color: #6c757d;
        cursor: not-allowed;
        transform: none;
        box-shadow: none;
    }
    
    /* Form text for mobile */
    .form-text {
        font-size: 12px;
        color: #6c757d;
        margin-top: 5px;
        line-height: 1.4;
    }
    
    /* Checkbox styling for mobile */
    .filter-group input[type="checkbox"] {
        margin-right: 8px;
        transform: scale(1.2);
    }
    
    .filter-group label:has(input[type="checkbox"]) {
        display: flex;
        align-items: center;
        cursor: pointer;
        font-size: 14px;
        padding: 8px 0;
    }
    
    /* Summary cards responsive */
    .summary-cards {
        display: grid;
        grid-template-columns: 1fr;
        gap: 15px;
        margin-bottom: 20px;
    }
    
    .summary-card {
        padding: 15px;
        border-radius: 8px;
        text-align: center;
        min-height: auto;
    }
    
    .summary-card-title {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .summary-card-value {
        font-size: 20px;
        font-weight: bold;
    }
    
    /* Charts grid responsive */
    .vendor-charts-grid,
    .cash-conversion-charts-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .vendor-charts-grid .chart-container.full-width,
    .cash-conversion-charts-grid .chart-container.full-width {
        grid-column: span 1;
    }

    .charts-section {
        grid-template-columns: 1fr;
    }
    
    /* Chart containers responsive */
    .chart-container {
        padding: 15px;
        margin-bottom: 15px;
        border-radius: 8px;
    }
    
    .chart-title {
        font-size: 16px;
        margin-bottom: 12px;
        text-align: center;
    }
    
    /* Table containers responsive */
    .table-container {
        overflow-x: auto;
        border-radius: 6px;
        border: 1px solid #e1e5e9;
        margin-top: 10px;
    }
    
    .table-container table {
        min-width: 600px;
        font-size: 14px;
    }
    
    .table-container th,
    .table-container td {
        padding: 8px 12px;
        white-space: nowrap;
    }

    /* Optimize chart heights on mobile - remove excessive padding */
    #revenue-counter-chart, #sales-revenue-rc-chart, #vendor-revenue-chart, 
    #sales-category-chart, #sales-form-chart, #sales-group7-chart, 
    #cashflow-chart, #revenue-date-comparison-chart, #cost-comparison-chart {
        min-height: 400px !important;
        height: auto !important;
    }

    #cashbank-chart, #inventory-chart, #accounts-chart, #detail-cost-ledger-chart, 
    #percent-item-slow-chart, #sales-rest-center-chart, #revenue-comparison-chart {
        min-height: 300px !important;
        height: auto !important;
    }

    .chart-card {
        min-height: auto !important;
        height: auto !important;
        padding: 15px;
        padding-bottom: 15px;
    }

    .chart-card-large {
        min-height: auto !important;
        height: auto !important;
        padding: 15px;
        padding-bottom: 15px;
        grid-column: span 1;
    }

    .mobile-filter-btn {
        display: block;
    }

    .desktop-filters {
        display: none !important;
    }

    .chart-controls {
        justify-content: flex-end;
    }

    .filter-modal-content {
        margin: 5% auto;
        width: 95%;
        max-height: 90vh;
    }

    .filter-modal-header {
        padding: 15px;
    }

    .filter-modal-header h3 {
        font-size: 14px;
    }

    .filter-modal-body {
        padding: 15px;
    }

    .filter-modal-actions {
        flex-direction: column-reverse;
        gap: 10px;
    }

    .apply-filter-mobile, .cancel-filter-mobile {
        width: 100%;
        justify-content: center;
    }

    /* Chart adjustments for mobile */
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 10px !important;
        padding-bottom: 8px !important;
        min-height: auto !important;
    }

    .chart-header h3 {
        font-size: 16px;
        margin: 0 !important;
        line-height: 1.2 !important;
    }

    .chart-controls {
        width: 100%;
        justify-content: space-between;
        margin: 0 !important;
        min-height: auto !important;
    }

    .chart-type-controls {
        display: flex;
        gap: 5px;
        margin: 0 !important;
    }

    .dashboard-container {
        padding: 15px;
    }

    .chart-card {
        padding: 15px;
        margin-bottom: 15px;
        border-radius: 12px;
        box-shadow: 0 2px 12px rgba(0,0,0,0.08);
        overflow: hidden;
        position: relative;
    }

    .chart-card-large {
        grid-column: span 1;
        min-height: auto;
    }

    /* Improve chart container sizing */
    .chart-card > div[id*="chart"] {
        min-height: 300px !important;
        height: auto !important;
        width: 100% !important;
    }

    /* Optimize specific chart containers for mobile */
    #inventory-total-chart {
        min-height: 350px !important;
    }

    /* Better responsive grid for charts */
    .charts-section {
        display: grid;
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 0;
    }

    /* Ensure chart legends don't overflow */
    .apexcharts-legend {
        max-width: 100% !important;
        overflow-x: auto !important;
        padding-bottom: 10px !important;
        scrollbar-width: thin;
    }

    .apexcharts-legend::-webkit-scrollbar {
        height: 4px;
    }

    .apexcharts-legend::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 2px;
    }

    .apexcharts-legend::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 2px;
    }

    .charts-section {
        gap: 15px;
    }

    /* Additional mobile optimizations for chart containers */
    .chart-card > div {
        height: auto !important;
    }

    /* Ensure chart content fits without extra spacing */
    .chart-header {
        margin-bottom: 10px !important;
        padding-bottom: 5px !important;
    }

    .chart-card .apexcharts-canvas {
        max-width: 100% !important;
    }

    /* Remove any bottom margins that might cause spacing issues */
    .chart-card > *:last-child {
        margin-bottom: 0 !important;
    }

    /* Optimize dashboard container spacing */
    .main-content .dashboard-container {
        padding: 10px;
    }

    .main-content .charts-section {
        margin-bottom: 20px;
    }

    /* Fix chart header spacing issues when charts are loaded */
    .chart-card:has(.apexcharts-canvas) .chart-header {
        margin-bottom: 8px !important;
        padding-bottom: 3px !important;
    }

    /* Prevent ApexCharts from creating invisible space */
    .chart-card .apexcharts-toolbar {
        display: none !important;
    }

    .chart-card .apexcharts-menu {
        display: none !important;
    }

    /* Ensure ApexCharts containers are optimized for mobile */
    .apexcharts-canvas {
        height: auto !important;
        max-height: none !important;
    }

    .apexcharts-svg {
        height: auto !important;
        overflow: visible !important;
    }

    /* Remove any excess margins from chart elements */
    .chart-card .apexcharts-legend {
        margin-bottom: 0 !important;
        padding-bottom: 5px !important;
    }

    /* Ensure chart cards fit content exactly */
    .chart-card {
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .chart-card > div {
        flex: 1;
        min-height: 0;
    }
}

@media (max-width: 1024px) {
    .charts-section {
        grid-template-columns: 1fr;
    }

    .chart-card-large {
        grid-column: span 1;
    }

    /* Tablet-specific chart title optimization */
    .chart-header h3 {
        font-size: 18px;
        line-height: 1.3;
    }

    .apexcharts-title-text {
        font-size: 16px !important;
    }
}

@media (max-width: 480px) {
    /* Very small screen chart title optimizations */
    .chart-header h3 {
        font-size: 14px !important;
        line-height: 1.4 !important;
        margin-bottom: 8px !important;
    }

    .apexcharts-title-text {
        font-size: 12px !important;
        line-height: 1.3 !important;
    }

    /* Better chart spacing for small screens */
    .chart-card {
        padding: 10px;
        margin-bottom: 10px;
    }

    .chart-header {
        margin-bottom: 8px !important;
        padding-bottom: 5px !important;
    }

    /* Optimize chart heights for very small screens */
    #revenue-counter-chart, #sales-revenue-rc-chart, #vendor-revenue-chart, 
    #sales-category-chart, #sales-form-chart, #sales-group7-chart, 
    #cashflow-chart, #revenue-date-comparison-chart, #cost-comparison-chart {
        min-height: 350px !important;
        height: auto !important;
    }

    #cashbank-chart, #inventory-chart, #accounts-chart, #detail-cost-ledger-chart, 
    #percent-item-slow-chart, #sales-rest-center-chart, #revenue-comparison-chart {
        min-height: 280px !important;
        height: auto !important;
    }

    .chart-card {
        min-height: auto !important;
        height: auto !important;
        padding: 12px;
        padding-bottom: 12px;
    }

    .chart-card-large {
        min-height: auto !important;
        height: auto !important;
        padding: 12px;
        padding-bottom: 12px;
    }

    /* Force ApexCharts to show all X-axis labels on mobile */
    .apexcharts-xaxistooltip {
        display: none !important;
    }
    
    .apexcharts-xaxis-label {
        font-size: 10px !important;
    }
    
    .apexcharts-text {
        font-size: 10px !important;
        fill: #666 !important;
    }

    /* Ensure chart containers don't overflow and fit content */
    .chart-card {
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    /* Mobile specific ApexCharts styles */
    .apexcharts-canvas {
        overflow: visible !important;
    }

    .apexcharts-svg {
        overflow: visible !important;
    }

    .apexcharts-gridlines-horizontal, 
    .apexcharts-gridlines-vertical {
        opacity: 0.3;
    }

    .filter-modal-content {
        margin: 2% auto;
        width: 98%;
        border-radius: 8px;
    }

    .filter-modal-header {
        border-radius: 8px 8px 0 0;
    }

    .filter-section {
        padding: 12px;
        margin-bottom: 15px;
    }

    .filter-input {
        padding: 10px;
    }

    .apply-filter-mobile, .cancel-filter-mobile {
        padding: 10px 20px;
    }

    /* Final mobile chart optimizations */
    .main-content {
        overflow-x: hidden;
    }

    .dashboard-container {
        padding: 8px !important;
    }

    .charts-section {
        gap: 12px !important;
        margin-bottom: 15px !important;
    }

    .chart-card, .chart-card-large {
        padding: 10px !important;
        margin-bottom: 0 !important;
        min-height: auto !important;
        height: auto !important;
    }

    /* Aggressive chart header optimization for mobile */
    .chart-header {
        margin-bottom: 5px !important;
        padding: 0 !important;
        border-bottom: 1px solid #e5e7eb !important;
        min-height: auto !important;
        gap: 5px !important;
    }

    .chart-header h3 {
        margin: 0 !important;
        padding: 0 !important;
        line-height: 1.1 !important;
        font-size: 15px !important;
    }

    .chart-controls {
        margin: 0 !important;
        padding: 0 !important;
        min-height: auto !important;
        height: auto !important;
    }

    /* Force chart containers to fit content without extra space */
    .chart-card > div[id*="chart"],
    .chart-card-large > div[id*="chart"] {
        height: auto !important;
        min-height: 250px !important;
        max-height: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Remove all bottom spacing from ApexCharts elements */
    .apexcharts-canvas,
    .apexcharts-svg,
    .apexcharts-inner {
        height: auto !important;
        overflow: visible !important;
    }

    .apexcharts-legend {
        padding: 5px 0 0 0 !important;
        margin: 0 !important;
    }

    .apexcharts-tooltip {
        font-size: 11px !important;
    }

    .apply-filter-mobile, .cancel-filter-mobile {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    /* Tab-specific mobile filter optimizations */
    
    /* Performance Tab (Doanh thu & Giá vốn) */
    #performance-tab .filter-section {
        background: #f8f9fc;
        border: 2px solid #e3e7f3;
    }
    
    #performance-tab .filter-row {
        background: white;
        padding: 15px;
        border-radius: 8px;
        margin-bottom: 15px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    }
    
    /* Inventory Tab (Tồn kho vs Doanh thu) */
    #inventory-tab .filter-section {
        background: #f0fdf4;
        border: 2px solid #dcfce7;
    }
    
    #inventory-tab .filter-group label {
        color: #166534;
        font-weight: 600;
    }
    
    /* Vendor Payable Tab */
    #vendor-payable-tab .filter-section {
        background: #fefce8;
        border: 2px solid #fef3c7;
    }
    
    #vendor-payable-tab .filter-actions .btn-primary {
        background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
        box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
    }
    
    /* Customer Coverage Payable Tab */
    #customer-coverage-payable-tab .filter-section {
        background: #f0f9ff;
        border: 2px solid #bae6fd;
    }
    
    #customer-coverage-payable-tab .multiselect-display {
        border: 2px solid #0ea5e9;
        background: white;
    }
    
    /* Cash Conversion Tab */
    #cash-conversion-tab .filter-section {
        background: #fdf2f8;
        border: 2px solid #fce7f3;
    }
    
    #cash-conversion-tab .filter-group label {
        color: #be185d;
        font-weight: 600;
    }
    
    /* Working Capital Tab */
    #working-capital-tab .filter-section {
        background: #f5f3ff;
        border: 2px solid #e9d5ff;
    }
    
    #working-capital-tab .form-control:focus {
        border-color: #7c3aed;
        box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
    }
    
    /* Selling Expenses Tab */
    #selling-expenses-tab .filter-section {
        background: #fff7ed;
        border: 2px solid #fed7aa;
    }
    
    #selling-expenses-tab .filter-actions .btn-primary {
        background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
        box-shadow: 0 4px 15px rgba(234, 88, 12, 0.3);
    }
    
    /* Sales Invoice Tab */
    #sales-invoice-tab .filter-section {
        background: #ecfdf5;
        border: 2px solid #bbf7d0;
    }
    
    #sales-invoice-tab .form-text {
        color: #047857;
        font-weight: 500;
    }
    
    /* Additional mobile-specific improvements */
    .tab-content:not(#overview-tab) .filter-section {
        position: relative;
        margin-bottom: 20px;
    }
    
    .tab-content:not(#overview-tab) .filter-section:before {
        content: '';
        position: absolute;
        top: -3px;
        left: -3px;
        right: -3px;
        bottom: -3px;
        background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
        border-radius: 10px;
        z-index: -1;
    }
    
    /* Improve touch targets */
    .tab-content:not(#overview-tab) .form-control,
    .tab-content:not(#overview-tab) .multiselect-display {
        min-height: 48px;
        touch-action: manipulation;
    }
    
    .tab-content:not(#overview-tab) .btn {
        min-height: 48px;
        touch-action: manipulation;
    }
    
    /* Touch feedback effects */
    .touch-active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    /* Enhanced button styles for mobile */
    .btn:active,
    .btn.touch-active {
        transform: scale(0.96);
    }
    
    /* Better form control focus states */
    .form-control:focus,
    .multiselect-display:focus {
        border-color: #007bff;
        box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
        outline: none;
    }
    
    /* Loading states for mobile */
    .btn:disabled {
        position: relative;
        color: transparent;
    }
    
    .btn:disabled:after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 20px;
        height: 20px;
        border: 2px solid #fff;
        border-top: 2px solid transparent;
        border-radius: 50%;
        animation: spin 1s linear infinite;
    }
    
    /* Improved multiselect dropdown for mobile */
    .multiselect-dropdown {
        max-height: 60vh;
        background: white;
        border-radius: 0 0 12px 12px;
        box-shadow: 0 8px 32px rgba(0,0,0,0.15);
        backdrop-filter: blur(10px);
        z-index: 9999 !important;
    }
    
    /* Ensure filter containers don't clip dropdown on mobile */
    .filter-group {
        overflow: visible !important;
        position: relative;
    }
    
    .filter-row {
        overflow: visible !important;
    }
    
    .filter-section {
        overflow: visible !important;
    }
    
    .tab-content {
        overflow: visible !important;
    }
    
    #sales-invoice-tab,
    #sales-invoice-tab .filter-section,
    #sales-invoice-tab .filter-row,
    #sales-invoice-tab .filter-group {
        overflow: visible !important;
    }
    
    .multiselect-option {
        padding: 16px 20px;
        font-size: 16px;
        display: flex;
        align-items: center;
        gap: 12px;
        transition: all 0.2s ease;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .multiselect-option:hover {
        background: linear-gradient(135deg, rgba(0,123,255,0.1) 0%, rgba(0,86,179,0.1) 100%);
        transform: translateX(5px);
    }
    
    .multiselect-option:active {
        transform: scale(0.98);
    }
    
    /* Floating action button style for filter toggle */
    .filter-floating-toggle {
        position: fixed;
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
        color: white;
        border: none;
        box-shadow: 0 8px 20px rgba(0,123,255,0.3);
        font-size: 20px;
        cursor: pointer;
        z-index: 1000;
        transition: all 0.3s ease;
        display: none;
    }
    
    /* Hide floating button when overview tab is active */
    #overview-tab.active ~ * .filter-floating-toggle,
    #overview-tab.active + * .filter-floating-toggle,
    body:has(#overview-tab.active) .filter-floating-toggle {
        display: none !important;
    }
    
    .filter-floating-toggle:hover {
        transform: scale(1.1);
        box-shadow: 0 12px 25px rgba(0,123,255,0.4);
    }
    
    .filter-floating-toggle.show {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Only show floating button on non-overview tabs */
    .filter-floating-toggle.show {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Hide on overview tab specifically */
    .tab-content#overview-tab.active ~ .filter-floating-toggle,
    body:has(.tab-content#overview-tab.active) .filter-floating-toggle {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
    }
    
    /* Smooth scroll behavior */
    html {
        scroll-behavior: smooth;
    }
    
    /* Better spacing for mobile content */
    .main-content {
        padding: 10px;
        padding-bottom: 80px; /* Space for floating button */
    }
    
    /* Mobile-specific animations */
    @keyframes filterSlideIn {
        from {
            opacity: 0;
            transform: translateY(-20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .filter-section {
        animation: filterSlideIn 0.3s ease;
    }
    
    /* Mobile toast notifications */
    .mobile-toast {
        position: fixed;
        bottom: 80px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0,0,0,0.8);
        color: white;
        padding: 12px 20px;
        border-radius: 25px;
        font-size: 14px;
        z-index: 1001;
        opacity: 0;
        transition: all 0.3s ease;
        backdrop-filter: blur(10px);
    }
    
    .mobile-toast.show {
        opacity: 1;
        transform: translateX(-50%) translateY(-10px);
    }
}

/* Desktop-specific styles */
@media (min-width: 769px) {
    .filter-header {
        display: none; /* Hide collapsible headers on desktop */
    }
    
    .filter-body {
        max-height: none !important;
        opacity: 1 !important;
        padding: 0;
        margin: 0;
    }
    
    .filter-floating-toggle {
        display: none !important; /* Hide floating button on desktop */
    }
    
    .mobile-tab-dropdown {
        display: none; /* Hide mobile dropdown on desktop */
    }
    
    .tab-navigation {
        display: flex !important; /* Show normal tabs on desktop */
        flex-direction: row !important;
    }
    
    .tab-button {
        border-right: 1px solid #dee2e6 !important;
        border-bottom: none !important;
        padding: 15px 20px !important;
        font-size: 16px !important;
    }
    
    .tab-button:last-child {
        border-right: none !important;
    }
    
    .filter-section {
        padding: 20px;
    }
    
    .filter-row {
        flex-direction: row;
        gap: 20px;
    }
    
    .filter-group {
        min-width: 300px;
    }
}

/* Spin animation for loading indicators */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== PDCA & SGR DASHBOARD FILTER STYLES ===== */
/* Riêng biệt cho các trang PDCA và SGR để tránh xung đột với saomai-dashboard */

/* Filter section styles for PDCA dashboards */
.pdca-filter-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e5e7eb;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.pdca-filter-header {
    cursor: pointer;
    user-select: none;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    justify-content: between;
    font-weight: 600;
    color: #374151;
    transition: background-color 0.2s ease;
}

.pdca-filter-header:hover {
    background: #f1f5f9;
}

.pdca-filter-content {
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
    overflow: hidden;
    padding: 0 1rem 1rem 1rem;
}

.pdca-filter-collapsed .pdca-filter-content {
    max-height: 0;
    opacity: 0;
    padding: 0 1rem;
}

.pdca-filter-expanded .pdca-filter-content {
    max-height: 600px;
    opacity: 1;
}

.pdca-filter-toggle-icon {
    transition: transform 0.3s ease;
    margin-left: auto;
}

.pdca-filter-collapsed .pdca-filter-toggle-icon {
    transform: rotate(-90deg);
}

/* Filter section styles for SGR dashboards */
.sgr-filter-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e5e7eb;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.sgr-filter-header {
    cursor: pointer;
    user-select: none;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    justify-content: between;
    font-weight: 600;
    color: #374151;
    transition: background-color 0.2s ease;
}

.sgr-filter-header:hover {
    background: #f1f5f9;
}

.sgr-filter-content {
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
    overflow: hidden;
    padding: 0 1rem 1rem 1rem;
}

.sgr-filter-collapsed .sgr-filter-content {
    max-height: 0;
    opacity: 0;
    padding: 0 1rem;
}

.sgr-filter-expanded .sgr-filter-content {
    max-height: 600px;
    opacity: 1;
}

.sgr-filter-toggle-icon {
    transition: transform 0.3s ease;
    margin-left: auto;
}

.sgr-filter-collapsed .sgr-filter-toggle-icon {
    transform: rotate(-90deg);
}

/* ===== PERFORMANCE ANALYSIS STYLES ===== */
/* Tab Navigation Styles */
.tab-navigation {
    display: flex;
    background: white;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 0;
    overflow: hidden;
    position: sticky;
    top: 0;
    z-index: 100;
}

.tab-button {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: #f8f9fa;
    color: #666;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-right: 1px solid #dee2e6;
}

.tab-button:last-child {
    border-right: none;
}

.tab-button.active {
    background: #007bff;
    color: white;
}

.tab-button:hover:not(.active) {
    background: #e9ecef;
    color: #333;
}

/* Tab Content Styles */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.main-content {
    padding: 20px;
    margin-top: 20px;
    position: relative;
    /* Ensure proper stacking context */
    overflow: visible;
    /* Allow dropdowns to extend beyond main content */
}

.filter-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    position: relative;
    /* Ensure proper stacking context */
    overflow: visible;
    /* Allow dropdown to extend beyond section */
}

.filter-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 300px;
    position: relative;
    /* Needed for dropdown positioning */
}

.filter-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.required {
    color: red;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-control:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

/* Disabled select options */
.form-control option:disabled {
    background-color: #f5f5f5;
    color: #999;
    font-style: italic;
}

/* Disabled select options */
.form-control option:disabled {
    color: #999;
    background-color: #f5f5f5;
}

/* Multiselect Dropdown Styles */
.multiselect {
    display: none;
}

.multiselect-display {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    position: relative;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    padding-right: 30px;
    /* Space for arrow */
}

.multiselect-display:after {
    content: "▼";
    color: #666;
    position: absolute;
    right: 12px;
    pointer-events: none;
}

.multiselect-display.disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    color: #666;
}

.multiselect-display.disabled:after {
    color: #999;
}

.multiselect-display.has-selection {
    color: #333;
    font-weight: 500;
}

.multiselect-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 300px;
    /* Ensure dropdown does not exceed this height */
    overflow-y: auto;
    /* Enable scrolling for overflow */
    z-index: 9999;
    /* Increased z-index to appear above other elements */
    display: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    /* Add shadow for better visibility */
}

.dropdown-search {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

.dropdown-search input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.dropdown-search input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, .25);
}

.dropdown-options {
    max-height: 180px;
    overflow-y: auto;
}

.dropdown-pagination {
    padding: 8px 12px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
    text-align: center;
    font-size: 12px;
    color: #666;
}

.pagination-buttons {
    margin-top: 5px;
}

.pagination-btn {
    padding: 4px 8px;
    margin: 0 2px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 3px;
    font-size: 11px;
}

.pagination-btn:hover {
    background: #f0f0f0;
}

.pagination-btn:disabled {
    background: #f8f9fa;
    color: #999;
    cursor: not-allowed;
}

.loading-text {
    padding: 12px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.multiselect-option {
    padding: 8px 12px;
    background: white;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.multiselect-option:hover {
    background-color: #f8f9fa;
}

.multiselect-option.selected {
    background-color: #007bff;
    color: white;
}

.multiselect-option:last-child {
    border-bottom: none;
}

.filter-group {
    position: relative;
}

.form-text {
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

.text-muted {
    color: #6c757d !important;
}

.date-range {
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-range .form-control {
    flex: 1;
}

.to {
    color: #666;
    font-size: 14px;
}

.filter-actions {
    text-align: center;
    margin-top: 20px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #0056b3;
}

.btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

.charts-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.chart-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.chart-container:last-child {
    grid-column: 1 / -1;
}

.chart-container.full-width {
    grid-column: 1 / -1;
}

.chart-title {
    margin: 0 0 20px 0;
    text-align: center;
    color: #333;
    font-size: 18px;
}

/* Vendor Payable Styles */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.summary-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.summary-card-title {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
    font-weight: 600;
}

.summary-card-value {
    font-size: 24px;
    font-weight: bold;
    color: #007bff;
}

.vendor-charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.vendor-charts-grid .chart-container.full-width {
    grid-column: 1 / -1;
}

/* Cash Conversion Cycle Styles */
.cash-conversion-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.cash-conversion-metric {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
    border-left: 4px solid #007bff;
}

.cash-conversion-metric.inventory {
    border-left-color: #28a745;
}

.cash-conversion-metric.receivable {
    border-left-color: #ffc107;
}

.cash-conversion-metric.payable {
    border-left-color: #dc3545;
}

.cash-conversion-metric.cycle {
    border-left-color: #6f42c1;
}

.cash-conversion-metric-title {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 600;
}

.cash-conversion-metric-value {
    font-size: 20px;
    font-weight: bold;
    color: #333;
}

.cash-conversion-metric-change {
    font-size: 11px;
    margin-top: 5px;
}

.cash-conversion-metric-change.positive {
    color: #28a745;
}

.cash-conversion-metric-change.negative {
    color: #dc3545;
}

.cash-conversion-charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.cash-conversion-charts-grid .chart-container.full-width {
    grid-column: 1 / -1;
}

/* Working Capital Turnover Styles */
.working-capital-charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.working-capital-charts-grid .chart-container.full-width {
    grid-column: 1 / -1;
}

.working-capital-metric {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
    border-left: 4px solid #17a2b8;
}

.working-capital-metric.period1 {
    border-left-color: #28a745;
}

.working-capital-metric.period2 {
    border-left-color: #007bff;
}

.working-capital-metric.comparison {
    border-left-color: #ffc107;
}

.working-capital-metric-title {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 600;
}

.working-capital-metric-value {
    font-size: 20px;
    font-weight: bold;
    color: #333;
}

.working-capital-metric-change {
    font-size: 11px;
    margin-top: 5px;
}

.working-capital-metric-change.positive {
    color: #28a745;
}

.working-capital-metric-change.negative {
    color: #dc3545;
}

/* Selling Expenses vs Revenue Styles */
.selling-expenses-charts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.selling-expenses-charts-grid .chart-container.full-width {
    grid-column: 1 / -1;
}

.table-container {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

/* Selling expenses table responsive */
.selling-expenses-table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.selling-expenses-cards-view {
    display: none;
}

.selling-expense-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.selling-expense-card-header {
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
    margin-bottom: 12px;
}

.selling-expense-card-center {
    font-size: 14px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 4px;
}

.selling-expense-card-name {
    font-size: 12px;
    color: #6c757d;
}

.selling-expense-card-body {
    display: grid;
    gap: 8px;
}

.selling-expense-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #f8f9fa;
}

.selling-expense-card-label {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
}

.selling-expense-card-value {
    font-size: 13px;
    color: #212529;
    font-weight: 600;
    text-align: right;
}

.selling-expense-ratio {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    background-color: #e3f2fd;
    color: #1976d2;
    font-weight: 600;
}

/* Sales invoice table responsive */
.sales-invoice-table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.sales-invoice-cards-view {
    display: none;
}

.sales-invoice-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.sales-invoice-card-header {
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
    margin-bottom: 12px;
}

.sales-invoice-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 4px;
}

.sales-invoice-card-subtitle {
    font-size: 12px;
    color: #6c757d;
}

.sales-invoice-card-body {
    display: grid;
    gap: 8px;
}

.sales-invoice-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #f8f9fa;
}

.sales-invoice-card-label {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
}

.sales-invoice-card-value {
    font-size: 13px;
    color: #212529;
    font-weight: 600;
    text-align: right;
}

.sales-invoice-days-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 12px;
}

.sales-invoice-days-badge.days-0-3 {
    background-color: #d4edda;
    color: #155724;
}

.sales-invoice-days-badge.days-4-6 {
    background-color: #fff3cd;
    color: #856404;
}

.sales-invoice-days-badge.days-7-plus {
    background-color: #f8d7da;
    color: #721c24;
}

/* Vendor table container with horizontal scroll */
.vendor-table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
}

.vendor-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.vendor-table th,
.vendor-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
    white-space: nowrap;
}

.vendor-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    font-size: 13px;
    /* Header font size */
    position: sticky;
    top: 0;
    z-index: 1;
}

.vendor-table td {
    font-size: 12px;
    /* Cell font size - smaller than header */
}

.vendor-table tr:hover {
    background-color: #f8f9fa;
}

/* Vendor name column should wrap on smaller screens */
.vendor-table td:nth-child(2) {
    white-space: normal;
    max-width: 200px;
    word-wrap: break-word;
}

.text-right {
    text-align: right;
}

/* Mobile card view for vendor table */
.vendor-cards-view {
    display: none;
}

.vendor-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.vendor-card-header {
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
    margin-bottom: 12px;
}

.vendor-card-code {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 4px;
}

.vendor-card-name {
    font-size: 13px;
    color: #6c757d;
}

.vendor-card-body {
    display: grid;
    gap: 8px;
}

.vendor-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #f8f9fa;
}

.vendor-card-label {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
}

.vendor-card-value {
    font-size: 13px;
    color: #212529;
    font-weight: 600;
    text-align: right;
}

.aging-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.aging-badge.aging-1 {
    background-color: #d4edda;
    color: #155724;
}

.aging-badge.aging-2 {
    background-color: #fff3cd;
    color: #856404;
}

.aging-badge.aging-3 {
    background-color: #f8d7da;
    color: #721c24;
}

.aging-badge.aging-4 {
    background-color: #e2e3e5;
    color: #383d41;
}

/* Table pagination styles */
.table-pagination-info {
    padding: 10px 0;
    font-size: 14px;
    color: #6c757d;
}

.table-pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    margin-top: 10px;
    border-top: 1px solid #dee2e6;
}

.pagination-info {
    font-size: 14px;
    color: #6c757d;
}

.pagination-btn {
    padding: 8px 16px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.pagination-btn:hover:not(:disabled) {
    background-color: #0056b3;
}

.pagination-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.5;
}

/* Customer cards view (same as vendor cards) */
.customer-cards-view {
    display: none;
}

.customer-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.customer-card-header {
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
    margin-bottom: 12px;
}

.customer-card-number {
    font-size: 13px;
    font-weight: 600;
    color: #007bff;
    margin-bottom: 4px;
}

.customer-card-name {
    font-size: 14px;
    color: #212529;
    font-weight: 600;
    margin-bottom: 4px;
}

.customer-card-plan {
    font-size: 12px;
    color: #6c757d;
}

.customer-card-body {
    display: grid;
    gap: 8px;
}

.customer-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #f8f9fa;
}

.customer-card-label {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
}

.customer-card-value {
    font-size: 13px;
    color: #212529;
    font-weight: 600;
    text-align: right;
}

@media (max-width: 768px) {
    .filter-row {
        flex-direction: column;
    }

    .filter-group {
        min-width: auto;
    }

    .multiselect-display {
        font-size: 13px;
        padding: 6px 10px;
        padding-right: 28px;
    }

    .charts-section {
        grid-template-columns: 1fr;
    }

    .chart-container:last-child {
        grid-column: 1;
    }

    .summary-cards {
        grid-template-columns: 1fr;
    }

    .vendor-charts-grid {
        grid-template-columns: 1fr;
    }

    /* Hide table view and show card view on mobile */
    .vendor-table-container {
        display: none;
    }

    .vendor-cards-view {
        display: block;
    }

    .vendor-card {
        font-size: 14px;
    }

    .vendor-card-header {
        padding-bottom: 12px;
        margin-bottom: 12px;
    }

    .vendor-card-code {
        font-size: 15px;
    }

    .vendor-card-name {
        font-size: 13px;
    }

    /* Customer cards view on mobile */
    .customer-cards-view {
        display: block;
    }

    .customer-card {
        font-size: 14px;
    }

    /* Selling expenses cards view on mobile */
    .selling-expenses-table-container {
        display: none;
    }

    .selling-expenses-cards-view {
        display: block;
    }

    .selling-expense-card {
        font-size: 14px;
    }

    .selling-expenses-charts-grid {
        grid-template-columns: 1fr;
    }

    /* Sales invoice cards view on mobile */
    .sales-invoice-table-container {
        display: none;
    }

    .sales-invoice-cards-view {
        display: block;
    }

    .sales-invoice-card {
        font-size: 14px;
    }

    /* Pagination controls on mobile */
    .table-pagination-controls {
        flex-direction: column;
        gap: 10px;
        padding: 15px 0;
    }

    .pagination-btn {
        width: 100%;
        padding: 10px;
        font-size: 15px;
    }

    .pagination-info {
        font-size: 13px;
        text-align: center;
    }

    .table-pagination-info {
        font-size: 13px;
        text-align: center;
    }

    .cash-conversion-summary {
        grid-template-columns: 1fr;
    }

    .cash-conversion-charts-grid {
        grid-template-columns: 1fr;
    }

    .working-capital-charts-grid {
        grid-template-columns: 1fr;
    }
}

/* Tablet view - show table but make it scrollable */
@media (min-width: 769px) and (max-width: 1024px) {
    .vendor-table-container {
        border: 1px solid #dee2e6;
        border-radius: 8px;
    }

    .vendor-table {
        min-width: 900px;
    }

    .vendor-table th,
    .vendor-table td {
        padding: 10px 8px;
        font-size: 12px;
    }
}

