/* ----------------------------- */
/* GLOBAL STYLES */
/* ----------------------------- */
@font-face {
  font-family: 'CustomFont';
  src: url('/fonts/font.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

body {
  font-family: 'CustomFont', sans-serif !important;
}

/* Top Navbar Styles */
.top-navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #2e7d32;
  /* Xanh lá đậm */
  color: #ffffff;
  /* Màu chữ trắng */
  padding: 10px 20px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  /* Bóng đổ */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1100;
}

/* Language Switcher Styles */
.language-switcher {
  margin-right: 15px;
  position: relative;
}

.language-switcher select {
  padding: 5px 10px;
  border-radius: 5px;
  border: 1px solid #ccc;
  background-color: #ffffff;
  font-size: 14px;
  color: #333;
  cursor: pointer;
}

/* Adjust icon spacing */
.navbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}


/* System Info Section */
.system-info {
  display: flex;
  align-items: center;
  font-size: 16px;
}

.system-info i {
  margin-right: 10px;
  font-size: 20px;
  /* Kích thước biểu tượng */
}

.system-info .info-icon {
  width: 20px;
  height: 20px;
  object-fit: cover;
  /* Đảm bảo hình ảnh không bị méo */
  margin-right: 8px;
  /* Tạo khoảng cách giữa hình và text */
  vertical-align: middle;
  /* Căn chỉnh hình ảnh với text */
}

/* Notification Section */
.notification {
  position: relative;
  font-size: 20px;
  /* Kích thước biểu tượng */
  cursor: pointer;
}

/* Badge Notification */
.notification .badge {
  background-color: #e53935;
  /* Đỏ nhạt */
  color: #ffffff;
  /* Trắng */
  font-size: 12px;
  font-weight: bold;
  border-radius: 50%;
  padding: 5px 8px;
  position: absolute;
  top: 10px;
  right: 10px;
}

:root {
  --primary-color: #00422a;
  --hover-color: #052b35;
  --font-family: 'CustomFont', 'Poppins', Arial, sans-serif;
}

body {
  font-family: var(--font-family);
  margin: 0;
  display: flex;
}

/* ----------------------------- */
/* SIDEBAR */
/* ----------------------------- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 80px;
  background-color: var(--primary-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 25px;
  transition: width 0.3s ease;
  z-index: 1000;
}

.sidebar:hover {
  width: 120px;
}

.sidebar.open {
  width: 200px;
}

.sidebar i {
  font-size: 1.5rem;
  color: white;
}

.sidebar span {
  font-size: 0.85rem;
  color: white;
  text-align: center;
  margin-top: 5px;
}

/* Sidebar toggle button */
.menu-button {
  display: none;
  position: fixed;
  top: 15px;
  left: 15px;
  z-index: 1200;
}

.menu-button .toggle-btn {
  background-color: var(--primary-color);
  color: white;
  padding: 10px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

/* ----------------------------- */
/* MENU & SUBMENU */
/* ----------------------------- */
.menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.menu-item {
  text-align: center;
  position: relative;
}

.menu-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5px 0;
  color: white;
  text-decoration: none;
  font-size: 0.75rem;
}

.menu-link i {
  font-size: 1.5rem;
  margin-bottom: 5px;
}

.menu-link:hover {
  background-color: #fff;
}

.submenu {
  list-style: none;
  padding: 10px;
  margin: 0;
  background-color: var(--primary-color);
  position: absolute;
  left: 95px;
  top: 0;
  width: 300px;
  display: none;
  z-index: 1050;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  border-radius: 8px;
}

.submenu li {
  padding: 10px 15px;
  display: flex;
  align-items: center;
}

.submenu li a {
  display: flex;
  align-items: center;
  gap: 10px;
  /* Tạo khoảng cách giữa icon và text */
  color: white;
  text-decoration: none;
  font-size: 0.85rem;
}

.submenu li a i {
  font-size: 1.2rem;
}

