.custom-scrollbar-x::-webkit-scrollbar-track {
  background: #F1F5F9 !important;
  border-radius: 8px !important;
  border: 1px solid #E2E8F0 !important;
}

#rpt-matrix-wrapper::-webkit-scrollbar-thumb,
#rpt-grades-table-wrapper::-webkit-scrollbar-thumb,
#table-grades-master-wrapper::-webkit-scrollbar-thumb,
#train-stu-table-wrapper::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb,
.custom-scrollbar-x::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, #3B82F6, #2563EB) !important;
  border-radius: 8px !important;
  border: 2px solid #F1F5F9 !important;
  box-shadow: inset 0 0 4px rgba(0,0,0,0.15) !important;
}

#rpt-matrix-wrapper::-webkit-scrollbar-thumb:hover,
#rpt-grades-table-wrapper::-webkit-scrollbar-thumb:hover,
#table-grades-master-wrapper::-webkit-scrollbar-thumb:hover,
#train-stu-table-wrapper::-webkit-scrollbar-thumb:hover,
.table-responsive::-webkit-scrollbar-thumb:hover,
.custom-scrollbar-x::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(90deg, #2563EB, #1D4ED8) !important;
}

/* Quick scroll control buttons toolbar */
.table-scroll-controller {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #EFF6FF;
  border: 1.5px solid #BFDBFE;
  border-radius: 10px;
  padding: 0.4rem 0.85rem;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.table-scroll-controller .scroll-btn {
  background: #FFFFFF;
  border: 1.5px solid #93C5FD;
  color: #1D4ED8;
  font-weight: 800;
  font-size: 0.76rem;
  padding: 0.3rem 0.75rem;
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.15s ease;
}
.table-scroll-controller .scroll-btn:hover {
  background: #2563EB;
  color: #FFFFFF;
  border-color: #2563EB;
  box-shadow: 0 2px 8px rgba(37,99,235,0.25);
}

/* QR Scanner Laser Animation */
@keyframes qrLaser {
  0% { top: 15%; opacity: 0.3; }
  50% { top: 80%; opacity: 1; }
  100% { top: 15%; opacity: 0.3; }
}


/* ==========================================================================
   📱 COMPREHENSIVE MOBILE & TABLET RESPONSIVE ENGINE (VNT 2026)
   Tối ưu hóa toàn diện giao diện di động & máy tính bảng
   ========================================================================== */

/* --- 1. Global Viewport & Container Normalization --- */
@media (max-width: 1024px) {
  html, body {
    overflow-x: hidden !important;
    width: 100% !important;
    position: relative !important;
  }

  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    transition: all 0.25s ease !important;
  }

  .page-content {
    padding: 0.75rem 0.5rem 5.5rem !important;
  }

  /* Force all desktop fixed paddings to responsive compact padding */
  #training-root > div,
  .training-module-container,
  div[style*="padding: 1.75rem 2rem"],
  div[style*="padding: 1.5rem 2rem"],
  div[style*="padding: 2rem"] {
    padding: 0.85rem 0.65rem !important;
    border-radius: 14px !important;
  }
}

