* {
    margin: 0; padding: 0; box-sizing: border-box;
  }
.font-weight--bold {
    font-weight: bold;
  }
.text-left {
  text-align: left !important;
}
  /* Reset mặc định và tối ưu hiển thị */
html {
  font-size: 14px; /* Mặc định: mobile-first */
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

/* Tablet (≥ 768px) */
@media (min-width: 768px) {
  html {
    font-size: 15px;
  }
}

/* Desktop (≥ 1024px) */
@media (min-width: 1024px) {
  html {
    font-size: 16px;
  }
}

/* Màn hình lớn hơn (≥ 1440px) */
@media (min-width: 1440px) {
  html {
    font-size: 17px;
  }
}

/* Font body & table chuẩn theo `rem` */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Segoe UI", Roboto, sans-serif;
  font-size: 1rem; /* tương ứng với html -> dễ thay đổi */
  color: #333;
  line-height: 1.6;
  /* background: linear-gradient(120deg, #f0f7fa 40%, #e3f2fd 100%);
  background-color: #eaf6ff; */

   /* background: linear-gradient(105deg, #1a83d9 0%, #23b5d8 40%, #fff6e0 100%);*/

   background: linear-gradient(110deg,
        #3a9ef0 0%,         
        #a2e8fa 10%,       
        #f8eddd 38%,       
        #ffe5c6 62%,        
        #f8f4e7 100%       
    );

}

table {
  font-size: 0.95rem;
}
  
  h1, h2, h3, h4, h5, h6 {
    margin-bottom: 10px;
  }
  
  a {
    text-decoration: none;
    color: #007bff;
  }
  
  a:hover {
    text-decoration: underline;
  }
  /* ------------------------------------------------ */
.center-logo-wrap {
    width: 100%;
    text-align: center;
    margin-top: 2.5rem;
    margin-bottom: 1.2rem;
}
.center-logo {
    max-width: 250px;
    height: auto;
    filter: drop-shadow(0 2px 18px #1950982a);
    transition: transform 0.16s;
}
.center-logo:hover { transform: scale(1.04); }
@media (max-width: 480px) {
    .center-logo-wrap { margin-top: 1.3rem; margin-bottom: 0.7rem;}
    .center-logo { max-width: 120px;}
}
  /* ------------------------------------------------ */
.btn-disabled {
      background-color: #e0e0e0 !important;
      border-color: #ccc !important;
      color: #888 !important;
      cursor: not-allowed;
    }
  /* Clearfix for floated elements */
  .clearfix::after {
    content: "";
    clear: both;
    display: table;
  }
  .grid-columns {
    width: 100%;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
  }
  .grid-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  /* massage alert */
  .message-container {
  margin-top: 20px;
}

.alert {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 10px;
  font-weight: 500;
  font-size: 15px;
  line-height: 1.4;
  border: 1px solid transparent;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  opacity: 1;
  transition: opacity 0.5s ease;
}

/* Success */
.alert.success {
  background-color: #d4edda;
  color: #155724;
  border-color: #c3e6cb;
}

/* Error */
.alert.error {
  background-color: #f8d7da;
  color: #721c24;
  border-color: #f5c6cb;
}

/* Info */
.alert.info {
  background-color: #d1ecf1;
  color: #0c5460;
  border-color: #bee5eb;
}

/* Warning */
.alert.warning {
  background-color: #fff3cd;
  color: #856404;
  border-color: #ffeeba;
}


  /* Form elements */
  form .row {
    margin-bottom: 15px;
  }
  select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    background-color: #fdfdfd;
    color: #333;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    appearance: none; /* Ẩn style mặc định trên Safari/Chrome */
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%204%205'%3E%3Cpath%20fill='gray'%20d='M2%200L0%202h4L2%200zM2%205L0%203h4L2%205z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 8px 10px;
  }
  
  select:focus {
    border-color: #66afe9;
    box-shadow: 0 0 4px rgba(102, 175, 233, 0.6);
    outline: none;
  }
  label.font-weight--bold {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    color: #2c3e50;
  }
  .form-row.form-inline {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
  }

  .form-input {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    width: 100px;
  }
  
  
  .form-label {
    font-weight: 600;
    margin-right: 10px;
    min-width: 160px; /* tuỳ chỉnh cho chiều dài nhãn */
    color: #2c3e50;
  }
  
  .form-select {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    background-color: #fdfdfd;
    min-width: 120px;
    width: auto;
  }
  
  /* Fix dark mode */
  body.dark {
    background-color: #121212;
    color: #f0f0f0;
  }
  
  body.dark input,
  body.dark textarea {
    background-color: #1e1e1e;
    color: #f0f0f0;
    border-color: #444;
  }
  /* DARK MODE SUPPORT */