.submenu li a:hover {
  color: #fff;
  /* var(--hover-color);*/
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.menu-item:hover .submenu {
  display: block;
}

/* ----------------------------- */
/* MAIN CONTENT AREA */
/* ----------------------------- */
.main-content {
  margin-left: 80px;
  padding: 25px;
  overflow-y: auto;
  height: 100vh;
  width: calc(100% - 80px);
}

.content-area {
  background-color: #ffffff;
  padding: 20px;
  overflow-y: auto;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
  box-sizing: border-box;
}

/* ----------------------------- */
/* RESPONSIVE STYLES */
/* ----------------------------- */
@media (max-width: 768px) {
  .sidebar {
    width: 0;
    overflow: hidden;
  }

  .sidebar.open {
    width: 250px;
  }

  .menu-button {
    display: block;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1000;
  }

  /* 
  .main-content {
    margin-left: 75px;
    transition: margin-left 0.3s ease;
  }

  .content-area {
    margin-left: 0;
    width: 100%;
  } */
}

/* ----------------------------- */
/* SIDEBAR (THANH MENU BÊN TRÁI) */
/* ----------------------------- */
.sidebar {
  position: fixed;
  /* Định vị cố định trên màn hình */
  top: 0;
  left: 0;
  height: 100%;
  /* Chiều cao chiếm toàn bộ màn hình */
  width: 80px;
  /* Chiều rộng mặc định khi chưa hover */
  background-color: var(--primary-color);
  /* Màu nền của Sidebar */
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Căn giữa các phần tử theo chiều ngang */
  padding-top: 25px;
  /* Khoảng cách phía trên */
  transition: all 0.3s ease;
  /* Hiệu ứng chuyển đổi */
}

.sidebar:hover {
  width: 120px;
  /* Tăng chiều rộng khi hover */
}

.sidebar i {
  font-size: 1.5rem;
  /* Kích thước biểu tượng */
  color: white;
  /* Màu biểu tượng */
}

.sidebar span {
  font-size: 0.85rem;
  /* Kích thước chữ */
  color: white;
  /* Màu chữ */
  text-align: center;
  /* Căn giữa chữ */
  margin-top: 5px;
  /* Khoảng cách phía trên */
}

.sidebar.closed {
  width: 0;
  /* Ẩn Sidebar */
  overflow: hidden;
  /* Ẩn nội dung bên trong */
}

.sidebar ul {
  margin: 0;
  padding: 0;
  list-style-type: none;
  /* Xóa dấu bullet */
}

.sidebar ul li {
  /* padding: 10px; */
  /* Khoảng cách bên trong mỗi mục */
}

/* NÚT BẬT/TẮT SIDEBAR - Định nghĩa chung */
.menu-button {
  display: none;
  /* Mặc định ẩn trên desktop */
  position: fixed;
  top: 15px;
  left: 15px;
  z-index: 1200;
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  width: 44px;
  height: 44px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Hiển thị button trên mobile */
@media (max-width: 767px) {
  .menu-button {
    display: flex !important;
    /* Ghi đè các định nghĩa khác */
    background-color: var(--primary-color);
    /* Thêm màu nền */
    border-radius: 4px;
    /* Bo góc */
  }

  /* Ẩn menu button trong sidebar khi đã có button fixed */
  .sidebar .menu-button {
    display: none !important;
  }
}

/* ----------------------------- */
/* MENU & SUBMENU */
/* ----------------------------- */
.menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.menu-item {
  text-align: center;
  position: relative;
  /* Để Submenu hiển thị tương đối */
}

.menu-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0;
  /* Khoảng cách giữa các mục menu */
  color: white;
  text-decoration: none;
  /* Xóa gạch dưới */
  font-size: 0.75rem;
}

.menu-link i {
  font-size: 1.5rem;
  /* Kích thước biểu tượng trong menu */
  margin-bottom: 5px;
}

.menu-link:hover {
  background-color: var(--hover-color);
  /* Màu nền khi hover */
}

/* SUBMENU */
.submenu {
  list-style: none;
  padding: 10px;
  margin: 0;
  background-color: var(--primary-color);
  /* Màu nền của Submenu */
  position: absolute;
  /* Định vị tương đối với menu */
  left: 95px;
  /* Khoảng cách từ Sidebar */
  top: 0;
  width: 240px;
  /* Chiều rộng Submenu */
  display: none;
  /* Chỉ hiển thị khi hover */
  z-index: 9999;
  /* Đảm bảo hiển thị trên các phần tử khác */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  /* Đổ bóng */
  border-radius: 8px;
  /* Bo góc */
  max-height: calc(100vh - 20px);
  /* Giới hạn chiều cao Submenu */
  overflow-y: auto;
  /* Thêm cuộn khi Submenu dài */
  transform: translateY(5px);
  /* Move it slightly down */
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.menu-item:hover .submenu {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.submenu li {
  padding: 10px 15px;
  display: flex;
  align-items: center;
}

.submenu li a {
  display: flex;
  align-items: center;
  gap: 10px;
  /* Khoảng cách giữa biểu tượng và text */
  color: white;
  text-decoration: none;
  font-size: 0.85rem;
}

.submenu li a i {
  font-size: 1.2rem;
}

.submenu li a:hover {
  color: #ffd441;
  /* Màu chữ khi hover */
  background-color: rgba(255, 255, 255, 0.1);
  /* Nền khi hover */
  border-radius: 4px;
}

.menu-item:hover .submenu {
  display: block;
  /* Hiển thị Submenu khi hover */
}

/* ----------------------------- */
/* RESPONSIVE STYLES */
/* ----------------------------- */
@media (max-width: 768px) {
  .sidebar {
    /* transform: translateX(-100%); */
    /* Ẩn Sidebar */
  }

  .sidebar.open {
    transform: translateX(0);
    /* Hiển thị Sidebar */
  }
}

/* ----------------------------- */
/* RESPONSIVE Footer-Menu */
/* ----------------------------- */
.footer-menu {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  /* Chiếm toàn bộ chiều rộng */
  background-color: #fff;
  /* Nền trắng */
  box-shadow: 0px -1px 5px rgba(0, 0, 0, 0.1);
  /* Đổ bóng nhẹ */
  display: flex;
  justify-content: space-around;
  /* Cách đều các mục trong Footer */
  align-items: center;
  padding: 10px 0;
}

.footer-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #333;
  border: none;
  background: none;
  cursor: pointer;
}

.footer-btn i {
  font-size: 20px;
  /* Kích thước biểu tượng trong Footer */
  margin-bottom: 5px;
  color: var(--primary-color);
  /* Màu biểu tượng */
}

.footer-btn span {
  font-size: 12px;
  /* Kích thước chữ trong Footer */
  color: #333;
}


.datepicker-dropdown {
  position: absolute;
  background-color: #fff;
  border: 1px solid #ccc;
  box-shadow: 3px 3px 3px #ccc;
}

.select2-container {
  width: 100% !important;
  padding: 0.6rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
}

.thuyenchuyen .select2-container {
  width: 250px !important;
  min-width: 150px;
}

.select2-selection {
  border: unset !important;
}

.select2-selection__arrow {
  top: 10px !important;
}


.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

/* Hide default HTML checkbox */
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* The slider */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  -webkit-transition: .4s;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  -webkit-transition: .4s;
  transition: .4s;
}

input:checked+.slider {
  background-color: #2196F3;
}

input:focus+.slider {
  box-shadow: 0 0 1px #2196F3;
}

input:checked+.slider:before {
  -webkit-transform: translateX(26px);
  -ms-transform: translateX(26px);
  transform: translateX(26px);
}

/* Rounded sliders */
.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

@media (max-width: 767px) {
  .sidebar {
    position: fixed;
    width: 100%;
    height: 100vh;
    padding-top: 60px;
    /* Để tránh bị che bởi navbar */
    overflow-y: auto;
  }

  .menu {
    width: 100%;
  }

  .menu-item {
    width: 100%;
    text-align: left;
    /* Căn trái thay vì center */
  }

  .menu-link {
    flex-direction: row;
    /* Chuyển từ column sang row */
    justify-content: flex-start;
    /* Căn trái */
    align-items: center;
    padding: 12px 15px;
    gap: 15px;
    /* Khoảng cách giữa icon và text */
  }

  .menu-link i {
    margin-bottom: 0;
    /* Bỏ margin bottom của icon */
    width: 24px;
    /* Đặt chiều rộng cố định cho icon */
    text-align: center;
  }

  .menu-link span {
    margin-top: 0;
    /* Bỏ margin top của text */
  }

  .submenu {
    position: relative;
    left: 0;
    top: 0;
    width: 100%;
    box-shadow: none;
    background-color: rgba(0, 0, 0, 0.1);
  }

  .submenu li {
    padding: 0;
  }

  .submenu li a {
    padding: 12px 15px 12px 53px;
    /* Thụt vào so với menu cha */
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  /* Chỉnh sửa arrow icon */
  .menu-item:has(.submenu)>.menu-link:after {
    content: '\f107';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    right: 15px;
    transition: transform 0.3s;
  }

  .menu-item.active>.menu-link:after {
    transform: rotate(180deg);
  }

  /* Bỏ các hiệu ứng hover không cần thiết trên mobile */
  .sidebar:hover {
    width: 100%;
  }

  .menu-item:hover .submenu {
    display: none;
    /* Tắt hover effect */
  }

  .menu-item.active .submenu {
    display: block;
  }

  /* Hamburger Menu Button */
  .menu-button {
    display: block;
    position: fixed;
    top: 0;
    left: 15px;
    z-index: 1200;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 10px;
    width: 44px;
    /* Thêm kích thước cố định */
    height: 44px;
    /* Thêm kích thước cố định */
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Sidebar */
  .sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    /* Ẩn sidebar ban đầu */
    height: 100vh;
    width: 300px;
    max-width: 80vw;
    background-color: var(--primary-color);
    padding-top: 60px;
    overflow-y: auto;
    transition: left 0.3s ease;
    z-index: 1100;
  }

  /* Class open cho sidebar */
  .sidebar.open {
    left: 0;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.4);
  }

  /* Overlay khi sidebar mở */
  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1050;
  }

  .sidebar-overlay.show {
    display: block;
  }

  /* Ẩn menu button trong sidebar khi đã có button fixed */
  .sidebar .menu-button {
    display: none;
  }

  /* Đảm bảo main content không bị đè */
  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    padding-top: 25px;
  }

  .system-info {
    margin-left: 50px !important;
  }
}