/* --- 2. Mobile Topbar & Header Optimization --- */
@media (max-width: 768px) {
  .header {
    height: 54px !important;
    padding: 0 0.65rem !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    background: #FFFFFF !important;
  }

  .header-left {
    gap: 0.4rem !important;
    min-width: 0 !important;
    flex: 1 !important;
  }

  .header-title {
    font-size: 0.92rem !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 180px !important;
  }

  .header-actions {
    gap: 0.35rem !important;
  }

  .header-actions a[href*="evn_app"],
  .header-actions .btn-solar,
  .header-actions .btn-vinfast {
    display: none !important;
  }

  .user-badge {
    padding: 0.25rem 0.55rem !important;
    font-size: 0.75rem !important;
  }
  
  .user-badge span:last-child {
    max-width: 90px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
}

/* --- 3. Horizontal Touch Scroll Bars (Pills, Chips, Subtabs) --- */
@media (max-width: 1024px) {
  /* Class filter pills bar */
  div[id*="class-pills"],
  div[style*="LỌC THEO LỚP"],
  div[style*="PHÂN LOẠI LỚP"],
  #rpt-grades-class-pills,
  #rpt-weekly-class-pills,
  .class-filter-bar {
    display: flex !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding-bottom: 4px !important;
    gap: 0.4rem !important;
  }
  div[id*="class-pills"]::-webkit-scrollbar { display: none !important; }

  /* 4 Subtabs in Reports */
  .rpt-subtabs-bar,
  div[style*="display: flex; gap: 0.45rem; background: #F8FAFC"] {
    display: flex !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding-bottom: 4px !important;
  }
  .rpt-subtabs-bar::-webkit-scrollbar { display: none !important; }

  /* Lesson template pills */
  div[style*="CHỌN NHANH:"] {
    display: flex !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding-bottom: 3px !important;
  }
  div[style*="CHỌN NHANH:"]::-webkit-scrollbar { display: none !important; }
}

/* --- 4. Module Form Controls & Grid Stacking --- */
@media (max-width: 768px) {
  /* Grid inputs stacking */
  div[style*="grid-template-columns: 1fr 1fr 1.5fr"],
  div[style*="grid-template-columns: 1fr 1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 0.65rem !important;
  }

  /* Attendance stats top bar */
  div[style*="Danh sách Học viên"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
  }

  /* Quick action buttons row in Attendance */
  div[style*="display: flex; gap: 0.5rem; flex-wrap: wrap;"] {
    gap: 0.35rem !important;
  }

  div[style*="display: flex; gap: 0.5rem; flex-wrap: wrap;"] button {
    flex: 1 1 calc(50% - 0.35rem) !important;
    justify-content: center !important;
    padding: 0.45rem 0.4rem !important;
    font-size: 0.75rem !important;
  }
}

/* --- 5. Student Attendance Cards Responsive Grid (Điểm Danh) --- */
@media (max-width: 540px) {
  .att-8col-grid,
  #att-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.45rem !important;
  }

  .att-card {
    padding: 0.65rem 0.45rem !important;
    border-radius: 12px !important;
  }

  .att-card-btn {
    min-height: 36px !important;
    padding: 3px 1px !important;
  }
}

@media (max-width: 350px) {
  .att-8col-grid,
  #att-cards-grid {
    grid-template-columns: 1fr !important;
  }
}

/* --- 6. Student Evaluation Cards Responsive Grid (Đánh Giá) --- */
@media (max-width: 850px) {
  .eval-4col-grid,
  #eval-cards-grid {
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
  }

  .eval-card {
    padding: 0.9rem 0.75rem !important;
    border-radius: 14px !important;
  }

  /* 4-Skill Charts Dashboard */
  div[style*="grid-template-columns: repeat(auto-fit, minmax(220px, 1fr))"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.5rem !important;
  }
}

@media (max-width: 480px) {
  /* 4-Skill Charts Dashboard on small phones */
  div[style*="grid-template-columns: repeat(auto-fit, minmax(220px, 1fr))"] {
    grid-template-columns: 1fr !important;
  }

  .eval-card div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 0.45rem !important;
  }
}