body.dark .patient-list {
    background-color: #1e1e2e;
    border-color: #333;
    }
    
    body.dark .patient-filter {
    background-color: #2a2a3c;
    border-color: #555;
    color: #eee;
    }
  body.dark .patient-item {
    background-color: #2a2a2a;
    color: #f0f0f0;
  }
  
  body.dark .note-item {
    background-color: #333;
    color: #fff;
  }
  body.dark .form-title {
    color: #e0e0e0;
    }
.btn-clear-form:hover {
    background-color: #d32f2f;
}
/* Dark mode hỗ trợ */
body.dark .btn-clear-form {
    background-color: #c0392b;
  }
  
  body.dark .btn-clear-form:hover {
    background-color: #a93226;
  }
  body.dark .form-container {
    background-color: #2c2c2c;
  }
  body.dark .checkbox-group-box {
    background-color: #333;
    border-color: #555;
  }
  body.dark .radio-item:hover {
    background-color: #2d3748;
    color: #a0cfff;
    border-color: #4a5568;
    box-shadow: 0 0 8px rgba(160, 207, 255, 0.2);
  }
  
  body.dark .radio-item input:checked + span {
    color: #a0cfff;
    font-weight: 600;
  }
  body.dark .complaint-table th,
body.dark .complaint-table td {
  border-color: #555;
}
  /* Dark mode support (optional) */
  body.dark .radio-item {
    color: #ddd;
  }
  
body.dark .note-box {
    background-color: #2a3244;
    border-left-color: #7aa5ff;
    color: #fff;
  }
  
body.dark .note-item {
    background-color: #444;
    color: #f5f5f5;
  }
  
  body.dark .note-item:hover {
    background-color: #555;
  }
  .wrapper {
    min-height: 100vh;
  }


/* Patient List */
.patient-list {
  background-color: #f9f9f9;
  border-right: 1px solid #ddd;
  padding: 16px;
  width: 100%;
  max-width: 280px;
  overflow-y: auto;
  height: calc(100vh - 60px);
  transition: background-color 0.3s, color 0.3s;
}

.patient-filter {
width: 100%;
padding: 8px 12px;
margin-bottom: 12px;
border-radius: 6px;
border: 1px solid #ccc;
}

.patient-items {
list-style: none;
padding: 0;
margin: 0;
}

.patient-item {
padding: 10px 12px;
margin-bottom: 6px;
background-color: #fff;
border-radius: 6px;
cursor: pointer;
transition: background-color 0.2s;
}

.patient-item:hover {
background-color: #8cc2f5;
}

.patient-name {
font-weight: 600;
font-size: 16px;
}

.patient-meta {
font-size: 14px;
color: #666;
}

  /* Main Form Area */
  .form-header {
    position: relative;
    text-align: center;
    margin-bottom: 25px;
    padding: 0 48px; /* tạo khoảng cách cho nút */
}
.form-body {
  max-width: 1400px;
}
.form-title {
    font-size: 24px;
    color: #1976d2;
    font-weight: bold;
    display: inline-block;
}
#print-container {
  display: none !important;
}
/* Nút nằm bên phải */
.btn-clear-form {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background-color: #f44336;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.2s ease;
}

