  body {
    font-family: "Plus Jakarta Sans", sans-serif;
    background-color: #f0f4ff;
  }

  /* COMPACT FLATPICKR STYLES */
  .flatpickr-calendar {
    font-size: 11px !important;
    width: 256px !important;
    border-radius: 10px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05) !important;
  }
  .flatpickr-calendar.doubleView {
    width: 512px !important;
  }
  .flatpickr-days {
    width: 256px !important;
  }
  .dayContainer {
    width: 256px !important;
    min-width: 256px !important;
    max-width: 256px !important;
  }
  .flatpickr-day {
    max-width: 33px !important;
    height: 30px !important;
    line-height: 30px !important;
    font-size: 10px !important;
    border-radius: 6px !important;
  }
  .flatpickr-day.selected, .flatpickr-day.startRange, .flatpickr-day.endRange {
    background: #880e4f !important;
    border-color: #880e4f !important;
  }
  .flatpickr-day.inRange {
    background: #fdf2f8 !important;
    box-shadow: -5px 0 0 #fdf2f8, 5px 0 0 #fdf2f8 !important;
  }
  .flatpickr-months .flatpickr-month {
    height: 28px !important;
  }
  .flatpickr-current-month {
    font-size: 13px !important;
    padding: 0 !important;
    height: 28px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
  }
  .flatpickr-current-month select,
  .flatpickr-current-month .flatpickr-monthDropdown-months {
    font-size: 13px !important;
    height: 22px !important;
    padding: 0 4px !important;
    font-weight: 700 !important;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    cursor: pointer !important;
    width: auto !important;
    margin: 0 !important;
    -webkit-appearance: menulist !important;
    -moz-appearance: menulist !important;
    appearance: menulist !important;
  }
  .flatpickr-current-month .numInputWrapper {
    width: 60px !important;
    height: 22px !important;
    display: inline-block !important;
  }
  .flatpickr-current-month input.cur-year {
    font-size: 13px !important;
    font-weight: 700 !important;
    height: 22px !important;
    line-height: 22px !important;
    padding: 0 !important;
    margin: 0 !important;
    text-align: center !important;
  }
  .flatpickr-weekday {
    font-size: 9px !important;
    font-weight: 800 !important;
  }

  /* Fix MonthSelect year shift and cell sizes */
  .flatpickr-calendar.month-only,
  .flatpickr-calendar:has(.flatpickr-monthSelect-months) {
    width: 200px !important;
    font-size: 11px !important;
  }
  .flatpickr-calendar.month-only .flatpickr-months,
  .flatpickr-calendar:has(.flatpickr-monthSelect-months) .flatpickr-months {
    width: 100% !important;
    display: block !important;
    position: relative !important;
  }
  .flatpickr-calendar.month-only .flatpickr-months .flatpickr-month,
  .flatpickr-calendar:has(.flatpickr-monthSelect-months) .flatpickr-months .flatpickr-month {
    height: 32px !important;
    width: 100% !important;
  }
  .flatpickr-calendar.month-only .flatpickr-current-month,
  .flatpickr-calendar:has(.flatpickr-monthSelect-months) .flatpickr-current-month {
    height: 32px !important;
    padding: 0 !important;
    font-size: 13px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    width: 100% !important;
    left: 0 !important;
  }
  .flatpickr-calendar.month-only .flatpickr-current-month .numInputWrapper,
  .flatpickr-calendar:has(.flatpickr-monthSelect-months) .flatpickr-current-month .numInputWrapper {
    height: 20px !important;
    width: 55px !important;
    display: inline-block !important;
  }
  .flatpickr-calendar.month-only .flatpickr-current-month input.cur-year,
  .flatpickr-calendar:has(.flatpickr-monthSelect-months) .flatpickr-current-month input.cur-year {
    padding: 0 !important;
    height: 20px !important;
    line-height: 20px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    text-align: center !important;
  }
  .flatpickr-calendar.month-only .flatpickr-monthSelect-months,
  .flatpickr-calendar:has(.flatpickr-monthSelect-months) .flatpickr-monthSelect-months {
    padding: 6px !important;
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: space-around !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
  }
  .flatpickr-calendar.month-only .flatpickr-monthSelect-month,
  .flatpickr-calendar:has(.flatpickr-monthSelect-months) .flatpickr-monthSelect-month {
    display: inline-block !important;
    width: 30% !important;
    height: 26px !important;
    line-height: 26px !important;
    padding: 0 !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    border-radius: 5px !important;
    box-sizing: border-box !important;
    margin: 2px 0 !important;
    text-align: center !important;
  }
  .flatpickr-calendar.month-only .flatpickr-monthSelect-month.selected,
  .flatpickr-calendar:has(.flatpickr-monthSelect-months) .flatpickr-monthSelect-month.selected {
    background: #880e4f !important;
    color: #fff !important;
    border-color: #880e4f !important;
  }
  .flatpickr-calendar.month-only .flatpickr-monthSelect-month:hover,
  .flatpickr-calendar:has(.flatpickr-monthSelect-months) .flatpickr-monthSelect-month:hover {
    background: #fce7f3 !important;
    color: #880e4f !important;
  }
  .flatpickr-calendar.month-only .flatpickr-prev-month,
  .flatpickr-calendar.month-only .flatpickr-next-month,
  .flatpickr-calendar:has(.flatpickr-monthSelect-months) .flatpickr-prev-month,
  .flatpickr-calendar:has(.flatpickr-monthSelect-months) .flatpickr-next-month {
    height: 32px !important;
    padding: 0 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    top: 0 !important;
  }
  .flatpickr-calendar.month-only .flatpickr-prev-month,
  .flatpickr-calendar:has(.flatpickr-monthSelect-months) .flatpickr-prev-month {
    left: 0 !important;
  }
  .flatpickr-calendar.month-only .flatpickr-next-month,
  .flatpickr-calendar:has(.flatpickr-monthSelect-months) .flatpickr-next-month {
    right: 0 !important;
  }

  .no-scrollbar::-webkit-scrollbar {
    display: none;
  }

  .no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  input::-webkit-outer-spin-button,
  input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
  }

  input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
  }

  /* ===== SIDEBAR LAYOUT V3 ===== */
  #sidebar {
    width: 240px;
    height: 100%;
    flex-shrink: 0;
    background: linear-gradient(180deg, #0f172a 0%, #1e1b4b 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 100;
    overflow: hidden;
  }

  #sidebar.collapsed {
    width: 72px;
  }

  #sidebar.collapsed .brand-container {
    padding: 1rem 0 0.25rem 0 !important;
    margin-bottom: 0.25rem !important;
    justify-content: center !important;
    gap: 0 !important;
  }

  /* Brand Logo Hover Toggle Indicators */
  .brand-logo-box {
    position: relative;
  }
  
  .brand-logo-box .brand-expand-icon,
  .brand-logo-box .brand-collapse-icon {
    display: none !important;
  }

  #sidebar.collapsed .brand-container:hover .brand-logo-icon {
    display: none !important;
  }
  
  #sidebar.collapsed .brand-container:hover .brand-expand-icon {
    display: block !important;
  }

  #sidebar:not(.collapsed) .brand-container:hover .brand-logo-icon {
    display: none !important;
  }
  
  #sidebar:not(.collapsed) .brand-container:hover .brand-collapse-icon {
    display: block !important;
  }

  #sidebar.collapsed .user-container {
    padding: 1rem 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 8px !important;
  }

  #sidebar.collapsed #user-info {
    justify-content: center !important;
    margin-bottom: 0 !important;
    gap: 0 !important;
  }

  #sidebar.collapsed #user-info div {
    display: none !important;
  }

  #sidebar.collapsed .brand-name,
  #sidebar.collapsed .brand-sub,
  #sidebar.collapsed .nav-label,
  #sidebar.collapsed .sidebar-footer-text {
    display: none !important;
  }

  .nav-label-collapsed {
    display: none;
  }

  #sidebar.collapsed .nav-label-collapsed {
    display: block !important;
    font-size: 8px;
    font-weight: 800;
    text-align: center;
    margin-top: 4px;
    white-space: nowrap;
    letter-spacing: 0.02em;
  }

  #sidebar.collapsed .sidebar-nav-item,
  #sidebar.collapsed .sidebar-sub-item {
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 10px 4px !important;
    margin: 4px 6px !important;
    gap: 2px !important;
  }

  #sidebar.collapsed .sidebar-nav-item i,
  #sidebar.collapsed .sidebar-sub-item i {
    font-size: 20px !important;
    margin: 0 !important;
    width: auto !important;
  }

  #main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
    overflow: hidden;
  }

  /* Toggle button removed from floating position */

  .toggle-sidebar-btn i {
    font-size: 9px;
    color: white;
    transition: transform 0.35s;
  }

  #sidebar.collapsed .toggle-sidebar-btn i {
    transform: rotate(180deg);
  }

  .sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    margin: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
  }

  .sidebar-nav-item:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #e2e8f0;
  }

  .sidebar-nav-item.active {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.3);
  }

  .sidebar-nav-item i {
    font-size: 14px;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
  }

  /* ===== SIDEBAR SUB-MENU V3 ===== */
  .sidebar-group-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    margin: 12px 8px 4px;
    font-size: 10px;
    font-weight: 800;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.1em;
  }

  .sidebar-sub-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 20px 9px 44px;
    margin: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
  }

  .sidebar-sub-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
  }

  .sidebar-sub-item.active {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
  }

  .sidebar-sub-menu {
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
    max-height: 200px;
  }

  .sidebar-sub-menu.collapsed {
    max-height: 0 !important;
  }

  #sidebar.collapsed .sidebar-group-header {
    opacity: 0;
    display: none;
  }

  #sidebar.collapsed .sidebar-sub-menu {
    max-height: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    display: flex !important;
    flex-direction: column !important;
  }

  #sidebar.collapsed .sidebar-nav-item .fa-chevron-down,
  #sidebar.collapsed .sidebar-nav-item .fa-chevron-up,
  #sidebar.collapsed .sidebar-nav-item .fa-chevron-right,
  #sidebar.collapsed .sidebar-nav-item #chevron-kpi-group {
    display: none !important;
  }

  /* ===== REPORT GALLERY V3 ===== */

  .report-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    position: relative;
  }

  .report-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-color: #6366f1;
  }

  .report-thumb {
    height: 140px;
    background: #f8fafc;
    overflow: hidden;
    position: relative;
  }

  .report-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
  }

  .report-card:hover .report-thumb img {
    transform: scale(1.1);
  }

  .report-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 10px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    color: white;
    border-radius: 20px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .report-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
  }

  .report-title {
    font-size: 14px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 4px;
    line-height: 1.4;
  }

  .report-desc {
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
  }


  #top-bar {
    height: 54px;
    background: white;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    flex-shrink: 0;
  }

  /* ===== HIGH-TECH LOGO ===== */
  .logo-high-tech {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;

    animation: neon-pulse 2.5s infinite alternate ease-in-out;
    display: inline-block;
  }

  @keyframes neon-pulse {
    from {
      filter: drop-shadow(0 0 3px #6366f1);
    }

    to {
      filter: drop-shadow(0 0 10px #a855f7);
    }
  }

  .label-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.05em;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.25s;
  }

  .label-badge.active {
    border-color: currentColor;
    transform: scale(1.05);
  }

  .tab-btn {
    padding: 0.35rem 1rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: #94a3b8;
    transition: all 0.3s;
    border-radius: 0.5rem;
  }

  .tab-btn:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.05);
  }

  .tab-active {
    color: #ffffff !important;
    background: rgba(99, 102, 241, 0.2) !important;
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.4);
  }


  .sticky-col {
    position: sticky;
    left: 0;
    z-index: 10;
    border-right: 1px solid #e2e8f0;
    min-width: 100px;
  }

  th.sticky-col.w-\[35px\],
  td.sticky-col.w-\[35px\] {
    min-width: 35px !important;
    max-width: 35px !important;
    width: 35px !important;
  }

  th.sticky-col.w-\[30px\],
  td.sticky-col.w-\[30px\] {
    min-width: 30px !important;
    max-width: 30px !important;
    width: 30px !important;
  }

  /* === Student Report Header: single source of truth for padding & line-height === */
  #student-report-head tr:first-child th,
  #student-age-report-head tr:first-child th {
    padding: 0.5rem 0.25rem !important;
    white-space: normal !important;
    line-height: 1.25 !important;
    vertical-align: middle !important;
  }
  #student-report-head tr:last-child th,
  #student-age-report-head tr:last-child th {
    padding: 0.4rem 0.25rem !important;
    white-space: nowrap !important;
    line-height: 1.25 !important;
    vertical-align: middle !important;
  }

  /* Đồng bộ hover và phân tầng màu sắc cho báo cáo tuyển sinh */
  #report-table-el tbody tr.report-row-l0 {
    background-color: #fcf5f8 !important;
    color: #880e4f !important;
    font-weight: 900;
  }
  #report-table-el tbody tr.report-row-l0 td.sticky-col {
    background-color: #fcf5f8 !important;
  }

  #report-table-el tbody tr.report-row-l1 {
    background-color: #f8fafc !important;
    color: #1e293b !important;
    font-weight: bold;
  }
  #report-table-el tbody tr.report-row-l1 td.sticky-col {
    background-color: #f8fafc !important;
  }

  #report-table-el tbody tr.report-row-l2 {
    background-color: #ffffff !important;
    color: #475569 !important;
    font-weight: 600;
  }
  #report-table-el tbody tr.report-row-l2 td.sticky-col {
    background-color: #ffffff !important;
  }

  #report-table-el tbody tr.report-row-l3 {
    background-color: #ffffff !important;
    color: #64748b !important;
  }
  #report-table-el tbody tr.report-row-l3 td.sticky-col {
    background-color: #ffffff !important;
  }

  #report-table-el tbody tr:hover td {
    background-color: #f1f5f9 !important;
  }

  .bg-white-sticky {
    background-color: white !important;
  }

  .bg-special-sticky {
    background-color: #f1f5f9 !important;
  }

  .bg-today-sticky {
    background-color: #dbeafe !important;
  }

  .day-input {
    width: 46px;
    text-align: center;
    border-radius: 0.3rem;
    border: 1px solid #e2e8f0;
    padding: 0.15rem 0;
    font-weight: 800;
    font-size: 0.85rem;
    background: transparent;
    transition: all 0.2s;
  }

  .input-goc {
    border-bottom: 2px solid #10b981;
  }

  .input-gap {
    border-bottom: 2px solid #f59e0b;
  }

  .input-tt {
    border-bottom: 2px solid #6366f1;
  }

  .input-special {
    border-bottom: 2px solid #cbd5e1 !important;
  }

  /* Style cho các sub-headers của KPI để tránh lỗi màu khi load động */
  .kpi-hdr-goc {
    color: #34d399 !important;
  }
  .kpi-hdr-gap {
    color: #fbbf24 !important;
  }
  .kpi-hdr-tt {
    color: #818cf8 !important;
    background-color: rgba(49, 46, 129, 0.25) !important;
  }

  .day-input:focus {
    outline: none;
    border-color: #6366f1;
    background: #fff;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
  }

  .special-row {
    background-color: #f1f5f9 !important;
  }

  .today-row {
    background-color: #dbeafe !important;
    border-left: 4px solid #2563eb;
  }

  .metric-card {
    background: white;
    border: 1px solid #eef2ff;
    border-radius: 1.1rem;
    padding: 0.6rem 0.9rem;
    width: 100%;
    min-height: 85px;
    position: relative;
    border-left: 5px solid #e2e8f0;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.3s, box-shadow 0.3s, background-color 0.2s, color 0.2s;
    flex-shrink: 0;
    overflow: visible;
  }

  .metric-card:hover {
    transform: translateY(-4px);
    border-color: #6366f1;
    box-shadow: 0 12px 24px -8px rgba(99, 102, 241, 0.25);
  }

  .card-active-highlight {
    border-color: #4f46e5 !important;
    border-width: 2px !important;
    border-left-width: 6px !important;
    transform: translateY(-4px) !important;
    box-shadow: 0 15px 30px -10px rgba(79, 70, 229, 0.3) !important;
    z-index: 50 !important;
  }

  .target-val-display {
    font-size: 1.7rem;
    font-weight: 900;
    color: #1e293b;
    line-height: 1.1;
    letter-spacing: -0.02em;
    transition: color 0.2s;
  }

  .table-main {
    border-collapse: separate;
    border-spacing: 0;
  }

  .table-fixed {
    table-layout: fixed !important;
    width: max-content !important;
  }

  .table-main th {
    white-space: nowrap;
    padding: 0.25rem 0.4rem;
    transition: background-color 0.2s;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
  }

  .table-main td {
    white-space: nowrap;
    padding: 0.25rem 0.4rem;
    transition: background-color 0.2s;
    border-right: 1px solid #e2e8f0 !important;
    border-bottom: 1px solid #e2e8f0 !important;
  }

  .table-main tr:hover td {
    background-color: #f8fafc !important;
  }

  /* Hover riêng biệt cho ô STT */
  .table-main td.stt-cell-hover:hover {
    background-color: #ffe4e6 !important;
    color: #880e4f !important;
  }

  /* Bảo toàn màu nền cảnh báo trùng và sửa đổi khi hover dòng */
  .table-main tr.bg-rose-50\/70 td,
  .table-main tr.bg-rose-50 td,
  .table-main tr.bg-red-50 td,
  .table-main tr.bg-red-50\/70 td {
    background-color: #fff1f2 !important;
  }
  .table-main tr.bg-rose-50\/70:hover td,
  .table-main tr.bg-rose-50:hover td,
  .table-main tr.bg-red-50:hover td,
  .table-main tr.bg-red-50\/70:hover td {
    background-color: #ffe4e6 !important;
  }

  .table-main tr.bg-amber-100\/60 td,
  .table-main tr.bg-amber-100 td {
    background-color: #fef3c7 !important;
  }
  .table-main tr.bg-amber-100\/60:hover td,
  .table-main tr.bg-amber-100:hover td {
    background-color: #fde68a !important;
  }

  .row-hover:hover {
    background-color: rgba(99, 102, 241, 0.04);
  }

  .summary-input {
    width: 100%;
    max-width: 70px;
    text-align: right;
    padding: 4px 8px;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    font-weight: 800;
    font-size: 0.85rem;
    background-color: #ffffff;
    transition: all 0.2s;
  }

  .summary-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.05);
  }

  .bg-branch-row {
    background-color: #f5f3ff !important;
  }

  .input-branch {
    border-color: #8b5cf6 !important;
  }

  .text-branch-label {
    color: #6d28d9;
  }

  .coi-input {
    width: 100%;
    padding: 2px 4px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    outline: none;
    transition: border-color 0.2s;
    cursor: text !important;
    color: #1e293b !important;
    caret-color: #0f172a !important;
  }

  .coi-input[type="date"],
  .coi-input[type="checkbox"],
  select.coi-input {
    cursor: pointer;
  }

  .coi-input:focus {
    border-color: #6366f1;
    background-color: #fff;
  }

  .table-main input[type="text"],
  .table-main input[type="tel"] {
    cursor: text !important;
    color: #1e293b !important;
    caret-color: #0f172a !important;
  }

  .coi-input-sm {
    min-width: 5px !important;
    text-align: center;
  }

  /* Column Resizer */
  .coi-resizer {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    cursor: col-resize;
    z-index: 30;
    transition: background-color 0.2s;
  }

  .coi-resizer:hover,
  .resizing-col .coi-resizer {
    background-color: #6366f1;
  }

  .resizing-col {
    cursor: col-resize;
    user-select: none;
  }

  .table-main th {
    position: relative;
  }

  .table-main td {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #unsaved-modal,
  #message-modal {
    display: none;
  }

  .nhan-asc {
    color: #dc2626;
    background: #fff1f2;
  }

  .nhan-tds {
    color: #1d4ed8;
    background: #eff6ff;
  }

  .nhan-skr {
    color: #db2777;
    background: #fdf2f8;
  }

  .nhan-default {
    color: #92400e;
    background: #fffbeb;
  }

  .breakdown-row {
    background-color: #f8fafc !important;
  }

  .breakdown-row td {
    padding: 3px 4px !important;
    border-bottom: 2px solid #e2e8f0 !important;
  }

  .ratio-badge {
    font-size: 10px;
    font-weight: 900;
    padding: 2px 7px;
    border-radius: 6px;
    letter-spacing: 0.02em;
    white-space: nowrap;
    display: inline-block;
  }

  .ratio-ok {
    background: #dcfce7;
    color: #15803d;
  }

  .ratio-warn {
    background: #fef9c3;
    color: #a16207;
  }

  .ratio-low {
    background: #fee2e2;
    color: #b91c1c;
  }

  .ratio-none {
    background: #f1f5f9;
    color: #94a3b8;
  }

  /* KPI DESCRIPTION POPOVER */
  .kpi-popover {
    position: absolute;
    z-index: 300;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    padding: 12px 16px;
    width: 240px;
    max-height: 200px;
    overflow-y: auto;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.5;
    color: #334155;
    animation: popover-in 0.2s cubic-bezier(0, 0.2, 0.2, 1);
    pointer-events: auto;
  }

  @keyframes popover-in {
    from { opacity: 0; transform: translateY(-5px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }

  /* kpi-popover-header and close removed for minimalist look */

  .kpi-header-clickable {
    position: relative;
    transition: all 0.2s;
  }
  .kpi-header-clickable:hover {
    background-color: #1e293b !important;
    color: #a5b4fc !important;
  }
  .kpi-info-icon {
    opacity: 0.15;
    margin-left: 5px;
    font-size: 10px;
    transition: opacity 0.2s, transform 0.2s;
  }
  .kpi-header-clickable:hover .kpi-info-icon {
    opacity: 1;
    transform: scale(1.2);
  }

  /* Login overlay */
  #login-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 55%, #312e81 100%);
    display: none;
    align-items: center;
    justify-content: center;
  }

  .login-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 28px;
    padding: 3.5rem 3rem;
    width: 400px;
    text-align: center;
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.6);
  }


  /* Report dropdown */
  .report-tab-wrapper {
    position: relative;
  }

  .report-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding-top: 6px;
    z-index: 200;
    display: none;
    flex-direction: column;
  }

  .report-dropdown-content {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 6px;
    min-width: 200px;
    max-width: 280px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  /* hover dropdown removed */
  .report-dropdown-header {
    font-size: 9px;
    font-weight: 900;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 2px 8px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 2px;
  }

  .report-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    color: #cbd5e1;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .report-dropdown-item:hover {
    background: rgba(99, 102, 241, 0.25);
    color: #fff;
  }

  .report-dropdown-empty {
    padding: 10px 12px;
    font-size: 11px;
    color: #475569;
    font-style: italic;
    text-align: center;
  }

  /* COI filter */
  .coi-filter-trigger {
    opacity: 0.3;
    cursor: pointer;
    margin-left: 3px;
    font-size: 8px;
    transition: opacity 0.2s;
  }

  .coi-filter-popup {
    position: absolute;
    top: 100%;
    left: 0;
    width: 180px;
    max-height: 250px;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 100;
    display: none;
    flex-direction: column;
    overflow: hidden;
  }

  .coi-filter-popup.open {
    display: flex;
  }

  .coi-filter-list {
    overflow-y: auto;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 1px;
  }

  .coi-filter-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 600;
    color: #475569;
  }

  .coi-filter-item:hover {
    background: #f1f5f9;
  }

  .coi-required:after {
    content: " *";
    color: #ef4444;
    font-weight: bold;
  }

  .coi-invalid {
    border-color: #fca5a5 !important;
    background-color: #fef2f2 !important;
  }

  .coi-filter-actions {
    padding: 6px;
    border-top: 1px solid #f1f5f9;
    background: #f8fafc;
    display: flex;
    justify-content: space-between;
  }

  .coi-filter-btn {
    font-size: 9px;
    font-weight: 800;
    color: #4f46e5;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
  }

  /* Detail sidebar */
  #coi-sidebar {
    position: fixed;
    top: 54px;
    right: 0;
    bottom: 0;
    width: 340px;
    z-index: 200;
    background: #fff;
    border-left: 1px solid #e2e8f0;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.10);
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  #coi-sidebar.open {
    transform: translateX(0);
  }

  #coi-sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 199;
    background: rgba(15, 23, 42, 0.25);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s;
  }

  #coi-sidebar-overlay.open {
    opacity: 1;
    pointer-events: auto;
  }

  /* System Overlays */
  #maintenance-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: radial-gradient(circle at center, #1e293b, #0f172a);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    padding: 40px;
  }

  #announce-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
  }

  .ann-card {
    background: white;
    border-radius: 24px;
    width: 500px;
    max-width: 100%;
    box-shadow: 0 40px 90px -15px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: modalEnter 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  }

  @keyframes modalEnter {
    from {
      opacity: 0;
      transform: scale(0.9) translateY(20px);
    }

    to {
      opacity: 1;
      transform: scale(1) translateY(0);
    }
  }

  .ann-header {
    background: #6366f1;
    padding: 20px 24px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .ann-body {
    padding: 32px;
    color: #334155;
    font-size: 14px;
    line-height: 1.6;
    max-height: 60vh;
    overflow-y: auto;
  }

  .ann-footer {
    padding: 20px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: flex-end;
  }

  .btn-close-ann {
    background: #f1f5f9;
    color: #475569;
    padding: 10px 24px;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
  }

  .btn-close-ann:hover {
    background: #e2e8f0;
    color: #1e293b;
  }

  /* Filter Bar Consistency */
  #main-filter-bar,
  #report-combined-header {
    min-height: 46px;
    height: 46px;
  }

  #report-tab-bar {
    min-height: 32px;
  }

  .report-tab-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    font-size: 11px;
    font-weight: 800;
    color: #64748b;
    transition: all 0.2s;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    border: 1px solid transparent;
  }

  .report-tab-item:hover {
    background: #f1f5f9;
    color: #4f46e5;
  }

  .report-tab-item.active {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #dbeafe;
    box-shadow: 0 2px 4px rgba(29, 78, 216, 0.05);
  }

  .report-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    background: #f8fafc;
    overflow: hidden;
  }

  .report-title-bar {
    padding: 8px 16px;
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    font-weight: 800;
    color: #1e293b;
  }

  #report-iframe {
    width: 100%;
    flex-grow: 1;
    border: none;
    display: none;
  }

  .report-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
    background: #f8fafc;
  }

  @keyframes spin-slow {
    from {
      transform: rotate(0deg);
    }

    to {
      transform: rotate(360deg);
    }
  }

  .animate-spin-slow {
    animation: spin-slow 3s linear infinite;
  }

  /* System Splash & Maintenance */
  #maintenance-overlay i {
    font-size: 64px;
    color: #fbbf24;
    margin-bottom: 24px;
    animation: bounce 2s infinite;
  }

  #maintenance-overlay h1 {
    font-size: 28px;
    font-weight: 900;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: -1px;
  }

  #maintenance-overlay p {
    color: #94a3b8;
    max-width: 480px;
    line-height: 1.6;
  }

  #announce-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
  }

  .announce-card {
    background: white;
    width: 100%;
    max-width: 500px;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  .announce-header {
    background: linear-gradient(135deg, #6366f1, #4338ca);
    padding: 30px 24px;
    text-align: center;
    color: white;
  }

  .announce-body {
    padding: 32px 24px;
    color: #475569;
    line-height: 1.6;
    max-height: 60vh;
    overflow-y: auto;
  }

  /* TN RIÊNG MODULE STYLES */
  .date-cell {
    height: 40px;
    height: auto;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    border-radius: 0px !important;
    transition: all 0.1s ease;
    border: 0.5px solid #f1f5f9;
    cursor: pointer;
    padding: 4px;
    box-sizing: border-box;
  }

  .date-cell:hover {
    background: linear-gradient(135deg, #c5e3ff 0%, #93c5fd 100%);
    z-index: 5;
    border-color: #497ce1;
    transform: scale(1.02);
    box-shadow: 0 4px 6px -1px rgba(73, 124, 225, 0.3);
  }

  .date-cell.active {
    background: linear-gradient(135deg, #447adf 0%, #3b82f6 100%) !important;
    z-index: 10;
    box-shadow: 0 4px 12px -2px rgba(68, 122, 223, 0.5);
    transform: scale(1.03);
    color: white !important;
  }

  .date-cell.active .label-mini,
  .date-cell.active .label-mini-tn {
    color: #bccde1 !important;
  }

  .date-cell.active .val-q,
  .date-cell.active .val-l {
    color: #6ee7b7 !important;
  }

  .date-cell.active .val-b {
    color: #fdba74 !important;
  }

  .date-cell.weekend {
    background-color: #f8fafc !important;
  }

  .date-cell.weekend .day-num {
    color: #f43f5e;
    opacity: 0.6;
  }

  .date-cell.active .day-num {
    color: white !important;
    opacity: 1 !important;
  }

  .date-cell .day-num {
    position: absolute;
    top: 4px;
    left: 6px;
    font-size: 10px;
    font-weight: 800;
    opacity: 0.4;
  }

  /* MATRIX INPUTS - TN RIÊNG */
  .matrix-input-tn,
  .matrix-input {
    width: 40px;
    text-align: right;
    font-weight: 700;
    font-size: 14px;
    padding: 0px 0px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    transition: all 0.1s;
  }

  .matrix-input-tn:focus,
  .matrix-input:focus {
    outline: none;
    border-color: #6366f1;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15), 0 2px 4px rgba(99, 102, 241, 0.1);
    transform: scale(1.05);
  }

  .mi-goc-tn,
  .mi-goc {
    color: #059669;
    background: #f0fdf4;
    border: 0.5px solid;
    border-left: 3.5px solid #10b981;
  }

  .mi-gap-tn,
  .mi-gap {
    color: #d97706;
    background: #fffbeb;
    border: 0.5px solid;
    border-left: 3.5px solid #f59e0b;
  }

  .ql-input-row {
    background-color: #c4e2fb;
    border-radius: 5px;
  }

  .l-input-row {
    background-color: #ffebb3;
    border-radius: 5px;
  }

  .header-badge-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.12);
    padding: 2px 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 65px;
  }

  .badge-label-top {
    font-size: 9px;
    font-weight: 900;
    opacity: 0.7;
    margin-bottom: -2px;
  }

  .badge-values-row {
    display: flex;
    gap: 8px;
    align-items: center;
  }

  .val-goc {
    color: #4ade80;
    font-weight: 900;
    font-size: 13px;
  }

  .val-bu {
    color: #fbbf24;
    font-weight: 900;
    font-size: 13px;
  }

  .card-breakdown {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    width: 100%;
  }

  .bd-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4px;
  }

  .bd-label {
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .bd-val {
    font-size: 12px;
    font-weight: 800;
    color: #ffffff;
  }

  .filter-popover {
    position: fixed;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    min-width: 220px;
    padding: 12px;
    display: none;
    max-height: 300px;
    overflow-y: auto;
  }

  .filter-popover.active {
    display: block;
    animation: fadeInDown 0.2s ease-out;
  }

  @keyframes fadeInDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .filter-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    transition: background 0.2s;
    color: #334155;
  }

  .filter-item:hover {
    background: #f8fafc;
  }

  .filter-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #6366f1;
  }


  .cal-line {
    font-size: 10px;
    font-weight: 700;
    display: flex;
    gap: 3px;
    align-items: center;
    margin-bottom: 1px;
    width: 100%;
  }

  .label-mini-tn,
  .label-mini {
    font-size: 11px;
    font-weight: 900;
    color: #94a3b8;
    width: 14px;
  }

  .val-l,
  .val-q {
    color: #10b981;
  }

  .val-b {
    color: #f59e0b;
  }

  .date-cell.active .label-mini-tn {
    color: rgba(255, 255, 255, 0.7) !important;
  }

  .mi-goc-tn {
    color: #10b981;
    background: #f0fdf4;
    border-left: 3px solid #10b981;
  }

  .mi-gap-tn {
    color: #f59e0b;
    background: #fffbeb;
    border-left: 3px solid #f59e0b;
  }

  .side-summary-tn {
    background: #1e293b;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
  }

  .filter-popover-tn {
    position: fixed;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    min-width: 200px;
    padding: 12px;
    display: none;
  }

  .filter-popover-tn.active {
    display: block;
  }

  #loader-tn {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    color: #4338ca;
  }


  /* TN RIÊNG MODULE STYLES */
  .date-cell {
    height: 60px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    border-radius: 0px !important;
    transition: all 0.1s ease;
    border: 0.5px solid #f1f5f9;
    cursor: pointer;
    padding: 4px;
    box-sizing: border-box;
  }

  .date-cell:hover {
    background: linear-gradient(135deg, #c5e3ff 0%, #93c5fd 100%);
    z-index: 5;
    border-color: #497ce1;
    transform: scale(1.02);
    box-shadow: 0 4px 6px -1px rgba(73, 124, 225, 0.3);
  }

  .date-cell.active {
    background: linear-gradient(135deg, #447adf 0%, #3b82f6 100%) !important;
    z-index: 10;
    box-shadow: 0 4px 12px -2px rgba(68, 122, 223, 0.5);
    transform: scale(1.03);
    color: white !important;
  }

  .date-cell.weekend {
    background-color: #f8fafc !important;
  }

  .date-cell.weekend .day-num {
    color: #f43f5e;
    opacity: 0.6;
  }

  .date-cell.active .day-num {
    color: white !important;
    opacity: 1 !important;
  }

  .date-cell .day-num {
    position: absolute;
    top: 4px;
    left: 6px;
    font-size: 10px;
    font-weight: 800;
    opacity: 0.4;
  }

  .cal-line {
    font-size: 10px;
    font-weight: 700;
    display: flex;
    gap: 3px;
    align-items: center;
    margin-bottom: 1px;
    width: 100%;
  }

  .label-mini-tn {
    font-size: 11px;
    font-weight: 900;
    color: #94a3b8;
    width: 14px;
  }

  .date-cell.active .label-mini-tn {
    color: rgba(255, 255, 255, 0.7) !important;
  }

  .matrix-input-tn {
    width: 44px;
    text-align: right;
    font-weight: 800;
    font-size: 13px;
    padding: 2px 4px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    outline: none;
    transition: all 0.2s;
  }

  .matrix-input-tn:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  }

  .mi-goc-tn {
    color: #10b981;
    background: #f0fdf4;
    border-left: 3px solid #10b981;
  }

  .mi-gap-tn {
    color: #f59e0b;
    background: #fffbeb;
    border-left: 3px solid #f59e0b;
  }

  .side-summary-tn {
    background: #1e293b;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
  }

  .filter-popover-tn {
    position: fixed;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    min-width: 200px;
    padding: 12px;
    display: none;
  }

  .filter-popover-tn.active {
    display: block;
  }

  #loader-tn {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    color: #4338ca;
  }

  /* Matrix Pro Polish */
  @keyframes neon-pulse {
    0% {
      filter: drop-shadow(0 0 1px rgba(16, 185, 129, 0.4));
    }

    50% {
      filter: drop-shadow(0 0 5px rgba(16, 185, 129, 0.8));
    }

    100% {
      filter: drop-shadow(0 0 1px rgba(16, 185, 129, 0.4));
    }
  }

  .neon-text-goc {
    animation: neon-pulse 2s infinite ease-in-out;
    color: #10b981;
  }

  .neon-text-gap {
    filter: drop-shadow(0 0 3px rgba(245, 158, 11, 0.3));
    color: #f59e0b;
  }

  .matrix-pro-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-bottom: 2px solid #3b82f6;
  }

  .type-toggle-btn.active {
    background: white !important;
    color: #4338ca !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
  }
  .announce-body { padding: 32px 24px; color: #475569; line-height: 1.6; max-height: 60vh; overflow-y: auto; }
  .announce-footer { padding: 16px 24px; border-top: 1px solid #f1f5f9; background: #f8fafc; text-align: center; }



  /* Multi-select filter styles */
  .multi-select-wrapper { position: relative; min-width: 140px; }
  
  .badge-multi-selected {
    background-color: #eef2ff !important;
    color: #4f46e5 !important;
    border-color: #c7d2fe !important;
    font-weight: 900 !important;
  }
  .badge-multi-student-selected {
    background-color: #fdf2f8 !important;
    color: #db2777 !important;
    border-color: #fbcfe8 !important;
    font-weight: 900 !important;
  }
  .badge-multi-empty {
    color: #cbd5e1 !important;
    border-style: dashed !important;
    border-color: #cbd5e1 !important;
    background-color: transparent !important;
    font-weight: 500 !important;
  }
  .multi-select-btn { 
    width: 100%; background: #f1f5f9; border: 1px solid transparent; 
    border-radius: 6px; padding: 4px 10px; font-size: 11px; font-weight: 800; 
    text-align: left; cursor: pointer; display: flex; justify-content: space-between; align-items: center;
    transition: all 0.2s; height: 28px; color: #1e293b;
  }
  .multi-select-btn:hover { background: #e2e8f0; border-color: #cbd5e1; }
  .multi-select-content {
    position: fixed; min-width: 180px; margin-top: 4px;
    background: white; border: 1px solid #e2e8f0; border-radius: 8px;
    box-shadow: 0 12px 30px -5px rgba(0,0,0,0.15); z-index: 9999;
    max-height: 300px; overflow-y: auto; display: none; padding: 4px;
    flex-direction: column; gap: 1px;
  }
  .multi-select-content.open { display: flex; }
  .multi-select-item {
    display: flex; align-items: center; gap: 8px; padding: 7px 12px;
    border-radius: 6px; cursor: pointer; font-size: 11px; font-weight: 600;
    color: #475569; transition: all 0.15s;
  }
  .multi-select-item:hover { background: #f1f5f9; color: #1e293b; }
  .multi-select-item.selected { background: #eff6ff; color: #2563eb; }
  .multi-select-item input { width: 14px; height: 14px; accent-color: #2563eb; cursor: pointer; }
  .multi-select-badge { background: #3b82f6; color: white; padding: 0px 5px; border-radius: 4px; font-size: 9px; margin-left: 4px; }

  /* COI History Popover */
  .coi-history-popover {
    position: fixed; z-index: 1000; background: white;
    width: 320px; max-height: 400px; border-radius: 8px;
    border: 1px solid #e2e8f0; box-shadow: 0 20px 50px -12px rgba(0,0,0,0.25);
    display: flex; flex-direction: column; overflow: hidden;
    animation: popoverEnter 0.2s ease-out;
  }
  @keyframes popoverEnter { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
  .coi-history-body { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
  .history-item { padding-left: 0; position: relative; }
  .history-item.past { border-left: 2px solid #f1f5f9; padding-left: 10px; }
  .history-item.past:before {
    content: ""; position: absolute; left: -5px; top: 0; width: 8px; height: 8px;
    background: #e2e8f0; border-radius: 50%; border: 2px solid white;
  }
  .history-month { font-size: 10px; font-weight: 900; color: #94a3b8; margin-bottom: 2px; display: block; text-transform: uppercase; }
  .history-content { font-size: 11px; color: #475569; line-height: 1.4; white-space: pre-wrap; word-break: break-word; }
  .stext-cell { cursor: pointer; transition: background 0.1s; position: relative; }
  .stext-cell:hover { background: #f1f5f9 !important; }
  
  .coi-history-textarea {
    width: 100%; padding: 6px 8px; border: 1px solid #e2e8f0; border-radius: 6px;
    background: #ffffff; font-size: 11px; font-weight: 500; color: #1e293b;
    outline: none; transition: border-color 0.2s; min-height: 120px; resize: none;
  }
  .coi-history-textarea:focus { border-color: #6366f1; }

  /* SHARED STUDENT LIST TABLE STYLES */
  .student-list-row {
    transition: background-color 0.2s;
  }
  .student-list-row:hover {
    background-color: #f8fafc;
  }
  .student-list-cell {
    padding: 8px 12px;
    font-size: 10px;
    line-height: 1.4;
  }
  .student-list-code {
    font-weight: 900;
    color: #e11d48;
    letter-spacing: 0.02em;
  }
  .student-list-name {
    font-weight: 600;
    color: #1e293b;
  }
  .student-list-action {
    font-weight: 600;
    color: #475569;
  }
  .student-list-date {
    font-weight: 500;
    color: #64748b;
  }
  .student-list-creator {
    font-weight: 500;
    color: #64748b;
    font-size: 9px;
  }

  /* ===== SHARED DYNAMIC COLUMN WIDTH ===== */
  [style*="--w:"] {
    width: var(--w); min-width: var(--w); max-width: var(--w);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  th[style*="--w:"] { overflow: visible; }

  #student-table-el,
  #fluctuation-table-el {
    width: 100%;
    min-width: 100%;
  }
  #student-table-el [style*="--w:"],
  #fluctuation-table-el [style*="--w:"] {
    width: auto;
    min-width: var(--w);
    max-width: none;
  }

  /* ===== SHARED REPORT TABLE CLASSES ===== */
  .rpt-header-th {
    padding: 0.5rem 0.25rem !important;
    white-space: normal !important;
    line-height: 1.2 !important;
    vertical-align: middle !important;
  }
  .rpt-header-cell {
    padding: 0.5rem 0.25rem;
    text-align: center;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #fff;
    white-space: nowrap;
  }
  .rpt-cell {
    padding: 0.5rem 0.25rem;
    text-align: center;
    border-right: 1px solid #f1f5f9;
    font-size: 11px;
  }
  .rpt-cell.clickable { cursor: pointer; }
  .rpt-cell.clickable:hover { background-color: #fff1f2; }

  .rpt-badge-emerald { color: #059669; }
  .rpt-badge-rose    { color: #e11d48; }
  .rpt-badge-slate   { color: #475569; }
  .rpt-badge-indigo  { color: #4338ca; font-weight: 900; }

  .rpt-cell-bg-emerald-50\/20 { background-color: rgba(209, 250, 229, 0.2); }
  .rpt-cell-bg-rose-50\/20    { background-color: rgba(255, 228, 230, 0.2); }
  .rpt-cell-bg-indigo-50\/20  { background-color: rgba(199, 213, 251, 0.2); }
  .rpt-cell-bg-indigo-100\/20 { background-color: rgba(224, 231, 255, 0.2); }

  .rpt-row-l0 { background-color: #fcf5f8 !important; color: #880e4f !important; font-weight: 900; }
  .rpt-row-l1 { background-color: #f8fafc !important; color: #1e293b !important; font-weight: 700; }
  .rpt-row-l2 { background-color: #ffffff !important; color: #475569 !important; font-weight: 600; }
  .rpt-row-l3 { background-color: #ffffff !important; color: #64748b; }

  .rpt-row-l0 td.sticky-col { background-color: #fcf5f8 !important; }
  .rpt-row-l1 td.sticky-col { background-color: #f8fafc !important; }
  .rpt-row-l2 td.sticky-col { background-color: #ffffff !important; }
  .rpt-row-l3 td.sticky-col { background-color: #ffffff !important; }
  .rpt-row-l0 td.sticky-col:hover { background-color: #fdf2f8 !important; }

  .btn-primary {
    background-color: #e11d48; color: #fff; font-weight: 800; font-size: 12px;
    padding: 0.5rem 1rem; border-radius: 0.5rem; border: 0; cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s;
  }
  .btn-primary:hover { background-color: #be123c; }
  .btn-primary:active { transform: translateY(1px); }
  .btn-secondary {
    background-color: #fff; color: #334155; border: 1px solid #e2e8f0; font-weight: 700;
    padding: 0.5rem 1rem; border-radius: 0.5rem; cursor: pointer; transition: all 0.2s;
  }
  .btn-secondary:hover { background-color: #f8fafc; }
  .btn-sm { padding: 0.25rem 0.5rem; font-size: 11px; border-radius: 6px; }
  .btn-danger { background-color: #fff1f2; color: #e11d48; border: 1px solid #fecdd3; }
  .btn-danger:hover { background-color: #ffe4e6; }
  .btn-ghost { background: transparent; color: #475569; border: 1px solid transparent; }
  .btn-ghost:hover { background: #f1f5f9; color: #0f172a; }

  .badge {
    display: inline-block; font-size: 10px; font-weight: 800; padding: 0.125rem 0.375rem;
    border-radius: 6px; white-space: nowrap; line-height: 1;
  }
  .badge-new    { background: #dcfce7; color: #166534; }
  .badge-stop   { background: #ffe4e6; color: #9f1239; }
  .badge-end    { background: #e0e7ff; color: #3730a3; }
  .badge-neutral{ background: #f1f5f9; color: #475569; }
  .animate-scale-up { animation: scaleUp .2s ease-out; }
  @keyframes scaleUp { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: scale(1); } }