/* --- 7. Interactive Matrix Tables & Horizontal Touch Scrolling (Báo Cáo & Bảng Điểm) --- */
@media (max-width: 1024px) {
  #rpt-attendance-table-wrapper,
  #rpt-daily-table-wrapper,
  #rpt-eval-table-wrapper,
  #rpt-grades-table-wrapper,
  #eval-table-view-container,
  #att-rows-container,
  .table-responsive-touch {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    max-height: 70vh !important;
    border-radius: 12px !important;
  }

  /* Keep sticky columns pinned on touch scroll */
  #rpt-attendance-table th:first-child,
  #rpt-attendance-table td:first-child,
  #rpt-eval-table th:first-child,
  #rpt-eval-table td:first-child,
  #rpt-grades-table th:first-child,
  #rpt-grades-table td:first-child,
  #eval-interactive-table th:first-child,
  #eval-interactive-table td:first-child,
  #att-interactive-table th:first-child,
  #att-interactive-table td:first-child {
    position: sticky !important;
    left: 0 !important;
    z-index: 6 !important;
  }

  #rpt-attendance-table th:nth-child(2),
  #rpt-attendance-table td:nth-child(2),
  #rpt-eval-table th:nth-child(2),
  #rpt-eval-table td:nth-child(2),
  #rpt-grades-table th:nth-child(2),
  #rpt-grades-table td:nth-child(2),
  #eval-interactive-table th:nth-child(2),
  #eval-interactive-table td:nth-child(2),
  #att-interactive-table th:nth-child(2),
  #att-interactive-table td:nth-child(2) {
    position: sticky !important;
    left: 48px !important;
    z-index: 6 !important;
    box-shadow: 3px 0 8px rgba(0,0,0,0.04) !important;
  }

  @media (max-width: 640px) {
    #rpt-attendance-table th:nth-child(2),
    #rpt-attendance-table td:nth-child(2),
    #rpt-eval-table th:nth-child(2),
    #rpt-eval-table td:nth-child(2),
    #rpt-grades-table th:nth-child(2),
    #rpt-grades-table td:nth-child(2),
    #eval-interactive-table th:nth-child(2),
    #eval-interactive-table td:nth-child(2),
    #att-interactive-table th:nth-child(2),
    #att-interactive-table td:nth-child(2) {
      position: static !important;
      left: auto !important;
      box-shadow: none !important;
    }
  }
}

/* --- Attendance Interactive Row Table Modern Styling --- */
#att-interactive-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}
#att-interactive-table thead th {
  letter-spacing: 0.35px;
  user-select: none;
  border-bottom: 2px solid #CBD5E1;
}
#att-interactive-table tbody tr.att-row {
  transition: background-color 0.15s ease;
}
#att-interactive-table tbody tr.att-row:hover {
  background-color: #F8FAFC !important;
}
#att-interactive-table tbody tr.att-row td {
  vertical-align: middle;
}
.att-row-btn {
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}
.att-row-btn:hover {
  transform: translateY(-1px);
  filter: brightness(0.96);
}
.att-card-btn {
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}
.att-card-btn:hover {
  transform: scale(1.06);
}

/* --- 8. Modals & Dialogs on Mobile Devices --- */
@media (max-width: 768px) {
  .modal-dialog,
  .modal-content,
  div[id*="modal"] > div {
    max-width: 95vw !important;
    width: 95vw !important;
    margin: 0.5rem auto !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    border-radius: 14px !important;
  }

  /* Bottom Actions Bar full width buttons */
  div[style*="border-top: 1.5px solid"] {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.65rem !important;
  }

  div[style*="border-top: 1.5px solid"] button,
  div[style*="border-top: 1.5px solid"] div {
    width: 100% !important;
    justify-content: center !important;
  }
}

/* ================================================================
   WINDOWS FILE EXPLORER (TRÌNH QUẢN LÝ THƯ MỤC & TỆP TIN KIỂU WINDOWS)
   ================================================================ */
.win-explorer-window {
  background: #FFFFFF;
  border-radius: 12px;
  border: 1px solid #D1D5DB;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: calc(100vh - 110px);
  height: calc(100vh - 110px);
}