.btn-clear-form:hover {
    background-color: #d32f2f;
}


  .content {
    flex: 1;
    padding: 20px 40px;
  }

  .form-group label {
    display: inline-block;
    margin-top: 12px;
    font-weight: bold;
  }

  .form-group input, .form-group textarea {
    width: auto;
    padding: 8px;
    margin-top: 4px;
    border: 1px solid #ccc;
    border-radius: 4px;
  }

  button.btn-print {
    padding: 10px 20px;
    background-color: #28a745;
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
  }

  button.btn-print:hover {
    background-color: #218838;
  }

  .tooth-table {
    border-collapse: collapse;
    margin-top: 15px;
    width: 100%;
  }

  .tooth-table th, .tooth-table td {
    border: 1px solid #ccc;
    text-align: center;
    padding: 4px;
  }

  .notations-box {
    background-color: #f0f8ff;
    border: 1px solid #bcd;
    padding: 15px;
      border-radius: 8px;
      margin-top: 20px;
    }

    .notations-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 15px;
    }

    .notations-grid ul {
      list-style: none;
      padding-left: 0;
      margin: 0;
    }
    
    .checkbox-group label {
      margin-right: 15px;
    }
    

.form-container {
  max-width: 1400px;
  margin: 0 auto;
  background-color: #fff;
  border-radius: 8px;
}
.flex-1 {
  display: flex;
  flex: 1;
}
.overflow-x-auto {
  overflow-x: auto;
}
@media (max-width: 967.98px) {
  .form-container {
    padding: 10px;
  }
}
@media (min-width: 1024px) {
  .form-container {
    padding: 20px;
  }
}

.form-row {
  display: flex;
  gap: 20px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.form-group {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 180px;
}

input, textarea {
  padding: 8px;
  font-size: 15px;
  border-radius: 4px;
  border: 1px solid #ccc;
  background: #fff;
  color: #000;
}

button[type="submit"]:not(.btn) {
  padding: 10px 20px;
  background-color: #007bff;
  border: none;
  color: #fff;
  font-size: 16px;
  border-radius: 5px;
  cursor: pointer;
}

button:hover {
  background-color: #0056b3;
}
/* PHÂN LOẠI MẤT RĂNG */
.checkbox-group-box {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    padding: 8px 0;
    font-size: 17px;
}
.checkbox-group-box {
    width: auto;
}

.radio-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 80px;
  cursor: pointer;
}
.radio-item:hover {
  background-color: #f0f4ff;
  color: #1a3b8b;
  border-color: #a4c0ff;
  box-shadow: 0 0 6px rgba(85, 150, 255, 0.3);
}

/* Active state (selected) */
.radio-item input:checked + span {
  font-weight: 600;
  color: #1a3b8b;
}

.inline-radio-group {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 10px;
  }

  .inline-radio-group label {
    margin: 0;
    white-space: nowrap;
  }