/**Tooltip*/
.tooltip {
  position: relative;
  display: inline-block;
  cursor: pointer;
  width: 100%;
}

/* Tooltip text */
.tooltip .tooltiptext {
  visibility: hidden;
  width: 100%;
  background-color: black;
  color: #fff;
  text-align: center;
  padding: 5px;
  border-radius: 6px;

  /* Position the tooltip text - see examples below! */
  position: absolute;
  z-index: 1;
  margin-left: 1rem;
}

/* Show the tooltip text when you mouse over the tooltip container */
.tooltip:hover .tooltiptext {
  visibility: visible;
}

@media print {
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Remove page margins completely */
  @page {
    size: 80mm 120mm;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Reset body and html for print */
  body,
  html {
    margin: 0 !important;
    padding: 0 !important;
    width: 80mm !important;
    height: 120mm !important;
    background: #fff !important;
    font-size: 10px !important;
    line-height: 1.2 !important;
    overflow: hidden !important;
  }

  /* Hide everything first */
  * {
    visibility: hidden !important;
    page-break-after: avoid !important;
    page-break-before: avoid !important;
    page-break-inside: avoid !important;
  }

  /* Show only #printdiv and its children */
  #printdiv,
  #printdiv * {
    visibility: visible !important;
    display: block !important;
  }

  /* Position #printdiv at the very top and remove all spacing */
  #printdiv {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: auto !important;
    max-height: 120mm !important;
    margin: 0 !important;
    padding: 2px !important;
    font-size: 10px !important;
    line-height: 1.1 !important;
    box-sizing: border-box !important;
    background: white !important;
    overflow: hidden !important;
    page-break-inside: avoid !important;
    page-break-after: avoid !important;
    page-break-before: avoid !important;
  }

  /* Hide images completely */
  #printdiv img,
  #printdiv .hidden-print {
    display: none !important;
    visibility: hidden !important;
  }

  /* Optimize text sizing for POS printer */
  #printdiv p {
    margin: 2px 0 !important;
    padding: 0 !important;
  }

  #printdiv .text-3xl {
    font-size: 16px !important;
  }

  #printdiv .text-xl {
    font-size: 14px !important;
  }

  #printdiv .text-lg {
    font-size: 12px !important;
  }

  #printdiv .text-base {
    font-size: 10px !important;
  }

  #printdiv .text-sm {
    font-size: 9px !important;
  }

  /* Remove spacing from containers */
  #printdiv .space-y-6>*+* {
    margin-top: 4px !important;
  }

  #printdiv .space-y-3>*+* {
    margin-top: 2px !important;
  }

  /* Compact the room info section */
  #printdiv .bg-gray-50 {
    background: transparent !important;
    padding: 4px !important;
    margin: 4px 0 !important;
  }

  #printdiv .bg-white {
    background: transparent !important;
    border: 1px solid #000 !important;
    padding: 4px !important;
  }
}

/* ----------------------------- */
/* SWEETALERT Z-INDEX FIX */
/* ----------------------------- */
/* Ensure SweetAlert appears above modals and select2 dropdowns */
.swal2-container {
  z-index: 99999 !important;
}

.swal2-backdrop-show {
  z-index: 99998 !important;
}

/* Also ensure select2 dropdowns don't interfere */
.modal-content .select2-container {
  z-index: 10000 !important;
  max-width: 42rem;
}

.modal-content .select2-dropdown {
  z-index: 10001 !important;
}