/* 1. Title bar */
.win-title-bar {
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}
.win-title-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #1E293B;
}
.win-window-controls {
  display: flex;
  gap: 6px;
}
.win-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
}
.win-dot.red { background: #EF4444; }
.win-dot.yellow { background: #F59E0B; }
.win-dot.green { background: #10B981; }

/* 2. Ribbon / Toolbar */
.win-toolbar {
  background: #FFFFFF;
  border-bottom: 1px solid #E5E7EB;
  padding: 0.45rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.win-tool-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
}
.win-tool-btn:hover {
  background: #F3F4F6;
  border-color: #E5E7EB;
  color: #111827;
}
.win-tool-btn.primary {
  background: #10B981;
  color: #FFFFFF;
  border-color: #059669;
}
.win-tool-btn.primary:hover {
  background: #059669;
}
.win-tool-separator {
  width: 1px;
  height: 20px;
  background: #E5E7EB;
  margin: 0 4px;
}

/* 3. Address & Search Bar */
.win-nav-bar {
  background: #F9FAFB;
  border-bottom: 1px solid #E5E7EB;
  padding: 0.45rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.win-nav-arrows {
  display: flex;
  align-items: center;
  gap: 2px;
}
.win-nav-arrow-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4B5563;
  cursor: pointer;
  font-size: 0.82rem;
  transition: all 0.15s;
}
.win-nav-arrow-btn:hover:not(:disabled) {
  background: #E5E7EB;
  color: #111827;
}
.win-nav-arrow-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Breadcrumb path bar */
.win-address-box {
  flex: 1;
  min-width: 240px;
  background: #FFFFFF;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  padding: 0.25rem 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.03);
  overflow-x: auto;
  white-space: nowrap;
}
.win-address-crumb {
  color: #2563EB;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: background 0.15s;
}
.win-address-crumb:hover {
  background: #EFF6FF;
  text-decoration: underline;
}
.win-address-sep {
  color: #9CA3AF;
  font-size: 0.72rem;
}
.win-address-crumb.active {
  color: #1F2937;
  font-weight: 700;
  cursor: default;
  text-decoration: none;
}

/* Search Box */
.win-search-box {
  width: 240px;
  position: relative;
  display: flex;
  align-items: center;
}
.win-search-box input {
  width: 100%;
  background: #FFFFFF;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  padding: 0.3rem 0.6rem 0.3rem 1.9rem;
  font-size: 0.8rem;
  color: #1F2937;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.win-search-box input:focus {
  border-color: #10B981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}
.win-search-icon {
  position: absolute;
  left: 0.6rem;
  font-size: 0.8rem;
  color: #9CA3AF;
  pointer-events: none;
}

/* 4. Explorer Body (Left Tree + Right Content View) */
.win-explorer-body {
  display: flex;
  flex: 1;
  min-height: 0;
  height: calc(100% - 130px);
  background: #FFFFFF;
  overflow: hidden;
}

/* Left Navigation Pane (Cây thư mục kiểu Windows) */
.win-sidebar-tree {
  width: 340px;
  min-width: 300px;
  max-width: 400px;
  border-right: 1px solid #E5E7EB;
  background: #F9FAFB;
  padding: 0.75rem 0.6rem;
  overflow-y: auto;
  user-select: none;
}
.win-tree-section-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #6B7280;
  padding: 0.45rem 0.55rem 0.25rem;
  margin-bottom: 0.25rem;
}
.win-tree-node {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.65rem;
  border-radius: 7px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  margin-bottom: 3px;
  transition: all 0.15s ease;
  gap: 0.5rem;
}
.win-tree-node:hover {
  background: #E5E7EB;
  color: #111827;
}
.win-tree-node.active {
  background: #E0F2FE;
  color: #0284C7;
  font-weight: 800;
  border-left: 3px solid #0284C7;
}
.win-tree-node-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow: visible;
  white-space: normal;
  line-height: 1.35;
  flex: 1;
  min-width: 0;
  word-break: break-word;
}
.win-tree-badge {
  background: rgba(0, 0, 0, 0.06);
  color: #4B5563;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 0.68rem;
  font-weight: 700;
}
.win-tree-node.active .win-tree-badge {
  background: #BAE6FD;
  color: #0369A1;
}

/* Right Content Area (Khu vực danh sách file & folder) */
.win-content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #FFFFFF;
}

.win-content-header {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid #F3F4F6;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  background: #FFFFFF;
}
.win-current-folder-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.win-current-folder-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #111827;
}
.win-current-folder-desc {
  font-size: 0.75rem;
  color: #6B7280;
}
.win-view-mode-toggle {
  display: flex;
  gap: 2px;
  background: #F3F4F6;
  border-radius: 6px;
  padding: 2px;
}
.win-view-btn {
  background: transparent;
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #4B5563;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 3px;
  transition: all 0.15s;
}
.win-view-btn:hover {
  color: #111827;
}
.win-view-btn.active {
  background: #FFFFFF;
  color: #059669;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.win-items-scroll {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
}

/* Windows Large Icons Grid View */
.win-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.85rem;
}