/* SỨC NHAI input */
input[type="number"] {
  width: 100%;
  max-width: 120px;
}
.checkbox-group-inline {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.complaint-table {
  width: 100%;
  border-collapse: collapse;
}

.complaint-table th,
.complaint-table td {
  border: 1px solid #ccc;
  padding: 2px 2px 6px 2px;
  margin: 0px !important;
  text-align: center;
}


.complaint-table td input {
width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 4px;
  font-size: 14px;
  text-align: center;
  border: 1px solid #ccc;
  border-radius: 4px;
  }

.complaint-table td input:focus {
    background-color: #e8f0fe;
    border: 1px solid #4285f4;
  }

  .note-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.note-header h4 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.auto-fill-btn {
  padding: 6px 12px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.auto-fill-btn:hover {
  background-color: #0056b3;
}

.note-box {
  margin: 20px 0;
  padding: 20px;
  background-color: #f4f7fb;
  border-left: 4px solid #4285f4;
  border-radius: 8px;
  max-width: 100%;
}

.note-box h4 {
  margin-bottom: 12px;
  font-weight: 600;
}

.note-three-columns {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.note-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.note-column:second-child {
  padding: 0px 15px
}
.note-item {
  background-color: #f9f9f9;
  border-left: 4px solid #007bff;
  border-radius: 4px;
  font-size: 14px;
  transition: background-color 0.2s ease;
  cursor: default;
}

.note-item:hover {
  background-color: #e6f0ff;
}



.note-columns {
  display: flex;
  gap: 30px;
}

.note-columns ul {
  list-style: none;
  padding-left: 0;
}
.note-item {
    width: 100%;
  display: inline-block;
  margin: 6px 10px;
  padding: 6px 10px;
  background-color: #f2f2f2;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

.note-item:hover {
  background-color: #d0e6ff;
  transform: scale(1.05);
}


.dark-toggle {
  text-align: right;
  margin-bottom: 10px;
}

/* nút xóa dữ liệu form */
.btn-clear-form {
  background-color: #f44336;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s;
}

input.highlight-nonzero {
  background-color: #fff8dc; /* màu vàng nhạt */
}

input.highlight-empty {
  background-color: #f0f0f0; /* xám nhạt */
}
/******************/
/* Định dạng cho các nút (pathology) */
/******************/
/* spinner */
.spinner-border {
    width: 1rem;
    height: 1rem;
    vertical-align: middle;
}
.status-msg {
  transition: all 0.5s ease;
  font-weight: bold;
}
/* màu nền trạng thái bình thường/bất thường*/
.bg-success {
 background-color: #93fd90;
}
.bg-success.bg-opacity-10 {
  background-color: rgba(25, 135, 84, 0.1) !important;
}
.bg-danger {
  background-color: #ffd2d2;
}
.bg-danger.bg-opacity-10 {
  background-color: rgba(220, 53, 69, 0.1) !important;
}
.transition-bg {
  transition: background-color 0.5s ease, border-color 0.5s ease;
}
/********************** SIDEBAR *************************/
.sidebar {
  width: 220px;
  background-color: #2c3e50;
  color: white;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  padding: 1rem;
  transition: transform 0.3s ease, width 0.3s ease;
  overflow-x: hidden;
  z-index: 1000;
}

.sidebar.collapsed {
  width: 60px;
}

.toggle-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #2c3e50;
  margin-bottom: 1rem;
  cursor: pointer;
}

.menu {
  list-style: none;
  padding: 0;
  margin-top: 1rem;
}

.menu li a {
  color: white;
  text-decoration: none;
  display: block;
  padding: 0.5rem 0;
  transition: opacity 0.3s ease;
}

.sidebar.collapsed .menu li a {
  display: none;
  /* height: 0; */
  overflow: hidden;
  padding: 0;
}
.sidebar.collapsed .user-actions {
  display: none;
}

.user-actions {
  margin-top: 2rem;
}

.user-info, .logout-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: white;
  font-size: 0.9rem;
  text-decoration: none;
}
.user-info a:hover {
  color: #ecf0f1;
  text-decoration: none;
}

/* MAIN CONTENT responsive theo sidebar */
.main-content {
  /* margin-left => JS toggle */
  transition: margin-left 0.3s ease;
  padding: 1rem;
}

/* ===== responsive sidebar / topbar ===== */
@media (max-width: 1023px) {
  .sidebar {
    display: none;
    transform: translateX(0);
    transition: transform .23s;
  }
  .sidebar.active {
    display: block;
    transform: translateX(0);
  }
  .sidebar.collapsed {
    display: block;
    transform: translateX(-100%);
  }
  .main-content.shifted {
    margin-left: 0;
  }
  .wrapper {
    padding-top: 40px;
  }
}
@media (min-width: 1024px) {
  .sidebar {
    width: 220px;
    transition: width 0.23s;
  }
  .sidebar.collapsed {
    width: 60px;
  }
  .main-content {
    margin-left: 220px;
    transition: margin-left 0.23s;
  }
}

/* Khi sidebar thu gọn */
.sidebar.collapsed + .main-content {
  margin-left: 60px; 
}

/************************ Modal Overlay + Animation CRM ********************************/
/* Overlay mờ toàn màn hình */
.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background-color: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.25s;
  opacity: 1;
}
.modal-overlay.hide {
  opacity: 0;
  pointer-events: none;
}
.modal-dialog {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.2);
  position: relative;
  padding: 1.5rem 1.25rem;
  font-size: 1rem;         
  animation: slideUpFadeIn 0.33s cubic-bezier(.42,0,.58,1);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  z-index: 9999;
  pointer-events: visible;
}

