/* Class cho Modal cực lớn (Dùng cho bảng lịch sử) */
.modal-xl {
    max-width: 95% !important; /* Chiếm 95% chiều rộng màn hình */
    height: 90vh; /* Chiếm 90% chiều cao */
    display: flex;
    flex-direction: column;
}

/* Tinh chỉnh bảng trong modal */
#historyModal table th {
    position: sticky; top: 0; background: #1e293b; z-index: 10; /* Cố định tiêu đề khi cuộn */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
body{
  margin:0;
  font-family:system-ui,-apple-system,BlinkMacSystemFont,sans-serif;
  background:radial-gradient(circle at top,#0b2a4a,#020617);
  color:#fff;
}
/* Tìm đoạn .container trong CSS và sửa lại như sau */
.container {
    max-width: 98%; /* Mở rộng gần hết màn hình ngang */
    margin: auto;
    padding: 10px;
}
h1,h2{margin:0 0 12px}
.card{
  background:rgba(255,255,255,.05);
  border-radius:18px;
  padding:20px;
  box-shadow:0 20px 40px rgba(0,0,0,.45)
}
.grid {
    display: grid;
    grid-template-columns: 35% 65%; /* Khung bên phải rộng hơn hẳn */
    gap: 20px;
}

/* Khi xem trên điện thoại thì vẫn xếp chồng 1 cột */
@media(max-width: 1100px) {
    .grid { grid-template-columns: 1fr; }
}
@media(max-width:900px){.grid{grid-template-columns:1fr}}
label{font-size:14px;opacity:.9;margin-bottom:6px;display:block}
input,select,button{
  width:100%;
  padding:12px 14px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.15);
  background:rgba(0,0,0,.35);color:#fff;
  margin-bottom:14px;font-size:15px;
  box-sizing: border-box; /* <--- THÊM DÒNG QUAN TRỌNG NÀY */
}
button{cursor:pointer;font-weight:600}
.btn-green{background:linear-gradient(135deg,#22c55e,#16a34a);border:none}
.btn-red{background:transparent;border:1px solid #ef4444;color:#ef4444}
.btn-outline{background:transparent;border:1px solid #475569;color:#cbd5f5}
/* --- SỬA LẠI ĐOẠN NÀY ĐỂ CĂN GIỮA --- */
.topbar {
    display: flex;
    flex-direction: column;  /* Xếp dọc: Tiêu đề trên, nút dưới */
    align-items: center;     /* <--- QUAN TRỌNG: Căn giữa tất cả mọi thứ */
    justify-content: center; /* Căn giữa */
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.02);
    padding: 20px;           /* Tăng padding chút cho thoáng */
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;      /* Đảm bảo chữ cũng nằm giữa */
}

.page-title {
    margin: 0 0 15px 0; /* Cách nút bấm 15px */
    font-size: 22px; /* Chữ to vừa phải */
    font-weight: 700;
    white-space: nowrap; /* BẮT BUỘC: Không xuống dòng */
    background: linear-gradient(90deg, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Khu vực chứa các nút */
.user-actions {
    display: none; /* Mặc định ẩn, đăng nhập xong mới hiện */
    gap: 10px; /* Khoảng cách giữa các nút */
    flex-direction: row; /* Sắp nút nằm ngang */
}

/* Nút Admin riêng biệt */
.btn-admin {
    background: #3b82f6; 
    color: white; 
    border: none;
    display: inline-flex; 
    align-items: center;
}
.btn-admin:hover { background: #2563eb; }

/* Responsive: Nếu màn hình quá nhỏ thì cho phép cuộn ngang chữ thay vì xuống dòng */
@media (max-width: 600px) {
    .page-title { font-size: 18px; overflow-x: auto; max-width: 100%; }
}
table {
    width: 100%;
    table-layout: auto; /* Để bảng tự giãn theo nội dung nút bấm */
    min-width: 800px;    /* Đảm bảo bảng không bị quá hẹp */
}
th,td{padding:10px;border-bottom:1px solid rgba(255,255,255,.1)}
.status-ok{color:#22c55e}
input[type="date"]::-webkit-calendar-picker-indicator,
  input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(1); /* Đổi màu icon sang trắng */
    cursor: pointer;
  }
 label i {
    margin-right: 8px;
    color: #4ade80; /* Màu xanh lá mạ cho đẹp */
    width: 20px;
    text-align: center;
 }
/* Thêm màu cho trạng thái ZNS (Tùy chỉnh theo yêu cầu) */
.status-ok{color:#22c55e} /* Xanh lá: Gửi thành công */
.status-pending{color:#f59e0b} /* Vàng: Chưa gửi */
.status-error{color:#ef4444} /* Đỏ: Gửi lỗi */

/* CSS cho các nút hành động nhỏ */
.action-buttons button {
    padding: 10px 15px; /* Tăng diện tích bấm */
    font-size: 13px;    /* Chữ to rõ hơn */
    min-width: 85px;    /* Các nút có chiều rộng bằng nhau cho đẹp */
    border-radius: 8px;
}
.action-buttons button {
    width: auto; /* Để nút co lại theo nội dung */
    padding: 6px 10px;
    font-size: 12px;
    margin: 0;
    margin-bottom: 0; /* Ghi đè margin-bottom mặc định */
}
.btn-test { background: #3b82f6; border: none; } /* Xanh dương */
.btn-reg { background: #10b981; border: none; } /* Xanh teal */
.btn-not-reg { background: #9ca3af; border: none; } /* Xám */

/* Điều chỉnh lại padding cho cột cuối */
td:last-child {
    display: flex;
    flex-direction: column; /* Xếp X và các nút xuống dòng */
    align-items: flex-end; /* Căn phải */
}
/* --- CSS NÚT GỬI LẠI ZNS (Mới thêm) --- */
.btn-resend {
    background: #f59e0b; /* Màu cam cảnh báo */
    color: white;
    border: none;
    padding: 6px 12px; /* To hơn nút X một chút cho dễ bấm */
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    margin-right: 8px; /* Cách nút X ra */
    white-space: nowrap;       /* 1. Bắt buộc chữ nằm trên 1 dòng */
    display: inline-flex;      /* 2. Căn chỉnh icon và chữ nằm ngang */
    align-items: center;       /* 3. Căn giữa theo chiều dọc */
    /* Hiệu ứng nhấp nháy để gây chú ý */
    animation: pulse-orange 2s infinite;
}

.btn-resend:hover {
    background: #d97706; /* Màu đậm hơn khi di chuột */
}

.btn-resend i {
    margin-right: 4px;
}

/* Định nghĩa hiệu ứng nhấp nháy */
@keyframes pulse-orange {
    0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
    100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}
/* --- CSS CHO MODAL FULL SCREEN --- */
.modal-overlay {
    display: none; /* Mặc định ẩn */
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85); /* Nền tối mờ */
    z-index: 10000;
    justify-content: center; align-items: center;
    padding: 20px; box-sizing: border-box;
    overflow-y: auto; /* Cho phép cuộn nếu dài */
}

.modal-content {
    background: #1e293b; /* Màu nền giống card */
    width: 100%; max-width: 600px;
    border-radius: 16px;
    padding: 24px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* --- SỬA LẠI NÚT ĐÓNG (CLOSE) CHO DỄ BẤM --- */
.close-modal {
    position: absolute;
    top: 10px;        /* Cách lề trên một chút */
    right: 15px;      /* Cách lề phải */
    
    /* Tăng kích thước vùng bấm */
    width: 45px;      
    height: 45px;
    
    /* Canh chữ X ra giữa cái vòng tròn */
    display: flex;
    align-items: center;
    justify-content: center;
    
    font-size: 32px;  /* Chữ X to hơn */
    color: #94a3b8;
    cursor: pointer;
    border-radius: 50%; /* Bo tròn thành hình tròn */
    transition: all 0.2s;
    z-index: 100;     /* Đảm bảo luôn nằm trên cùng */
}

/* Hiệu ứng khi rê chuột vào: Sáng chữ + Hiện nền mờ */
.close-modal:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.15); /* Nền xám mờ */
    transform: rotate(90deg); /* Xoay nhẹ cho đẹp (tùy chọn) */
}
.close-modal:hover { color: #fff; }

/* Các dòng thông tin chi tiết */
.detail-row {
    display: flex; border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 12px 0;
}
.detail-label { width: 140px; color: #94a3b8; font-weight: 600; }
.detail-value { color: #fff; flex: 1; word-break: break-word; }

/* Nút Xem chi tiết (Màu xanh dương) */
.btn-view {
    background: #3b82f6; color: white; border: none;
    padding: 6px 12px; border-radius: 8px; cursor: pointer;
    margin-right: 5px; font-weight: bold;
}
.btn-view:hover { background: #2563eb; }
/* ===== CSS CHO DROPDOWN TÌM KIẾM (SEARCHABLE) ===== */
.custom-dropdown-wrapper {
    position: relative;
    margin-bottom: 14px;
}

/* Ô nhập liệu tìm kiếm (Thay thế ô select cũ) */
.custom-search-input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: #ffffff; /* Nền trắng sáng */
    color: #1e293b; /* Chữ màu đen đậm dễ đọc */
    font-size: 15px;
    font-weight: 500;
    cursor: text;
    box-sizing: border-box;
    transition: 0.3s;
}

.custom-search-input:focus {
    outline: none;
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.custom-search-input::placeholder {
    color: #94a3b8;
}

/* Danh sách sổ xuống */
.custom-options-list {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: #ffffff;
    border-radius: 12px;
    margin-top: 5px;
    max-height: 250px; /* Chiều cao tối đa, quá thì cuộn */
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    z-index: 1000;
    display: none; /* Mặc định ẩn */
    border: 1px solid #e2e8f0;
}

/* Từng dòng chi nhánh */
.custom-option {
    padding: 10px 14px;
    cursor: pointer;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
}

.custom-option:hover {
    background: #e0f2fe; /* Màu xanh nhạt khi di chuột vào */
    color: #0284c7;
    font-weight: 600;
}

/* Dòng thông báo không tìm thấy */
.no-result {
    padding: 15px;
    text-align: center;
    color: #64748b;
    font-style: italic;
}
/* --- TECH GATE VERSION 3: KHÔNG LOGO - CHỈ CÓ LÕI NĂNG LƯỢNG --- */
#tech-gate {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 99999; display: flex; pointer-events: none;
    background: #020617;
}

/* Cấu tạo chung 2 cánh cửa */
.gate-door {
    width: 50%; height: 100%;
    position: relative;
    background: linear-gradient(to bottom, #0f172a, #1e293b);
    transition: transform 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden;
    border-bottom: 2px solid #00f7ff; /* Viền đáy neon */
}

/* --- HIỆU ỨNG MẠCH ĐIỆN TRÊN CỬA (GIỮ NGUYÊN) --- */
.gate-door::before, .gate-door::after {
    content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
}

/* Lớp lưới mờ */
.gate-door::before {
    background-image: 
        linear-gradient(rgba(0, 247, 255, 0.15) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 247, 255, 0.15) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.4;
}

/* Lớp mạch điện chạy ngẫu nhiên */
.gate-door::after {
    background: 
        radial-gradient(circle at 50% 50%, rgba(0,247,255,0.1) 0%, transparent 40%),
        repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(0,247,255,0.05) 10px, rgba(0,247,255,0.05) 12px);
    box-shadow: inset 0 0 50px rgba(0,0,0,0.8);
}

/* Cửa Trái */
.gate-left {
    transform-origin: left;
    border-right: 2px solid #00f7ff; /* Đường kẻ sáng giữa */
    box-shadow: 5px 0 20px rgba(0, 247, 255, 0.5);
}

/* Cửa Phải */
.gate-right {
    transform-origin: right;
    border-left: 2px solid #00f7ff; /* Đường kẻ sáng giữa */
    box-shadow: -5px 0 20px rgba(0, 247, 255, 0.5);
}

/* --- LÕI NĂNG LƯỢNG (THAY CHO LOGO) --- */
/* ================================
   🔮 LÕI NĂNG LƯỢNG SCI-FI (FULL)
   Shockwave + Lightning + Pulse
================================ */

.gate-lock {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 100000;

  width: 60px;
  height: 60px;
  border-radius: 50%;

  /* Lõi trung tâm */
  background: radial-gradient(
    circle,
    #ffffff 10%,
    #67e8f9 35%,
    #00f7ff 55%,
    #0ea5e9 70%,
    #020617 100%
  );

  /* Glow */
  box-shadow:
    0 0 25px #00f7ff,
    0 0 60px rgba(0, 247, 255, 0.9),
    0 0 140px rgba(0, 247, 255, 0.6);

  animation: energyPulse 0.7s ease-in-out infinite alternate;
}

/* ⚡ TIA SÉT XOAY */
.gate-lock::before {
  content: '';
  position: absolute;
  inset: -15px;
  border-radius: 50%;

  background:
    conic-gradient(
      transparent 0deg,
      #7dd3fc 20deg,
      transparent 40deg,
      #22d3ee 60deg,
      transparent 90deg,
      #67e8f9 140deg,
      transparent 180deg,
      #0ea5e9 220deg,
      transparent 260deg,
      #38bdf8 300deg,
      transparent 360deg
    );

  filter: blur(0.8px);
  animation: lightningSpin 0.9s linear infinite;
}

/* 💥 SÓNG XUNG KÍCH */
.gate-lock::after {
  content: '';
  position: absolute;
  inset: -25px;
  border-radius: 50%;
  border: 2px solid rgba(0, 247, 255, 0.6);
  filter: blur(1px);
  animation: shockWave 1.4s ease-out infinite;
}

/* ❤️ NHỊP ĐẬP LÕI */
@keyframes energyPulse {
  0% {
    transform: translate(-50%, -50%) scale(0.85);
  }
  100% {
    transform: translate(-50%, -50%) scale(1.15);
  }
}

/* ⚡ XOAY SÉT */
@keyframes lightningSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* 💥 LAN SÓNG */
@keyframes shockWave {
  0% {
    transform: scale(0.5);
    opacity: 0.9;
  }
  70% {
    opacity: 0.4;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

/* 🔻 TẮT LÕI KHI CỔNG MỞ */
.gate-open .gate-lock {
  opacity: 0;
  transition: opacity 0.4s ease;
}

/* Hiệu ứng nhịp đập năng lượng */
@keyframes energyPulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 20px #00f7ff;
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.4); /* Phóng to ra */
        box-shadow: 0 0 60px #00f7ff, 0 0 120px rgba(0, 247, 255, 0.8); /* Sáng rực lên */
        background: radial-gradient(circle, #fff 30%, #00f7ff 80%);
        opacity: 1;
    }
}

/* Trạng thái mở cổng */
.gate-open .gate-left { transform: translateX(-100%); }
.gate-open .gate-right { transform: translateX(100%); }
.gate-open .gate-lock { opacity: 0; transform: translate(-50%, -50%) scale(5); transition: 0.3s; }
.edit-input {
    background: #f1f5f9 !important;
    color: #1e293b !important;
    border: 1px solid #cbd5e1 !important;
    padding: 5px 10px !important;
    margin: 0 !important;
    font-size: 14px !important;
    border-radius: 6px !important;
}
.btn-edit-icon {
    margin-left: 10px;
    cursor: pointer;
    color: #3b82f6;
    transition: 0.2s;
}
.page-title {
  font-size: 24px;
  font-weight: 700;
  color: #2f80ff; /* xanh Zalo sáng */
  text-shadow:
    0 0 2px #ffffff,
    0 1px 3px rgba(0, 0, 0, 0.35);
}
.btn-guide {
  white-space: nowrap;
  min-width: 130px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  background: linear-gradient(120deg, #2f80ff, #0068ff);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  transition: all 0.25s ease;
}

.btn-guide:hover {
  transform: translateY(-1px);
  background: linear-gradient(120deg, #4d95ff, #0050cc);
}
/* --- CSS CHO HEADER VÀ NÚT SỬA MỚI --- */

/* Khu vực Header canh giữa */
.modal-header-centered {
    text-align: center;
    margin-bottom: 25px; /* Khoảng cách với nội dung bên dưới */
    position: relative;
}

/* Style cho tiêu đề */
.modal-header-centered h2 {
    color: #3b82f6;
    margin: 0 0 15px 0; /* Khoảng cách giữa tiêu đề và nút sửa */
    font-size: 24px;
}

/* Nút Sửa "Hero" đẹp mắt */
.btn-edit-hero {
    background-color: transparent;
    border: 2px solid #3b82f6; /* Viền màu xanh chủ đạo */
    color: #3b82f6; /* Chữ màu xanh */
    padding: 10px 30px; /* Nút to và rộng hơn */
    border-radius: 30px; /* Bo tròn kiểu viên thuốc */
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease; /* Hiệu ứng mượt mà */
    display: inline-flex;
    align-items: center;
    gap: 10px; /* Khoảng cách giữa icon và chữ */
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Hiệu ứng khi di chuột vào nút */
.btn-edit-hero:hover {
    background-color: #3b82f6; /* Nền chuyển sang xanh */
    color: white; /* Chữ chuyển sang trắng */
    box-shadow: 0 8px 15px rgba(59, 130, 246, 0.3); /* Tạo hiệu ứng phát sáng */
    transform: translateY(-2px); /* Nút nảy lên nhẹ */
}

/* Khi đang ở chế độ Sửa thì nút này đổi màu để báo hiệu (Tùy chọn) */
.btn-edit-hero.editing {
    background-color: #f59e0b; /* Màu cam cảnh báo */
    border-color: #f59e0b;
    color: white;
}
/* --- FIX ICON LỊCH & GIỜ CHO DỄ THẤY --- */
.edit-input[type="date"]::-webkit-calendar-picker-indicator,
.edit-input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(0) !important; /* Quay về màu đen mặc định */
    cursor: pointer;
    transform: scale(1.2); /* Phóng to icon lên 1 xíu cho dễ bấm */
    margin-left: 5px;
}
/* CSS CHO MODAL LỊCH */
#calendar {
    height: 100%;
}
/* Tùy chỉnh màu sắc sự kiện trong lịch */
.fc-event {
    cursor: pointer;
    border: none;
    padding: 2px 4px;
    font-size: 13px;
    border-radius: 4px;
    transition: 0.2s;
}
.fc-event:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.fc-event-title {
    font-weight: 600;
}
.fc-toolbar-title {
    color: #1e293b !important; /* Chữ tiêu đề lịch màu đen cho dễ đọc trên nền trắng */
    font-size: 20px !important;
}
.fc-button-primary {
    background-color: #3b82f6 !important;
    border-color: #3b82f6 !important;
}
.fc-daygrid-day-number {
    color: #334155;
    text-decoration: none;
}
.fc-col-header-cell-cushion {
    color: #334155;
    text-decoration: none;
}
/* ==========================================================
   FIX LỖI LỊCH (BẢN FINAL V7 - FIX MÀU CỘT & CÚ PHÁP)
   ========================================================== */

/* 1. RESET KHUNG BAO NGOÀI */
#calendarWrapper {
    background: #ffffff !important;
    border-radius: 0 0 12px 12px;
    padding: 0 !important;
    overflow: hidden; 
    flex: 1; 
    display: flex;
    flex-direction: column;
}

#calendar {
    flex: 1;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* 2. RESET BẢNG LỊCH (CÔ LẬP KHỎI CSS CHUNG) */
#calendar table {
    border-collapse: separate !important; 
    border-spacing: 0 !important;
    margin: 0 !important;
    min-width: 0 !important;
    table-layout: fixed !important;
}

/* --- RESET Ô CELL (GIỮ NGUYÊN ĐỂ KHÔNG VỠ) --- */
#calendar td, #calendar th {
    padding: 0 !important;
    border: 1px solid #e2e8f0 !important;
    vertical-align: top !important;
    background: transparent !important; /* Mặc định trong suốt */
}

/* 3. TRANG TRÍ ĐƯỜNG KẺ (GRID) */
.fc-day, .fc-col-header-cell {
    border-right: 1px solid #cbd5e1 !important; 
}

.fc-timegrid-slot {
    height: 3em !important; 
    border-bottom: 1px dashed #e2e8f0 !important; 
}

.fc-timegrid-slot-lane {
    border-bottom: 1px solid #cbd5e1 !important; 
}

/* 4. HEADER (TIÊU ĐỀ NGÀY) */
.fc-col-header-cell {
    background-color: #f8fafc !important;
    padding: 8px 0 !important;
    border-bottom: 2px solid #64748b !important;
}

.fc-col-header-cell-cushion {
    color: #0f172a !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    text-decoration: none !important;
    font-size: 13px !important;
}

/* 5. CỘT GIỜ (TRỤC Y) */
.fc-timegrid-slot-label-cushion {
    color: #475569 !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    text-transform: uppercase;
}

/* ==========================================================
   🔥 HIGHLIGHT NGÀY HÔM NAY (ĐÃ TĂNG ĐỘ ƯU TIÊN)
   ========================================================== */

/* 1. Đổi màu CỘT ngày hôm nay (Thêm #calendar để ghi đè background transparent) */
#calendar .fc-day-today {
    background-color: #fff7ed !important; /* Màu kem cam sáng */
    transition: background-color 0.3s;
}

/* 2. Đổi màu HEADER ngày hôm nay */
#calendar .fc-col-header-cell.fc-day-today {
    background-color: #ffedd5 !important; /* Cam đậm hơn xíu */
    border-bottom: 3px solid #ea580c !important; /* Gạch chân cam đậm */
}

/* 3. Đổi màu CHỮ trong tiêu đề hôm nay */
#calendar .fc-day-today .fc-col-header-cell-cushion {
    color: #c2410c !important;
    font-weight: 800 !important;
    font-size: 14px !important;
}

/* 4. Đường kẻ chỉ giờ hiện tại (NOW INDICATOR) */
.fc-timegrid-now-indicator-line {
    border-top-color: #ef4444 !important;
    border-top-width: 2px !important;
    opacity: 1 !important;
    z-index: 100 !important;
    box-shadow: 0 0 4px rgba(239, 68, 68, 0.6); /* Thêm bóng cho dễ thấy */
}

.fc-timegrid-now-indicator-arrow {
    border-color: #ef4444 !important;
    border-width: 6px 0 6px 6px !important;
    margin-top: 0 !important;
}

/* 7. SỰ KIỆN (EVENT BOX) */
.fc-event {
    border: none !important;
    border-radius: 4px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15) !important;
    margin: 1px 2px !important; 
    padding: 2px 4px !important;
}

.fc-event:hover {
    z-index: 50 !important;
    transform: scale(1.02);
    transition: 0.1s;
}

.fc-event-title {
    font-weight: 700 !important;
    font-size: 12px !important;
}

#calendar td:last-child {
    display: table-cell !important;
    align-items: initial !important;
}
/* --- CSS CHO MODAL LỊCH (BỔ SUNG) --- */

/* 1. Input ngày tháng trong bộ lọc */
.cal-filter-input {
    background: #0f172a !important;
    border: 1px solid #334155 !important;
    color: #fff !important;
    padding: 4px 8px !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    height: 34px !important;
    width: 130px !important;
    margin: 0 !important; /* Ghi đè margin mặc định */
}

/* 2. Chấm tròn màu sắc chú thích */
.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.05);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
}

.color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 5px rgba(0,0,0,0.3);
}

/* Responsive trên mobile: Cho bộ lọc xuống dòng */
@media (max-width: 768px) {
    .cal-filter-input { width: 110px !important; }
    .legend-item { font-size: 11px; padding: 4px 8px; }
}