/* Folder Card */
.win-folder-card {
  background: #FFFFFF;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.85rem 0.65rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  position: relative;
}
.win-folder-card:hover {
  background: #F0F9FF;
  border-color: #BAE6FD;
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.08);
  transform: translateY(-2px);
}
.win-folder-icon {
  font-size: 2.7rem;
  line-height: 1;
  margin-bottom: 0.45rem;
  filter: drop-shadow(0 4px 6px rgba(217, 119, 6, 0.2));
  transition: transform 0.2s ease;
}
.win-folder-card:hover .win-folder-icon {
  transform: scale(1.08);
}
.win-folder-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: #1E293B;
  line-height: 1.3;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.win-folder-meta {
  font-size: 0.7rem;
  color: #64748B;
  margin-top: 0.25rem;
}

/* File Card */
.win-file-card {
  background: #FFFFFF;
  border: 1px solid #F1F5F9;
  border-radius: 8px;
  padding: 0.85rem 0.65rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  position: relative;
}
.win-file-card:hover {
  background: #F0FDF4;
  border-color: #BBF7D0;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.12);
  transform: translateY(-2px);
}
.win-file-card.selected {
  background: #ECFDF5;
  border-color: #10B981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}
.win-file-icon-wrap {
  position: relative;
  margin-bottom: 0.45rem;
  display: inline-block;
}
.win-file-icon {
  font-size: 2.6rem;
  line-height: 1;
}
.win-file-ext-badge {
  position: absolute;
  bottom: 0px;
  right: -6px;
  font-size: 0.6rem;
  font-weight: 900;
  padding: 1px 4px;
  border-radius: 4px;
  color: #FFFFFF;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  letter-spacing: 0.5px;
}
.win-file-ext-badge.pdf { background: #DC2626; }
.win-file-ext-badge.docx { background: #2563EB; }
.win-file-ext-badge.xlsx { background: #059669; }
.win-file-ext-badge.dwg { background: #D97706; }
.win-file-ext-badge.zip { background: #7C3AED; }

.win-file-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: #1E293B;
  line-height: 1.3;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.win-file-code {
  font-size: 0.68rem;
  font-family: monospace;
  color: #64748B;
  margin-top: 0.2rem;
  background: #F8FAFC;
  padding: 1px 4px;
  border-radius: 4px;
}
.win-file-meta {
  font-size: 0.68rem;
  color: #94A3B8;
  margin-top: 0.25rem;
}

/* Windows Details Table View */
.win-table-container {
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  overflow-x: auto;
}
.win-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  text-align: left;
}
.win-table thead th {
  background: #F8FAFC;
  padding: 0.6rem 0.75rem;
  font-weight: 700;
  color: #475569;
  border-bottom: 1px solid #E2E8F0;
  white-space: nowrap;
  user-select: none;
}
.win-table tbody tr {
  border-bottom: 1px solid #F1F5F9;
  transition: background 0.15s;
  cursor: pointer;
}
.win-table tbody tr:hover {
  background: #F0FDF4;
}
.win-table tbody tr.selected {
  background: #ECFDF5;
}
.win-table td {
  padding: 0.55rem 0.75rem;
  color: #334155;
  vertical-align: middle;
  white-space: nowrap;
}
.win-table td.name-col {
  white-space: normal;
  min-width: 250px;
}

/* Bottom Status Bar */
.win-status-bar {
  background: #F8FAFC;
  border-top: 1px solid #E5E7EB;
  padding: 0.4rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
  color: #64748B;
}
.win-status-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.win-status-right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: #059669;
}

/* Fullscreen / Maximize Mode for Windows Explorer */
.win-explorer-window.is-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  z-index: 99999 !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
  margin: 0 !important;
}
.win-explorer-window.is-fullscreen .win-explorer-body {
  height: calc(100vh - 145px) !important;
}

/* Window Control Buttons */
.win-dot {
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
}
.win-dot:hover {
  opacity: 0.85;
  transform: scale(1.15);
}

.win-maximize-toggle-btn {
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  color: #334155;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
}
.win-maximize-toggle-btn:hover {
  background: #E2E8F0;
  color: #0F172A;
  border-color: #94A3B8;
}

/* Responsive adjustments */
@media (max-width: 860px) {
  .win-sidebar-tree {
    display: none; /* Hide tree on small screens to prioritize content */
  }
  .win-search-box {
    width: 100%;
  }
  .win-address-box {
    width: 100%;
  }
}

/* ================================================================
   SUPPLIER & PERSONNEL MOBILE RESPONSIVENESS & UI POLISH
   ================================================================ */
@media (max-width: 768px) {
  #add-supplier-modal > div,
  #evn-staff-management-modal > div {
    max-width: 96% !important;
    max-height: 94vh !important;
    margin: 0 auto;
    border-radius: 14px !important;
  }
  #add-supplier-modal form,
  #evn-staff-management-modal form {
    padding: 1rem !important;
  }
  #add-supplier-modal .form-grid-2col,
  #evn-staff-management-modal div[style*="grid-template-columns: 1fr 1fr"],
  #evn-staff-management-modal div[style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }
  .supplier-view-switcher {
    width: 100%;
    justify-content: flex-start;
  }
  .supplier-view-switcher button {
    flex: 1;
    text-align: center;
  }
}

/* ================================================================
   PAYROLL & BENEFIT STYLING & PRINT MEDIA SUPPORT
   ================================================================ */
.payroll-view-container table tbody tr:hover {
  background: rgba(0, 0, 0, 0.02) !important;
}

[data-theme="dark"] .payroll-view-container table tbody tr:hover {
  background: rgba(255, 255, 255, 0.04) !important;
}

[data-theme="dark"] #printable-payslip-area {
  background: #0F172A !important;
  color: #F8FAFC !important;
  border-color: #334155 !important;
}