.modal-dialog--popup {
  min-width: 260px;     
  max-width: 600px;      
  max-height: 400px;  
}

.modal-dialog--list {
  min-width: 450px;     
  max-width: 800px;      
  min-height: 90vh;
}
@media (max-width: 767px) {
  .modal-dialog--popup {
    padding: 1rem 0.5rem;
    font-size: 0.97rem;
    width: 350px;
    max-width: 600px;
    border-radius: 0;
    max-height: 400px;
  }
  .modal-header {
    font-size: 14px;
    padding: 0.7rem 1rem;
  }
}
@media (min-width: 768px) {
  .modal-dialog--popup {
    width: 350px;
    max-width: 600px;
  }
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #a8f0c6;
  color: black;
  padding: 1rem;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}
.modal-body {
  font-size: 14px;
  padding: 1rem 0.5rem 0.5rem 0.5rem;
  max-height: 75vh;
  overflow-y: auto;
}
.modal-body .nav-link:focus, .nav-link:hover {
  color: white;
  text-decoration: none;
}
.modal-body .nav-link.active {
  color: rgb(46, 46, 218);
  font-size: 600;
  text-decoration: none;
}
.modal-close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  margin-left: 1rem;
  line-height: 1;
}
@keyframes slideUpFadeIn {
  from { transform: translateY(60px) scale(0.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

/* Buttons */
.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.btn-confirm {
    background-color: #2ecc71;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    margin: 0 auto;
    border-radius: 5px;
    cursor: pointer;
}

.btn-cancel {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
}

.btn-cancel:hover {
    background-color: #c0392b;
}

.container {
    max-width: 1800px;
    margin: 0 auto;
}
@media (max-width: 967.98px) {
  .container {
    margin: 0px auto 60px auto;
    padding: 20px 16px;
  }
}
@media (min-width: 968px) {
  .container {
    margin: 40px auto 60px auto;
    padding: 0px 16px;
  }
}

.patient-greeting {
    text-align: center;
    font-size: 0.95rem;
    color: #34495e;
    font-weight: 500;
    margin-top: 10px;
}

.date-selector {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
    font-size: 0.95rem;
}

    .messages {
    list-style: none;
    padding: 0;
}

.messages li {
    font-weight: 500;
    padding: 8px;
    border-radius: 4px;
    background-color: #f5f5f5;
}
.company-name {
    margin: 6px;
    font-size: 16px;
    color: #333;
}

.btn-exit {
  display: inline-block;
  margin: 15px auto;
  padding: 8px 16px;
  background-color: #f7bbbb;
  color: #000;
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
  transition: background-color 0.2s;
}

.btn-exit:hover {
    background-color: #aaa;
}

/**** TOPBAR ****/
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.16);
    padding: 0px 16px;
    min-height: 56px;
}

.topbar-logo {
    height: 60px;
    width: auto;
    object-fit: contain;
}

.topbar-left,
.topbar-center,
.topbar-right {
    flex: 1;
    display: flex;
    align-items: center;
}

.topbar-left {
    justify-content: flex-start;
}

.topbar-center {
    font-weight: 700;
    background: linear-gradient(90deg, #1a83d9 0%, #23d2d7 100%);
    color: transparent;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 1px;
    line-height: 1.25;
    text-shadow: 0 2px 8px rgba(44,168,224,0.07);
    user-select: none;
    margin-left: 12px;
    margin-right: 12px;
    justify-content: center;
    align-items: center;
    min-height: 48px;
    background-size: 200% auto;
    animation: gradientMove 3s linear infinite;
}

.topbar-right {
    justify-content: flex-end;
    gap: 12px;
}
.topbar-account {
    position: relative;
    display: inline-block;
}
.account-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    outline: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.account-btn:hover, .account-btn.active {
    background: #f1f5fa;
}
.account-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 48px;
    min-width: 170px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(60,72,100,.18);
    z-index: 100;
    padding: 7px 0;
    text-align: left;
}
.account-menu a {
    display: block;
    padding: 13px 22px;
    color: #222;
    text-decoration: none;
    font-size: 16px;
    border: 0;
    background: none;
    transition: background 0.15s, color 0.15s;
}
.account-menu a:hover {
    background: #f0f6ff;
    color: #2563eb;
}
.topbar-account.open .account-menu {
    display: block;
}
.topbar-account {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.topbar-account .patient-name {
    font-size: 14px;
    color: #25334b;
    font-weight: 550;
    letter-spacing: 0.2px;
    margin-right: 4px;
    white-space: nowrap;
    width: auto;
    text-shadow: 0 1px 1px #f1f1f7;
    transition: color 0.18s;
    user-select: none;
}

.topbar-account .patient-name:hover {
    color: #1976d2;
    cursor: pointer;
}

@keyframes gradientMove {
    0% {background-position: 0% 50%;}
    100% {background-position: 100% 50%;}
}

@media (max-width: 768px) {
    .topbar-center {
        display: none;
    }
}

@media (min-width:980px) {
    .topbar-center {
        font-size: 16px;
        padding: 3px 0;
    }
}

@media (min-width: 769px) {
    .topbar-center {
        font-size: 14px;
        padding: 3px 0;
    }
}

@media (min-width:1024px) {
    .topbar-center {
        font-size: 24px;
        padding: 3px 0;
    }
}

.topbar-title {
    font-size: 1.2rem;
    font-weight: 500;
    color: #1166cc;
    text-decoration: none;
    transition: color .2s;
}

.topbar-title:hover {
    color: #0a9621;
    text-decoration: none;
}

.topbar-exit-btn {
    background: #f44336;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 6px 18px;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: background .2s;
}
.topbar-exit-btn:hover {
    background: #c62828;
}
.topbar-desktop {
  display: flex;
}

@media (max-width: 600px) {
    .topbar-logo { height: 30px; }
    .topbar-title { font-size: 1rem; }
    .topbar-exit-btn { padding: 5px 12px; font-size: .95rem;}
}
/* ===== responsive sidebar / topbar ===== */
@media (max-width: 1023px) {
  .sidebar {
    display: none;
    transform: translateX(0);
    transition: transform .23s;
  }
  .sidebar.active {
    display: block;
    transform: translateX(0);
  }
  .sidebar.collapsed {
    display: block;
    transform: translateX(-100%);
  }
  .main-content.shifted {
    margin-left: 0;
  }
  .wrapper {
    padding-top: 40px;
  }
  .topbar-admin {
    display: flex;
  }
}
@media (min-width: 1024px) {
  .sidebar {
    display: block;
  }
  .main-content {
    margin-left: 220px;
  }
  .topbar-admin {
    display: none;
  }
}

.topbar-healthrecord-btn {
    padding: 6px 12px;
    background-color: #c2e2f9;
    border-radius: 8px;
    text-decoration: none;
    color: #0366d6;
    font-weight: 500;
}

.topbar-healthrecord-btn:hover {
    background-color: #2f7fb8;
    color: white;
}


/* Khi sidebar thu gọn */
.sidebar.collapsed + .main-content {
  margin-left: 60px; 
}


/**** FOOTER ****/
.site-footer {
    background: linear-gradient(120deg, #f5faff 75%, #e5f4fa 100%);
    border-top: 1.5px solid #E8F3FF;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 0 18px 0 rgba(30,132,200,0.07);
    padding: 24px 18px 20px 18px;
    font-size: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 32px;
    max-width: 90%;
    margin: 0 auto 0 auto;
    flex-wrap: wrap;
}

.footer-left {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    max-width: 68%;
    min-width: 200px;
}
.footer-logo {
    max-width: 150px;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 8px 0 rgba(100,130,170,0.07);
}

.footer-info {
    line-height: 1.52;
    color: #23405a;
    font-size: 1rem;
}
.footer-title {
    font-weight: bold;
    font-size: 1.4em;
}
.footer-subname {
    font-size: 1em;
    color: #1954a1;
    font-weight: 500;
    margin-bottom: 20px;
    letter-spacing: 0.04em;
    opacity: 0.85;
}

.text-orange { color: #f37021; font-weight: bold; }
.footer-info a { color: #2471c8; text-decoration: none; }
.footer-info a:hover { text-decoration: underline; }

.footer-right {
    display: flex;
    gap: 30px;
    justify-content: flex-end;
    align-items: flex-start;
    min-width: 140px;
}

.qr-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}
.footer-qr {
    width: 82px;
    height: 82px;
    border-radius: 10px;
    background: #fafafa;
    border: 1.5px solid #eef2f7;
    object-fit: contain;
    margin-bottom: 7px;
    box-shadow: 0 2px 8px 0 rgba(0,70,180,0.05);
}
.qr-caption {
    font-size: 1.01em;
    font-weight: 600;
    letter-spacing: 0.03em;
    margin-top: 1px;
}
.website-caption { color: #1166cc; }
.zalo-caption { color: #008ae6; }

/* Mobile responsive */
@media (max-width: 768px) {
    .site-footer {
        flex-direction: column;
        align-items: stretch;
        max-width: 98vw;
        padding: 16px 3vw 7px 3vw;
        border-radius: 13px 13px 0 0;
        gap: 12px;
    }
    .footer-left, .footer-right {
        max-width: 100%;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 8px;
    }
    .footer-logo { max-width: 150px; height: auto;}
    .footer-info { font-size: 0.98em; text-align: center; }
    .footer-right {
        margin-top: 10px;
        gap: 24px;
        flex-direction: row;
        justify-content: center;
    }
    .footer-qr { width: 62px; height: 62px;}
}


/* Mobile responsive */
@media (max-width: 768px) {
    .site-footer {
        flex-direction: column;
        align-items: stretch;
        max-width: 98vw;
        padding: 16px 3vw 7px 3vw;
        border-radius: 13px 13px 0 0;
        gap: 12px;
    }
    .footer-left, .footer-right {
        max-width: 100%;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 8px;
    }
    .footer-logo { max-width: 150px; height: auto;}
    .footer-info { font-size: 0.98em; text-align: center; }
    .footer-right {
        margin-top: 10px;
        gap: 24px;
        flex-direction: row;
        justify-content: center;
    }
    .footer-qr { width: 62px; height: 62px;}
}

/* ---------------------------------------------- */
/* ------------------------------------------- */
.overlay-fullscreen {
    position: fixed;
    inset: 0; /* top: 0; left: 0; bottom: 0; right: 0; */
    width: 100vw;
    height: 100vh;
    background: rgba(56, 87, 145, 0.18); /* xanh tím nhạt, có thể điều chỉnh */
    z-index: 999;
    backdrop-filter: blur(2px);
}

.thank-you-container {
    max-width: 94vw;
    width: 450px;
    margin: 80px auto;
    text-align: center;
    font-family: Arial, sans-serif;
    background: #fff;
    padding: 2.2rem 1.4rem 1.5rem 1.4rem;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(50,70,110,0.17), 0 0 0 1.2px #e3e6ed;
}

.thank-you-container h2 {
    color: #2ecc71;
    font-size: 1.33rem;
    margin-bottom: 1rem;
}
.thank-you-container ul {
    list-style: none;
    padding: 0;
    margin-top: 1rem;
}
.thank-you-container li {
    padding: 0.5rem;
    font-size: 1.03rem;
}
.back-button {
    display: inline-block;
    margin-top: 2rem;
    padding: 0.63rem 1.3rem;
    background: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 7px;
    font-weight: 600;
    letter-spacing: 0.06em;
    box-shadow: 0 1px 8px 0 #b5deff4d;
    transition: background 0.2s, transform 0.15s;
}
.back-button:hover {
    background: #2980b9;
    transform: scale(1.035);
}

@media (max-width: 500px) {
    .thank-you-container {
        width: 95vw;
        padding: 1.1rem 0.5rem 1.1rem 0.5rem;
    }
}

/* -------------------------- */
.django-messages {
    position: fixed;
    top: 26px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    min-width: 290px;
    max-width: 90vw;
}
.django-messages .msg {
    padding: 14px 24px;
    border-radius: 7px;
    margin-bottom: 8px;
    background: #e7ffe7;
    color: #137613;
    font-weight: 600;
    font-size: 1.05em;
    box-shadow: 0 2px 10px rgba(51,100,51,0.11);
    text-align: center;
    border: 1.5px solid #c0f7c0;
    opacity: 1;
    transition: opacity 0.7s;
}
.django-messages .success, .django-messages .msg.success {
    background: #e7ffe7;
    color: #137613;
    border-color: #c0f7c0;
}
.django-messages .error, .django-messages .msg.error {
    background: #fff3f3;
    color: #c73737;
    border-color: #ffd7d7;
}
.error-code {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

/* ----------------------------------------- */
/**** data table ****/
.data-table-wrapper {
  max-height: calc(100vh - 60px); /* trừ chiều cao topbar */
  overflow-x: auto;
  background: #fafbfc;
  border-radius: 14px;
  box-shadow: 0 4px 32px 0 rgba(60, 100, 110, 0.07);
}
table.data-table {
  width: 100%;
  border-collapse: separate;
  border: 1px solid #e0e0e0;
  border-spacing: 0;
  margin: 0 auto;
}
.data-table {
  border-radius: 14px;
  box-shadow: 0 4px 32px 0 rgba(60, 100, 110, 0.07);
  background: #fafbfc;
}
.data-table-head th,
.data-table-th {
    background-color: rgb(204, 255, 238);
    font-weight: bold;
    text-align: center;
}
.data-table th,
.data-table td {
  font-size: 14px;
  font-family: 'Segoe UI', Arial, sans-serif;
  border: 1px solid #e0e0e0;;
  padding: 12px 10px;
  vertical-align: middle;
}
.data-table th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #ddf6ff;
  color: #1b455b;
  font-weight: 600;
  font-size: 14px;
  border-bottom: 3px solid #3ec9d6;
  text-align: center;
  padding: 4px;
  box-shadow: none;
  text-shadow: 0 1px 0 #fff;
}
.data-table tr {
  transition: background 0.18s;
}

.data-table tbody tr:nth-child(even) {
  background: #f5fcfd;
}
/* auto task */
.terminated-row {
    background-color: #fde0e0 !important; 
    color: #a00;
    opacity: 0.7;
    box-shadow: none !important;
}
.warning-row td {
    background-color: #fff8c2 !important;
    box-shadow: none !important; 
}
.expired-row td {
    background-color: #ffd6d6 !important; 
    color: #b00;
    box-shadow: none !important;
}
.data-table-wrapper {
  scrollbar-width: thin;              /* Firefox */
  scrollbar-color: #39c0ed #e9f6fa;   /* Firefox: thumb màu xanh, track màu xanh nhạt */
}

.data-table-wrapper::-webkit-scrollbar {
  height: 8px;      /* Thanh cuộn ngang */
  width: 9px;       /* Thanh cuộn dọc */
  background: #e9f6fa;
  border-radius: 10px;
}

.data-table-wrapper::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, #39c0ed 0%, #4cd8c7 100%);
  border-radius: 10px;
  min-height: 36px;
  min-width: 36px;
  box-shadow: 0 1px 4px rgba(30,140,210,0.09) inset;
  border: 2px solid #e9f6fa;
}

.data-table-wrapper::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(90deg, #34b6e5 0%, #35e0c7 100%);
}

.data-table-wrapper::-webkit-scrollbar-corner {
  background: #e9f6fa;
}