[data-theme="dark"] #printable-payslip-area div[style*="background:#F8FAFC"],
[data-theme="dark"] #printable-payslip-area div[style*="background: #F8FAFC"] {
  background: #1E293B !important;
  border-color: #334155 !important;
}

[data-theme="dark"] #printable-payslip-area strong {
  color: #F8FAFC !important;
}

@media print {
  body * {
    visibility: hidden;
  }
  #printable-payslip-area, #printable-payslip-area * {
    visibility: visible;
  }
  #printable-payslip-area {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 20px;
    border: none !important;
    box-shadow: none !important;
  }
}

/* ==========================================================================
   EVN-EC ATTENDANCE & PAYROLL RESPONSIVE OPTIMIZATIONS (2026)
   ========================================================================== */

/* 4 Check-in Cards Smart Grid */
.evn-checkin-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.evn-checkin-card {
  background: #F8FAFC;
  border: 1.5px solid #E2E8F0;
  border-radius: 14px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s;
}
.evn-checkin-btn {
  min-height: 40px;
  padding: 0.5rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 800;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
}

@media (max-width: 1024px) {
  .evn-checkin-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
  }
}

@media (max-width: 640px) {
  .evn-checkin-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.55rem !important;
  }
  .evn-checkin-card {
    padding: 0.75rem 0.6rem !important;
    border-radius: 12px !important;
  }
  .evn-checkin-desc {
    display: none !important;
  }
  .evn-badge-status {
    display: none !important;
  }
  .evn-checkin-btn {
    min-height: 44px !important;
    font-size: 0.82rem !important;
    padding: 0.6rem 0.4rem !important;
    font-weight: 900 !important;
  }
}

@media (max-width: 360px) {
  .evn-checkin-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Sticky Column 1 for Attendance & Payroll Tables */
.evn-sticky-table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
}
.evn-sticky-table th:first-child,
.evn-sticky-table td:first-child {
  position: sticky !important;
  left: 0 !important;
  z-index: 5 !important;
  background: #FFFFFF !important;
  box-shadow: 2px 0 6px rgba(0, 0, 0, 0.08) !important;
}
.evn-sticky-table thead th:first-child {
  background: #F8FAFC !important;
  z-index: 6 !important;
}

/* ==========================================================================
   TOPBAR GLOBAL SEARCH, LIVE CLOCK & 5-THEME SWITCHER (2026 UPGRADE)
   ========================================================================== */
.header {
  gap: 0.65rem !important;
  padding: 0 1.15rem !important;
  border-top: 3px solid var(--primary) !important;
}

.header-title {
  font-size: 1.02rem !important;
  font-weight: 800 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 140px;
  flex: 0 1 auto !important;
  margin-right: auto !important;
}

/* Topbar Global Search */
.topbar-search-wrapper {
  position: relative;
  width: 270px;
  max-width: 32vw;
  flex-shrink: 1;
}

.topbar-search-box {
  display: flex;
  align-items: center;
  background: #F8FAFC;
  border: 1.5px solid #CBD5E1;
  border-radius: 20px;
  padding: 0.28rem 0.7rem;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.topbar-search-box:focus-within {
  background: #FFFFFF;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  width: 100%;
}

.topbar-search-icon {
  font-size: 0.82rem;
  color: #64748B;
  flex-shrink: 0;
}

.topbar-search-input {
  border: none;
  background: transparent;
  width: 100%;
  font-size: 0.79rem;
  font-weight: 600;
  color: #0F172A;
  outline: none;
}

.topbar-search-input::placeholder {
  color: #94A3B8;
  font-weight: 500;
}

.topbar-search-kbd {
  font-size: 0.64rem;
  font-weight: 700;
  color: #64748B;
  background: #E2E8F0;
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.topbar-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 360px;
  max-height: 420px;
  overflow-y: auto;
  background: #FFFFFF;
  border: 1.5px solid #E2E8F0;
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.14);
  z-index: 9999;
  display: none;
  padding: 0.5rem;
}

.topbar-search-results.open {
  display: block;
}

.search-result-group-title {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #64748B;
  padding: 0.35rem 0.6rem 0.2rem;
  letter-spacing: 0.04em;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.48rem 0.65rem;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s;
}

.search-result-item:hover {
  background: var(--bg-card-hover);
}

.search-result-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #F1F5F9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.search-result-info {
  flex: 1;
  min-width: 0;
}

.search-result-title {
  font-size: 0.81rem;
  font-weight: 700;
  color: #0F172A;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-sub {
  font-size: 0.7rem;
  color: #64748B;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Topbar Live Clock */
.topbar-clock-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  padding: 0.32rem 0.68rem;
  border-radius: 10px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #1E293B;
  white-space: nowrap;
  flex-shrink: 0;
}

.topbar-clock-time {
  color: var(--primary-dark);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.topbar-clock-date {
  color: #475569;
  font-weight: 600;
  border-left: 1px solid #CBD5E1;
  padding-left: 0.4rem;
}

/* Topbar Theme Switcher Dropdown */
.theme-dropdown-container {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.theme-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 245px;
  background: #FFFFFF;
  border: 1.5px solid #E2E8F0;
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
  padding: 0.55rem;
  z-index: 9999;
  display: none;
}

.theme-dropdown-menu.open {
  display: block;
}

.theme-option-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.6rem;
  border-radius: 9px;
  cursor: pointer;
  font-size: 0.79rem;
  font-weight: 700;
  color: #1E293B;
  transition: all 0.15s;
}

.theme-option-item:hover {
  background: #F8FAFC;
}

.theme-option-item.active {
  background: var(--bg-card-hover);
  color: var(--primary-dark);
  font-weight: 800;
}

.theme-swatch-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid #FFFFFF;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.15);
}

@media (max-width: 1100px) {
  .topbar-clock-date {
    display: none;
  }
  .topbar-search-wrapper {
    width: 190px;
  }
}

@media (max-width: 768px) {
  .topbar-clock-badge {
    display: none;
  }
  .topbar-search-wrapper {
    width: 140px;
  }
  .topbar-search-kbd {
    display: none;
  }
  .topbar-search-results {
    width: 290px;
    left: auto;
    right: -40px;
  }
}

/* ==========================================================================
   5 COLOR THEMES ENGINE (EMERALD, OCEAN, PURPLE, AMBER, ROSE)
   ========================================================================== */

/* Theme 2: Royal Ocean Blue (🌊 Xanh Dương Hoàng Gia) */
html[data-color-theme="ocean"],
body[data-color-theme="ocean"] {
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --primary-glow: rgba(37, 99, 235, 0.22);
  --secondary: #0284C7;
  --accent-solar: #1D4ED8;
  --accent-green: #2563EB;
  --bg-base: #F0F6FF;
  --bg-card-hover: #EFF6FF;
  --border-active: #2563EB;
}

/* Theme 3: Executive Violet Purple (🔮 Tím Hoàng Gia) */
html[data-color-theme="purple"],
body[data-color-theme="purple"] {
  --primary: #7C3AED;
  --primary-dark: #5B21B6;
  --primary-glow: rgba(124, 58, 237, 0.22);
  --secondary: #9333EA;
  --accent-solar: #6D28D9;
  --accent-green: #7C3AED;
  --bg-base: #F6F3FF;
  --bg-card-hover: #F5F3FF;
  --border-active: #7C3AED;
}

/* Theme 4: Solar Sunset Amber (🌅 Vàng Cam Năng Lượng) */
html[data-color-theme="amber"],
body[data-color-theme="amber"] {
  --primary: #D97706;
  --primary-dark: #B45309;
  --primary-glow: rgba(217, 119, 6, 0.22);
  --secondary: #EA580C;
  --accent-solar: #B45309;
  --accent-green: #D97706;
  --bg-base: #FFFBF0;
  --bg-card-hover: #FFFBEB;
  --border-active: #D97706;
}

/* Theme 5: Crimson Ruby Corporate (🌹 Đỏ Ruby Doanh Nghiệp) */
html[data-color-theme="rose"],
body[data-color-theme="rose"] {
  --primary: #E11D48;
  --primary-dark: #BE123C;
  --primary-glow: rgba(225, 29, 72, 0.22);
  --secondary: #DB2777;
  --accent-solar: #BE123C;
  --accent-green: #E11D48;
  --bg-base: #FFF5F7;
  --bg-card-hover: #FFF1F2;
  --border-active: #E11D48;
}

/* Dynamic Theme Binding for Sidebar, Active Nav, Header, Tables & Buttons */
html[data-color-theme]:not([data-color-theme="emerald"]) .sidebar-logo {
  border-color: var(--primary) !important;
}
html[data-color-theme]:not([data-color-theme="emerald"]) .sidebar-toggle-btn {
  background: var(--primary) !important;
  color: #FFFFFF !important;
}
html[data-color-theme]:not([data-color-theme="emerald"]) .nav-group.open > .nav-group-header {
  color: var(--primary-dark) !important;
}
html[data-color-theme]:not([data-color-theme="emerald"]) .nav-group.open > .nav-group-header .group-arrow {
  color: var(--primary) !important;
}
html[data-color-theme]:not([data-color-theme="emerald"]) .nav-item.active,
html[data-color-theme]:not([data-color-theme="emerald"]) .nav-group-items .nav-item.active {
  background: var(--bg-card-hover) !important;
  color: var(--primary-dark) !important;
  border-color: var(--primary) !important;
  box-shadow: 0 2px 8px var(--primary-glow) !important;
}
html[data-color-theme]:not([data-color-theme="emerald"]) .nav-item.active .nav-icon {
  color: var(--primary-dark) !important;
}
html[data-color-theme]:not([data-color-theme="emerald"]) .btn-topbar-action:hover {
  background: var(--bg-card-hover) !important;
  border-color: var(--primary) !important;
  color: var(--primary-dark) !important;
}
html[data-color-theme]:not([data-color-theme="emerald"]) .table-wrapper table th {
  background: var(--bg-card-hover) !important;
  color: var(--primary-dark) !important;
}
html[data-color-theme]:not([data-color-theme="emerald"]) .btn-primary,
html[data-color-theme]:not([data-color-theme="emerald"]) .btn-solar {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
  border-color: var(--primary-dark) !important;
  color: #FFFFFF !important;
}
html[data-color-theme]:not([data-color-theme="emerald"]) .sidebar {
  border-right: 1.5px solid var(--primary-glow) !important;
}
html[data-color-theme]:not([data-color-theme="emerald"]) .card {
  box-shadow: 0 4px 18px var(--primary-glow) !important;
}
html[data-color-theme]:not([data-color-theme="emerald"]) #header-title {
  color: var(--primary-dark) !important;
}
html[data-color-theme]:not([data-color-theme="emerald"]) #ai-fab {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
}



