    :root {
      --primary: #DC2626;
      --primary-dark: #B91C1C;
      --primary-subtle: #FEF2F2;
      --primary-border: #FECACA;
      --accent: #991B1B;
      --accent-subtle: #FEF2F2;
      --bg: #F8FAFC;
      --surface: #FFFFFF;
      --surface-secondary: #F1F5F9;
      --text: #0F172A;
      --text-muted: #64748B;
      --text-subtle: #94A3B8;
      --border: #E2E8F0;
      --border-subtle: #F1F5F9;
      --row-hover: #F8FAFC;
      --row-selected: #FEF2F2;
      --radius: 6px;
    }

    * { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
    body { background-color: var(--bg); color: var(--text); height: 100vh; overflow: hidden; font-size: 13px; }

    /* APP LAYOUT: MODERN COLLAPSIBLE SIDEBAR & TOP HEADER (BASE.VN / HAPPYTIME) */
    .app-layout {
      display: flex;
      width: 100vw;
      height: 100vh;
      overflow: hidden;
      background: var(--bg);
    }

    /* COLLAPSIBLE SIDEBAR */
    .app-sidebar {
      width: 250px;
      min-width: 250px;
      background: #FFFFFF;
      border-right: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      flex-shrink: 0;
      transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.22s cubic-bezier(0.4, 0, 0.2, 1);
      z-index: 100;
      position: relative;
    }
    .app-sidebar.collapsed {
      width: 68px;
      min-width: 68px;
    }

    /* SIDEBAR HEADER / BRAND */
    .sidebar-header {
      height: 60px;
      padding: 0 16px;
      display: flex;
      align-items: center;
      border-bottom: 1px solid var(--border);
      flex-shrink: 0;
      overflow: hidden;
    }
    .sidebar-brand {
      display: flex;
      align-items: center;
      gap: 12px;
      text-decoration: none;
      color: inherit;
      width: 100%;
    }
    .sidebar-logo {
      height: 38px;
      max-width: 110px;
      width: auto;
      object-fit: contain;
      flex-shrink: 0;
      transition: all 0.2s ease;
    }
    .app-sidebar.collapsed .sidebar-logo {
      height: 32px;
      max-width: 38px;
      margin: 0 auto;
    }
    .sidebar-brand-text {
      display: flex;
      flex-direction: column;
      white-space: nowrap;
      overflow: hidden;
      transition: opacity 0.15s ease;
    }
    .sidebar-title {
      font-size: 15px;
      font-weight: 800;
      color: var(--text);
      letter-spacing: 0.3px;
      line-height: 1.2;
    }
    .sidebar-subtitle {
      font-size: 11px;
      color: var(--primary);
      font-weight: 700;
      letter-spacing: 0.4px;
      text-transform: uppercase;
      margin-top: 2px;
    }
    .app-sidebar.collapsed .sidebar-brand-text {
      display: none;
    }

    /* SIDEBAR MENU */
    .sidebar-menu {
      flex: 1;
      overflow-y: auto;
      overflow-x: hidden;
      padding: 12px 8px;
      display: flex;
      flex-direction: column;
      gap: 3px;
    }
    .sidebar-menu::-webkit-scrollbar {
      width: 4px;
    }
    .sidebar-menu::-webkit-scrollbar-thumb {
      background: #E2E8F0;
      border-radius: 4px;
    }

    /* GROUP HEADERS */
    .sidebar-group-header {
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      color: #64748B;
      letter-spacing: 0.6px;
      padding: 14px 10px 5px 10px;
      margin-top: 4px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      flex-shrink: 0;
      min-height: 28px;
      line-height: 1.4;
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .app-sidebar.collapsed .sidebar-group-header {
      height: 1px;
      background: var(--border);
      padding: 0;
      margin: 10px 8px;
      text-indent: -9999px;
    }

    /* SIDEBAR BUTTON ITEMS */
    .sidebar-item {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 8px 12px;
      border-radius: 6px;
      border: 1px solid transparent;
      background: transparent;
      color: #334155;
      font-size: 12.5px;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.15s ease;
      text-align: left;
      white-space: nowrap;
      position: relative;
      width: 100%;
    }
    .sidebar-item:hover {
      background: var(--surface-secondary);
      color: var(--text);
    }
    .sidebar-item.active {
      background: var(--primary-subtle);
      color: var(--primary);
      font-weight: 700;
      border-color: var(--primary-border);
    }
    .sidebar-item-icon {
      font-size: 16px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 20px;
      flex-shrink: 0;
    }
    .sidebar-item-text {
      flex: 1;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .app-sidebar.collapsed .sidebar-item {
      justify-content: center;
      padding: 10px 0;
    }
    .app-sidebar.collapsed .sidebar-item-text {
      display: none;
    }

    /* TOOLTIP IN COLLAPSED MODE */
    .app-sidebar.collapsed .sidebar-item::after {
      content: attr(data-tooltip);
      position: absolute;
      left: 72px;
      top: 50%;
      transform: translateY(-50%) translateX(-6px);
      background: #0F172A;
      color: #FFFFFF;
      padding: 5px 10px;
      border-radius: 6px;
      font-size: 12px;
      font-weight: 500;
      white-space: nowrap;
      pointer-events: none;
      opacity: 0;
      transition: opacity 0.15s ease, transform 0.15s ease;
      z-index: 1000;
      box-shadow: 0 4px 12px rgba(0,0,0,0.18);
    }
    .app-sidebar.collapsed .sidebar-item:hover::after {
      opacity: 1;
      transform: translateY(-50%) translateX(0);
    }

    /* SIDEBAR FOOTER & TOGGLE */
    .sidebar-footer {
      padding: 8px;
      border-top: 1px solid var(--border);
      flex-shrink: 0;
    }
    .sidebar-toggle-btn {
      width: 100%;
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 8px 12px;
      border-radius: 6px;
      border: 1px solid var(--border);
      background: #FFFFFF;
      color: var(--text-muted);
      font-size: 12px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.15s ease;
    }
    .sidebar-toggle-btn:hover {
      background: var(--surface-secondary);
      color: var(--text);
      border-color: #CBD5E1;
    }
    .sidebar-toggle-btn .toggle-icon {
      font-size: 13px;
      font-weight: 700;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 20px;
      flex-shrink: 0;
      color: var(--primary);
    }
    .app-sidebar.collapsed .sidebar-toggle-btn {
      justify-content: center;
      padding: 8px 0;
    }
    .app-sidebar.collapsed .sidebar-toggle-btn .toggle-text {
      display: none;
    }

    /* MAIN CONTAINER & TOP HEADER (52px) */
    .app-main {
      flex: 1;
      display: flex;
      flex-direction: column;
      height: 100vh;
      min-width: 0;
      overflow: hidden;
      background: var(--bg);
    }
    .top-header {
      height: 52px;
      background: #FFFFFF;
      border-bottom: 1px solid var(--border);
      padding: 0 18px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-shrink: 0;
      z-index: 40;
    }
    .header-left {
      display: flex;
      align-items: center;
      gap: 12px;
      min-width: 0;
    }
    .header-toggle-btn {
      background: none;
      border: 1px solid var(--border);
      border-radius: 6px;
      padding: 6px 8px;
      cursor: pointer;
      color: var(--text-muted);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      transition: all 0.15s;
    }
    .header-toggle-btn:hover {
      background: var(--surface-secondary);
      color: var(--primary);
      border-color: var(--primary);
    }

    /* BREADCRUMB */
    .breadcrumb {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 12.5px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .bc-root {
      font-weight: 700;
      color: var(--primary);
      letter-spacing: 0.3px;
    }
    .bc-sep {
      color: #94A3B8;
      font-size: 11px;
    }
    .bc-group {
      color: var(--text-muted);
      font-weight: 500;
    }
    .bc-item.active {
      color: var(--text);
      font-weight: 700;
    }

    .header-right {
      display: flex;
      align-items: center;
      gap: 12px;
      flex-shrink: 0;
    }
    .realtime-clock {
      font-size: 12px;
      font-weight: 600;
      color: #475569;
      background: #F1F5F9;
      padding: 5px 10px;
      border-radius: 6px;
      border: 1px solid #E2E8F0;
      font-variant-numeric: tabular-nums;
    }
    .user-chip {
      display: flex;
      align-items: center;
      gap: 8px;
      background: #FEF2F2;
      border: 1px solid #FECACA;
      padding: 4px 10px;
      border-radius: 20px;
      font-size: 12px;
      font-weight: 600;
      color: var(--primary);
    }
    .user-avatar-badge {
      width: 22px;
      height: 22px;
      border-radius: 50%;
      background: var(--primary);
      color: #FFFFFF;
      font-size: 10px;
      font-weight: 800;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }

    /* 4. LEVEL 4: WORKSPACE LAYOUT */
    .workspace {
      flex: 1;
      height: calc(100vh - 52px);
      display: flex;
      flex-direction: column;
      padding: 12px 18px;
      gap: 10px;
      overflow: hidden;
      background-color: var(--bg);
    }

    /* EMPTY STATE STYLES */
    .empty-state-container {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 48px 20px;
      text-align: center;
      background: #FFFFFF;
      border-radius: var(--radius);
      min-height: 260px;
    }
    .empty-state-icon {
      width: 44px;
      height: 44px;
      border-radius: 50%;
      background: #F1F5F9;
      color: #64748B;
      display: flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 12px;
    }
    .empty-state-title {
      font-size: 14px;
      font-weight: 600;
      color: var(--text);
      margin-bottom: 4px;
    }
    .empty-state-desc {
      font-size: 12px;
      color: var(--text-muted);
      max-width: 420px;
      line-height: 1.5;
      margin-bottom: 16px;
    }

    /* 4. PAGE CONTEXT HEADER & METRICS */
    .page-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-shrink: 0;
      padding-bottom: 2px;
    }
    .page-title-group { display: flex; flex-direction: column; gap: 2px; }
    .page-title { font-size: 16px; font-weight: 700; color: var(--text); letter-spacing: -0.2px; line-height: 1.2; }
    .page-subtitle { font-size: 12px; color: var(--text-muted); }
    .page-metrics-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
    .metric-chip {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      background: var(--surface);
      border: 1px solid var(--border);
      padding: 4px 10px;
      border-radius: 5px;
      font-size: 11px;
      color: var(--text-muted);
    }
    .metric-chip strong { color: var(--text); font-weight: 600; }
    .metric-dot { width: 6px; height: 6px; border-radius: 50%; }
    .dot-green { background: #16A34A; }
    .dot-amber { background: #D97706; }
    .dot-red { background: #DC2626; }
    .dot-neutral { background: #94A3B8; }

    /* 5. MODERN OPERATIONAL FILTER TOOLBAR */
    .toolbar {
      background: #FFFFFF;
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 7px 12px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      flex-wrap: wrap; /* Cho phép tự động xuống hàng an toàn khi màn hình thu nhỏ hoặc mở drawer */
      flex-shrink: 0;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    }
    .toolbar-filters {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
      min-width: 0;
      flex: 1;
    }
    .toolbar-actions {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
      flex-shrink: 0;
    }

    /* MODERN SEARCH INPUT WITH SHORTCUT HINT */
    .search-wrapper {
      position: relative;
      display: inline-flex;
      align-items: center;
    }
    .search-icon {
      position: absolute;
      left: 10px;
      color: #64748B;
      pointer-events: none;
      display: flex;
      align-items: center;
      z-index: 2;
    }
    .input-search {
      height: 34px;
      width: 290px;
      padding: 0 44px 0 32px;
      font-size: 12.5px;
      font-weight: 400;
      border: 1px solid #CBD5E1;
      border-radius: 6px;
      outline: none;
      background: #F8FAFC;
      color: var(--text);
      transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .input-search::placeholder {
      color: #94A3B8;
      font-weight: 400;
    }
    .input-search:hover {
      background: #FFFFFF;
      border-color: #94A3B8;
    }
    .input-search:focus {
      width: 340px;
      background: #FFFFFF;
      border-color: var(--primary);
      box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
    }
    .search-shortcut-hint {
      position: absolute;
      right: 8px;
      display: inline-flex;
      align-items: center;
      gap: 2px;
      pointer-events: none;
      font-size: 10.5px;
      color: #94A3B8;
      background: #FFFFFF;
      border: 1px solid #E2E8F0;
      padding: 1px 5px;
      border-radius: 4px;
      font-weight: 600;
      user-select: none;
      transition: opacity 0.15s;
    }
    .input-search:focus ~ .search-shortcut-hint {
      opacity: 0;
    }

    /* FILTER DIVIDER */
    .filter-divider {
      width: 1px;
      height: 20px;
      background: #E2E8F0;
      margin: 0 2px;
      flex-shrink: 0;
    }

    /* MODERN CUSTOM SELECT WITH LEADING & TRAILING ICONS */
    .select-wrapper {
      position: relative;
      display: inline-flex;
      align-items: center;
    }
    .select-icon-lead {
      position: absolute;
      left: 9px;
      color: #64748B;
      pointer-events: none;
      display: flex;
      align-items: center;
      z-index: 2;
    }
    .select-icon-arrow {
      position: absolute;
      right: 9px;
      color: #64748B;
      pointer-events: none;
      display: flex;
      align-items: center;
      z-index: 2;
    }
    .select-sm {
      height: 34px;
      padding: 0 26px 0 28px;
      font-size: 12px;
      font-weight: 500;
      border: 1px solid #CBD5E1;
      border-radius: 6px;
      outline: none;
      background: #FFFFFF;
      color: #334155;
      cursor: pointer;
      appearance: none;
      -webkit-appearance: none;
      -moz-appearance: none;
      transition: all 0.15s ease;
      white-space: nowrap;
    }
    .select-sm:hover {
      background: #F8FAFC;
      border-color: #94A3B8;
    }
    .select-sm:focus {
      border-color: var(--primary);
      box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
    }
    .select-sm.is-filtered {
      border-color: var(--primary);
      background: var(--primary-subtle);
      color: #991B1B;
      font-weight: 600;
    }

    /* RESET FILTER BUTTON */
    .btn-reset-filters {
      height: 34px;
      padding: 0 10px;
      font-size: 11.5px;
      font-weight: 500;
      border-radius: 6px;
      border: 1px solid #E2E8F0;
      background: #F1F5F9;
      color: #475569;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 5px;
      transition: all 0.15s ease;
      white-space: nowrap;
    }
    .btn-reset-filters:hover {
      background: #E2E8F0;
      color: #0F172A;
      border-color: #CBD5E1;
    }

    /* ENTERPRISE ACTION BUTTONS */
    .btn-sm {
      height: 34px;
      padding: 0 13px;
      font-size: 12.5px;
      font-weight: 600;
      border-radius: 6px;
      border: 1px solid transparent;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      transition: all 0.15s ease;
      white-space: nowrap;
    }
    .btn-primary {
      background: var(--primary);
      color: #FFFFFF;
      box-shadow: 0 1px 2px rgba(220, 38, 38, 0.2);
    }
    .btn-primary:hover {
      background: var(--primary-dark);
      box-shadow: 0 2px 4px rgba(220, 38, 38, 0.28);
    }
    .btn-default {
      background: #FFFFFF;
      border: 1px solid #CBD5E1;
      color: #334155;
    }
    .btn-default:hover {
      background: #F8FAFC;
      border-color: #94A3B8;
      color: #0F172A;
    }
    .btn-icon-subtle {
      width: 28px;
      height: 28px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: 4px;
      border: 1px solid var(--border);
      background: var(--surface);
      color: var(--text-muted);
      cursor: pointer;
      transition: all 0.15s;
    }
    .btn-icon-subtle:hover { color: var(--text); background: var(--surface-secondary); }
    .btn-accent { background: var(--accent); color: #FFFFFF; }
    .btn-accent:hover { background: #B9050F; }

    /* 6. MASTER-DETAIL CONTAINER */
    .split-container {
      flex-grow: 1;
      display: flex;
      gap: 12px;
      min-height: 0;
      overflow: hidden;
    }

    /* 7. MODERN DATA GRID (BORDER-LIGHT & HORIZONTAL ONLY) */
    .grid-container {
      flex: 1;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      display: flex;
      flex-direction: column;
      overflow: hidden;
      min-width: 0;
      transition: all 0.2s ease;
    }
    .grid-scroll, .table-container { flex: 1; overflow-x: auto; max-width: 100%; }
    table.data-grid { width: 100%; border-collapse: collapse; font-size: 12px; text-align: left; }
    table.data-grid th {
      position: sticky;
      top: 0;
      background: #F8FAFC;
      color: #475569;
      font-weight: 600;
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: 0.3px;
      padding: 9px 12px;
      border-bottom: 1px solid var(--border);
      border-right: none !important;
      white-space: nowrap;
      z-index: 10;
    }
    table.data-grid th:last-child {
      position: sticky;
      right: 0;
      background: #F8FAFC;
      z-index: 12;
      box-shadow: -2px 0 6px rgba(0, 0, 0, 0.05);
    }
    table.data-grid td {
      padding: 8px 12px;
      border-bottom: 1px solid var(--border-subtle);
      border-right: none !important;
      white-space: nowrap;
      height: 38px;
      color: #1E293B;
    }
    table.data-grid td:last-child {
      position: sticky;
      right: 0;
      background: #FFFFFF;
      z-index: 5;
      box-shadow: -2px 0 6px rgba(0, 0, 0, 0.05);
    }
    table.data-grid tr:hover td { background-color: var(--row-hover); }
    table.data-grid tr:hover td:last-child { background-color: var(--row-hover); }
    table.data-grid tr.selected td {
      background-color: var(--primary-subtle) !important;
      border-bottom-color: var(--primary-border);
    }
    table.data-grid tr.selected td:last-child {
      background-color: var(--primary-subtle) !important;
    }
    table.data-grid tr.selected td:first-child {
      border-left: 3px solid var(--primary);
    }
    table.data-grid tr { cursor: pointer; user-select: none; }

    /* 8. CONTEXTUAL DETAIL DRAWER (OFF-SCREEN BY DEFAULT) */
    .split-pane {
      display: flex;
      flex: 1;
      gap: 12px;
      min-height: 0;
      overflow: hidden;
    }
    .split-pane .grid-card {
      flex: 1;
      min-width: 0;
      display: flex;
      flex-direction: column;
    }
    .detail-drawer {
      width: 480px;
      max-width: 100%; /* Chống tràn khung */
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      display: none; /* Mặc định ẩn, chỉ mở khi chọn record */
      flex-direction: column;
      flex-shrink: 0;
      overflow: hidden;
      box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
      animation: slideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .detail-drawer.open {
      display: flex !important;
    }
    @keyframes slideIn {
      from { transform: translateX(20px); opacity: 0; }
      to { transform: translateX(0); opacity: 1; }
    }

    /* STANDARDIZED DRAWER HEADER */
    .drawer-header {
      background: #FFFFFF;
      border-bottom: 1px solid var(--border);
      padding: 12px 16px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      flex-shrink: 0;
    }
    .drawer-title-group {
      display: flex;
      align-items: center;
      gap: 10px;
      min-width: 0;
      flex: 1;
    }
    .drawer-title {
      font-size: 14px;
      font-weight: 700;
      color: var(--text);
      line-height: 1.25;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .drawer-subtitle {
      font-size: 11px;
      color: var(--text-muted);
      margin-top: 2px;
      display: flex;
      align-items: center;
      gap: 6px;
      flex-wrap: wrap;
    }
    .drawer-close-btn {
      width: 28px;
      height: 28px;
      border-radius: 6px;
      border: 1px solid transparent;
      background: transparent;
      color: #64748B;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      padding: 0;
      transition: all 0.15s ease;
      flex-shrink: 0;
    }
    .drawer-close-btn:hover {
      background: #F1F5F9;
      color: var(--text);
      border-color: #E2E8F0;
    }

    .drawer-entity-header {
      background: var(--surface);
      border-bottom: 1px solid var(--border);
      padding: 14px 16px;
      display: flex;
      align-items: center;
      gap: 12px;
      flex-shrink: 0;
    }
    .entity-avatar {
      width: 38px;
      height: 38px;
      border-radius: 50%;
      background: var(--primary-subtle);
      color: var(--primary);
      border: 1px solid var(--primary-border);
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 700;
      font-size: 13px;
      flex-shrink: 0;
    }
    .entity-info { flex: 1; min-width: 0; }
    .entity-name { font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.2; }
    .entity-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

    .drawer-subnav {
      background: var(--surface);
      border-bottom: 1px solid var(--border);
      display: flex;
      padding: 0 12px;
      gap: 2px;
      flex-shrink: 0;
    }
    .drawer-tab-btn {
      padding: 8px 10px;
      border: none;
      background: none;
      font-size: 11px;
      font-weight: 600;
      color: var(--text-muted);
      cursor: pointer;
      border-bottom: 2px solid transparent;
      display: inline-flex;
      align-items: center;
      gap: 4px;
    }
    .drawer-tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
    .drawer-body { flex: 1; overflow-y: auto; padding: 16px 18px; }

    .drawer-sticky-footer {
      background: #FFFFFF;
      border-top: 1px solid var(--border);
      padding: 12px 18px;
      display: flex;
      justify-content: flex-end;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap; /* Cho phép các nút hành động tự động gói hàng không nhảy khỏi panel */
      flex-shrink: 0;
      box-shadow: 0 -2px 6px rgba(0,0,0,0.03);
    }

    /* PROBATION BM04 ENTERPRISE DETAIL STYLES */
    .prob-hero-card {
      background: linear-gradient(135deg, #F8FAFC 0%, #FFFFFF 100%);
      border: 1px solid #E2E8F0;
      border-radius: 8px;
      padding: 14px 16px;
      margin-bottom: 16px;
      box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    }
    .prob-score-row {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      margin-bottom: 8px;
    }
    .prob-score-big {
      font-size: 28px;
      font-weight: 800;
      letter-spacing: -0.5px;
      line-height: 1;
    }
    .prob-score-max {
      font-size: 13px;
      font-weight: 500;
      color: #64748B;
      margin-left: 2px;
    }
    .prob-progress-bar {
      width: 100%;
      height: 6px;
      background: #E2E8F0;
      border-radius: 3px;
      overflow: hidden;
      margin-top: 8px;
    }
    .prob-progress-val {
      height: 100%;
      border-radius: 3px;
      transition: width 0.3s ease;
    }

    .prob-section-title {
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      color: #64748B;
      margin: 16px 0 8px 0;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .criteria-card {
      background: #FFFFFF;
      border: 1px solid var(--border);
      border-radius: 6px;
      padding: 10px 12px;
      margin-bottom: 8px;
      display: flex;
      flex-direction: column;
      gap: 6px;
    }
    .criteria-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    .criteria-name {
      font-size: 12px;
      font-weight: 600;
      color: #1E293B;
    }
    .criteria-score-badge {
      font-size: 12px;
      font-weight: 700;
      padding: 1px 7px;
      border-radius: 4px;
      background: #F1F5F9;
      color: #334155;
    }
    .criteria-desc {
      font-size: 11px;
      color: #64748B;
    }

    .feedback-box {
      border-radius: 6px;
      padding: 10px 12px;
      font-size: 12px;
      line-height: 1.5;
      margin-bottom: 10px;
    }
    .feedback-box-success {
      background: #F0FDF4;
      border: 1px solid #DCFCE7;
      color: #166534;
    }
    .feedback-box-warning {
      background: #FFFBEB;
      border: 1px solid #FEF3C7;
      color: #92400E;
    }

    .prob-proposal-box {
      background: #FFFFFF;
      border: 1px solid #CBD5E1;
      border-left: 4px solid var(--primary);
      border-radius: 6px;
      padding: 12px 14px;
      margin-bottom: 12px;
    }
    .prob-proposal-title {
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      color: var(--primary);
      margin-bottom: 4px;
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .prob-proposal-val {
      font-size: 13.5px;
      font-weight: 700;
      color: #0F172A;
    }
    .prob-meta-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 6px 12px;
      font-size: 11px;
      color: #64748B;
      margin-top: 10px;
      padding-top: 8px;
      border-top: 1px dashed #E2E8F0;
    }
    .prob-meta-grid strong {
      color: #334155;
    }

    /* 9. REFINED SEMANTIC BADGES */
    .badge { padding: 2px 7px; border-radius: 4px; font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
    .badge-success { background: #DCFCE7; color: #166534; border: 1px solid #BBF7D0; }
    .badge-warning { background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; }
    .badge-danger { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
    .badge-neutral { background: #F1F5F9; color: #475569; border: 1px solid #E2E8F0; }
    .badge-purple { background: #F3E8FF; color: #6B21A8; border: 1px solid #E9D5FF; }

    /* 10. MINI PROGRESS BAR */
    .mini-progress-bg { width: 56px; height: 5px; background: #E2E8F0; border-radius: 3px; overflow: hidden; display: inline-block; vertical-align: middle; margin-right: 6px; }
    .mini-progress-fill { height: 100%; background: var(--primary); }

    /* 11. MODAL */
    .modal-overlay {
      position: fixed; top: 0; left: 0; right: 0; bottom: 0;
      background: rgba(15, 23, 42, 0.45);
      z-index: 1000;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 20px;
      backdrop-filter: blur(2px);
    }
    .modal-content {
      background: #FFFFFF;
      border-radius: var(--radius);
      width: 100%;
      max-width: 680px;
      max-height: 85vh;
      overflow-y: auto;
      border: 1px solid var(--border);
      box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
    }
    .modal-header { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; background: #F8FAFC; }
    .modal-body { padding: 16px; }

    /* FORM ELEMENTS IN DRAWER & MODAL */
    .dense-form-group { margin-bottom: 10px; }
    .dense-label { font-size: 11px; font-weight: 600; color: #334155; margin-bottom: 3px; display: block; }
    .dense-input { width: 100%; height: auto; min-height: 28px; box-sizing: border-box; line-height: 1.4; padding: 0 8px; font-size: 12px; border: 1px solid var(--border); border-radius: 4px; outline: none; background: #FFF; color: var(--text); }
    .dense-input:focus { border-color: var(--primary); }
    .dense-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

    /* CHECKLIST ITEM IN DRAWER */
    .check-row {
      display: flex; align-items: center; justify-content: space-between;
      padding: 7px 8px; border-bottom: 1px solid var(--border-subtle); font-size: 12px;
      transition: background 0.1s;
    }
    .check-row:hover { background: #F8FAFC; }

    .alert-banner {
      padding: 8px 14px; font-size: 12px; border-radius: var(--radius); margin-bottom: 6px; display: none;
    }
    .alert-banner.success { background: #DCFCE7; color: #166534; border: 1px solid #BBF7D0; }
    .alert-banner.error { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }

    /* Toast thông báo (showAlert): cố định trên cùng, cao hơn mọi modal (.modal-overlay = 1000, dropdown = 1050/1100) */
    .toast-host {
      position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
      z-index: 10050; display: flex; flex-direction: column; align-items: center; gap: 8px;
      width: min(560px, calc(100vw - 32px)); pointer-events: none;
    }
    .toast {
      pointer-events: auto; cursor: pointer; width: 100%; box-sizing: border-box;
      display: flex; align-items: flex-start; gap: 10px;
      padding: 10px 14px; font-size: 13px; line-height: 1.45; border-radius: var(--radius); border: 1px solid;
      box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.25), 0 4px 10px -4px rgba(15, 23, 42, 0.15);
      animation: toast-in 0.18s ease-out;
    }
    .toast.success { background: #F0FDF4; color: #166534; border-color: #86EFAC; border-left: 4px solid #16A34A; }
    .toast.error { background: #FEF2F2; color: #991B1B; border-color: #FCA5A5; border-left: 4px solid #DC2626; font-weight: 600; }
    .toast-icon { flex: 0 0 auto; font-weight: 800; }
    .toast-text { flex: 1 1 auto; white-space: pre-line; word-break: break-word; }
    @keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

    /* ========================================================= */
    /* 9. ENTERPRISE DATA GRID PAGINATION TOOLBAR */
    /* ========================================================= */
    .grid-pagination {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 6px 14px;
      height: 42px;
      background: #FFFFFF;
      border-top: 1px solid var(--border);
      flex-shrink: 0;
      font-size: 12px;
      color: #475569;
      user-select: none;
    }
    .pag-info {
      display: flex;
      align-items: center;
      gap: 5px;
      font-size: 12px;
      color: #64748B;
    }
    .pag-info strong {
      color: #0F172A;
      font-weight: 600;
    }
    .pag-actions {
      display: flex;
      align-items: center;
      gap: 12px;
    }
    .pag-size-selector {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 11.5px;
      color: #64748B;
    }
    .pag-size-select {
      height: 28px;
      padding: 0 6px;
      font-size: 11.5px;
      border: 1px solid #CBD5E1;
      border-radius: 4px;
      background: #FFFFFF;
      color: #1E293B;
      cursor: pointer;
      outline: none;
    }
    .pag-size-select:focus {
      border-color: var(--primary);
    }
    .pag-nav-group {
      display: flex;
      align-items: center;
      gap: 4px;
    }
    .btn-pag {
      height: 28px;
      min-width: 28px;
      padding: 0 6px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border: 1px solid #E2E8F0;
      border-radius: 4px;
      background: #FFFFFF;
      color: #334155;
      font-size: 12px;
      cursor: pointer;
      transition: all 0.15s ease;
    }
    .btn-pag:hover:not(:disabled) {
      background: #F1F5F9;
      border-color: #CBD5E1;
      color: #0F172A;
    }
    .btn-pag:disabled {
      opacity: 0.4;
      cursor: not-allowed;
      background: #F8FAFC;
    }
    .pag-indicator {
      font-size: 11.5px;
      padding: 0 6px;
      color: #475569;
      font-weight: 500;
    }

    /* ========================================================= */
    /* 10. ENTERPRISE EXCEL IMPORT / EXPORT MODAL */
    /* ========================================================= */
    .excel-modal-backdrop {
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, 0.45);
      backdrop-filter: blur(2px);
      z-index: 999;
      display: none;
      align-items: center;
      justify-content: center;
    }
    .excel-modal-box {
      width: 620px;
      max-width: 95vw;
      background: #FFFFFF;
      border-radius: 10px;
      box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
      display: flex;
      flex-direction: column;
      overflow: hidden;
      border: 1px solid #E2E8F0;
      animation: modalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }
    @keyframes modalFadeIn {
      from { transform: scale(0.96); opacity: 0; }
      to { transform: scale(1); opacity: 1; }
    }
    .excel-modal-header {
      padding: 14px 20px;
      background: #F8FAFC;
      border-bottom: 1px solid #E2E8F0;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    .excel-modal-title {
      font-size: 15px;
      font-weight: 700;
      color: #0F172A;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .excel-modal-body {
      padding: 20px;
      display: flex;
      flex-direction: column;
      gap: 16px;
      max-height: 78vh;
      overflow-y: auto;
    }
    .excel-step-card {
      border: 1px solid #E2E8F0;
      border-radius: 8px;
      padding: 14px;
      background: #FFFFFF;
      transition: border-color 0.15s;
    }
    .excel-step-card:hover {
      border-color: #CBD5E1;
    }
    .excel-step-header {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 8px;
    }
    .excel-step-num {
      width: 22px;
      height: 22px;
      border-radius: 50%;
      background: var(--primary);
      color: #FFFFFF;
      font-size: 11px;
      font-weight: 700;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }
    .excel-step-title {
      font-size: 13px;
      font-weight: 700;
      color: #0F172A;
    }
    .excel-step-desc {
      font-size: 12px;
      color: #64748B;
      line-height: 1.45;
      margin-bottom: 12px;
    }
    .excel-drop-zone {
      border: 2px dashed #CBD5E1;
      border-radius: 8px;
      padding: 20px;
      text-align: center;
      background: #F8FAFC;
      cursor: pointer;
      transition: all 0.15s ease;
    }
    .excel-drop-zone:hover, .excel-drop-zone.dragover {
      border-color: var(--primary);
      background: #F0FDF4;
    }
    .excel-drop-icon {
      color: var(--primary);
      margin-bottom: 6px;
    }
    .excel-selected-file {
      display: none;
      align-items: center;
      justify-content: space-between;
      padding: 8px 12px;
      background: #F1F5F9;
      border-radius: 6px;
      font-size: 12px;
      font-weight: 500;
      color: #1E293B;
      margin-top: 8px;
    }
    .excel-result-box {
      display: none;
      padding: 10px 14px;
      border-radius: 6px;
      font-size: 12px;
      line-height: 1.5;
    }
    .excel-result-box.success {
      background: #DCFCE7;
      color: #166534;
      border: 1px solid #BBF7D0;
    }
    .excel-result-box.error {
      background: #FEE2E2;
      color: #991B1B;
      border: 1px solid #FECACA;
    }
    .excel-modal-footer {
      padding: 12px 20px;
      background: #F8FAFC;
      border-top: 1px solid #E2E8F0;
      display: flex;
      align-items: center;
      justify-content: flex-end;
    }

    /* ========================================================= */
    /* 10.1. ENTERPRISE EXCEL PREVIEW & VALIDATION MODAL */
    /* ========================================================= */
    .excel-preview-backdrop {
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, 0.6);
      backdrop-filter: blur(3px);
      z-index: 1050;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 20px;
    }
    .excel-preview-box {
      width: 1120px;
      max-width: 96vw;
      max-height: 90vh;
      background: #FFFFFF;
      border-radius: 10px;
      box-shadow: 0 25px 35px -5px rgba(0,0,0,0.15), 0 10px 10px -5px rgba(0,0,0,0.08);
      display: flex;
      flex-direction: column;
      overflow: hidden;
      border: 1px solid #E2E8F0;
      animation: modalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .excel-preview-header {
      padding: 14px 20px;
      background: #F8FAFC;
      border-bottom: 1px solid #E2E8F0;
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-shrink: 0;
    }
    .excel-preview-body {
      padding: 16px 20px;
      display: flex;
      flex-direction: column;
      gap: 12px;
      overflow-y: auto;
      flex: 1;
    }
    .excel-ai-card {
      border: 1px solid #BFDBFE;
      background: #EFF6FF;
      border-radius: 8px;
      padding: 12px 16px;
    }
    .excel-ai-avatar {
      width: 34px;
      height: 34px;
      border-radius: 8px;
      background: #DBEAFE;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 18px;
      flex-shrink: 0;
    }
    .excel-pill {
      font-size: 11px;
      font-weight: 600;
      padding: 2px 8px;
      border-radius: 9999px;
      background: #E2E8F0;
      color: #334155;
    }
    .excel-pill.ready { background: #DCFCE7; color: #166534; }
    .excel-pill.warning { background: #FEF3C7; color: #92400E; }
    .excel-pill.rejected { background: #FEE2E2; color: #991B1B; }
    .excel-metric-pill {
      font-size: 11.5px;
      padding: 4px 10px;
      border-radius: 6px;
      display: flex;
      align-items: center;
      gap: 5px;
      border: 1px solid rgba(0,0,0,0.05);
    }
    .excel-filter-btn {
      padding: 4px 10px;
      font-size: 11.5px;
      border-radius: 6px;
      border: 1px solid #CBD5E1;
      background: #FFFFFF;
      color: #475569;
      cursor: pointer;
      transition: all 0.15s ease;
    }
    .excel-filter-btn:hover {
      background: #F1F5F9;
    }
    .excel-filter-btn.active {
      background: #0F172A;
      color: #FFFFFF;
      border-color: #0F172A;
    }
    .excel-preview-table-container {
      border: 1px solid #E2E8F0;
      border-radius: 8px;
      overflow: auto;
      max-height: 48vh;
      background: #FFFFFF;
    }
    .excel-preview-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 12px;
      text-align: left;
      white-space: nowrap;
    }
    .excel-preview-table th {
      position: sticky;
      top: 0;
      background: #F8FAFC;
      z-index: 2;
      padding: 9px 12px;
      font-weight: 600;
      color: #475569;
      border-bottom: 1px solid #CBD5E1;
      font-size: 11.5px;
    }
    .excel-preview-table td {
      padding: 8px 12px;
      border-bottom: 1px solid #F1F5F9;
      color: #1E293B;
    }
    .excel-preview-table tr.row-invalid {
      background: #FEF2F2;
    }
    .excel-preview-table tr.row-invalid td {
      color: #991B1B;
    }
    .excel-preview-table tr:hover {
      background: #F8FAFC;
    }
    .excel-preview-table tr.row-invalid:hover {
      background: #FEE2E2;
    }
    .excel-preview-footer {
      padding: 12px 20px;
      background: #F8FAFC;
      border-top: 1px solid #E2E8F0;
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-shrink: 0;
    }

    /* ATTENDANCE MATRIX & TIMEKEEPING STYLES (Codex AC-5) */
    .segmented-control {
      display: inline-flex;
      background: #F1F5F9;
      border: 1px solid #E2E8F0;
      border-radius: 6px;
      padding: 3px;
      gap: 3px;
    }
    .segmented-btn {
      padding: 5px 14px;
      font-size: 12px;
      font-weight: 600;
      border-radius: 4px;
      border: none;
      background: transparent;
      color: #64748B;
      cursor: pointer;
      transition: all 0.15s ease;
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }
    .segmented-btn:hover {
      color: #0F172A;
    }
    .segmented-btn.active {
      background: #FFFFFF;
      color: #0F172A;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    }
    .segmented-badge {
      display: inline-block;
      padding: 1px 6px;
      border-radius: 10px;
      font-size: 10px;
      font-weight: 700;
      background: #E2E8F0;
      color: #334155;
    }
    .segmented-btn.active .segmented-badge {
      background: #FEF3C7;
      color: #92400E;
    }

    .att-matrix-container {
      flex: 1;
      overflow: auto;
      border: 1px solid var(--border);
      border-radius: 6px;
      background: #FFFFFF;
      position: relative;
      box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    }
    .att-matrix-table {
      border-collapse: separate;
      border-spacing: 0;
      font-size: 11.5px;
      width: max-content;
      min-width: 100%;
    }
    .att-matrix-table th, .att-matrix-table td {
      border-bottom: 1px solid #E2E8F0;
      border-right: 1px solid #E2E8F0;
      padding: 5px 4px;
      text-align: center;
      vertical-align: middle;
    }
    .att-matrix-table th {
      background: #F8FAFC;
      font-weight: 700;
      color: #475569;
      position: sticky;
      top: 0;
      z-index: 10;
      white-space: nowrap;
    }
    .att-matrix-table th.is-sunday, .att-matrix-table td.is-sunday {
      background-color: #F1F5F9 !important;
      color: #94A3B8;
    }
    .att-matrix-table th.day-th {
      min-width: 38px;
      max-width: 38px;
      padding: 4px 2px;
      font-size: 11px;
    }
    .att-matrix-table th.day-th .day-num {
      font-size: 11.5px;
      font-weight: 700;
      display: block;
    }
    .att-matrix-table th.day-th .day-name {
      font-size: 9.5px;
      font-weight: 600;
      color: #64748B;
      display: block;
    }
    .att-matrix-table th.day-th.is-sunday .day-name {
      color: #EF4444;
    }

    /* Sticky Left Columns */
    .att-matrix-table .col-stt {
      position: sticky;
      left: 0;
      z-index: 5;
      width: 38px;
      min-width: 38px;
      background: #FFFFFF;
    }
    .att-matrix-table .col-code {
      position: sticky;
      left: 38px;
      z-index: 5;
      width: 90px;
      min-width: 90px;
      background: #FFFFFF;
      font-weight: 600;
    }
    .att-matrix-table .col-name {
      position: sticky;
      left: 128px;
      z-index: 5;
      width: 155px;
      min-width: 155px;
      background: #FFFFFF;
      text-align: left;
      padding-left: 8px;
      font-weight: 600;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .att-matrix-table .col-dept {
      position: sticky;
      left: 283px;
      z-index: 5;
      width: 140px;
      min-width: 140px;
      background: #FFFFFF;
      text-align: left;
      padding-left: 8px;
      border-right: 2px solid #CBD5E1;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .att-matrix-table th.col-stt,
    .att-matrix-table th.col-code,
    .att-matrix-table th.col-name,
    .att-matrix-table th.col-dept {
      z-index: 15;
      background: #F8FAFC;
    }

    /* Sticky Right Columns (Totals) */
    .att-matrix-table .col-total-work {
      position: sticky;
      right: 180px;
      z-index: 5;
      width: 65px;
      min-width: 65px;
      background: #F0FDF4;
      font-weight: 700;
      color: #166534;
      border-left: 2px solid #CBD5E1;
    }
    .att-matrix-table .col-total-late {
      position: sticky;
      right: 120px;
      z-index: 5;
      width: 60px;
      min-width: 60px;
      background: #FFFBEB;
      color: #B45309;
    }
    .att-matrix-table .col-total-leave {
      position: sticky;
      right: 60px;
      z-index: 5;
      width: 60px;
      min-width: 60px;
      background: #EFF6FF;
      color: #1D4ED8;
    }
    .att-matrix-table .col-total-absent {
      position: sticky;
      right: 0;
      z-index: 5;
      width: 60px;
      min-width: 60px;
      background: #FEF2F2;
      color: #B91C1C;
    }

    .att-matrix-table th.col-total-work,
    .att-matrix-table th.col-total-late,
    .att-matrix-table th.col-total-leave,
    .att-matrix-table th.col-total-absent {
      z-index: 15;
    }

    /* Cell badge chip styles (Codex AC-5) */
    .att-cell {
      cursor: pointer;
      transition: all 0.1s ease;
      user-select: none;
      position: relative;
    }
    .att-cell:hover {
      filter: brightness(0.92);
      outline: 1.5px solid var(--primary);
      z-index: 6;
    }
    .att-badge {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 10.5px;
      font-weight: 700;
      border-radius: 3px;
      padding: 2px 3px;
      min-width: 24px;
      line-height: 1.2;
    }
    .att-badge-1 { background: #DCFCE7; color: #166534; border: 1px solid #BBF7D0; } /* 1.0 đủ công */
    .att-badge-05 { background: #FFEDD5; color: #C2410C; border: 1px solid #FED7AA; } /* 0.5 nửa ngày */
    .att-badge-m { background: #FEF3C7; color: #B45309; border: 1px solid #FDE68A; } /* Đi muộn / về sớm */
    .att-badge-p { background: #DBEAFE; color: #1D4ED8; border: 1px solid #BFDBFE; } /* Nghỉ phép có lương */
    .att-badge-kp { background: #E2E8F0; color: #334155; border: 1px solid #CBD5E1; } /* Nghỉ không lương */
    .att-badge-v { background: #FEE2E2; color: #B91C1C; border: 1px solid #FECACA; } /* Vắng mặt */
    .att-badge-off { color: #94A3B8; font-weight: normal; } /* Cuối tuần / Chưa tới */
    
    .att-legend-bar {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 6px 12px;
      background: #F8FAFC;
      border: 1px solid #E2E8F0;
      border-radius: 6px;
      font-size: 11px;
      color: #475569;
      flex-wrap: wrap;
    }
    .att-legend-item {
      display: inline-flex;
      align-items: center;
      gap: 5px;
    }

    /* ========================================================= */
    /* 13. STYLES FOR ADMIN EXPENSES & OPERATIONAL BUDGET */
    /* ========================================================= */
    .expense-kpi-container {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 12px;
      margin-bottom: 2px;
    }
    .expense-kpi-card {
      background: #FFFFFF;
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 12px 14px;
      display: flex;
      flex-direction: column;
      gap: 4px;
      box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    }
    .expense-kpi-title {
      font-size: 11px;
      font-weight: 600;
      color: #64748B;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .expense-kpi-val {
      font-size: 17px;
      font-weight: 700;
      color: #0F172A;
      line-height: 1.2;
    }
    .expense-kpi-sub {
      font-size: 11px;
      color: #64748B;
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .expense-budget-bar {
      height: 6px;
      width: 100%;
      background: #E2E8F0;
      border-radius: 3px;
      overflow: hidden;
      margin-top: 4px;
    }
    .expense-budget-fill {
      height: 100%;
      border-radius: 3px;
      transition: width 0.3s ease;
    }
    .expense-budget-fill.safe { background: #16A34A; }
    .expense-budget-fill.warning { background: #EAB308; }
    .expense-budget-fill.danger { background: #DC2626; }

    /* Category Badges */
    .cat-badge {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 2px 7px;
      border-radius: 4px;
      font-size: 11px;
      font-weight: 600;
    }
    .cat-badge-DIEN { background: #FEF3C7; color: #B45309; border: 1px solid #FDE68A; }
    .cat-badge-NUOC { background: #E0F2FE; color: #0369A1; border: 1px solid #BAE6FD; }
    .cat-badge-INTERNET { background: #DBEAFE; color: #1D4ED8; border: 1px solid #BFDBFE; }
    .cat-badge-VE_SINH { background: #D1FAE5; color: #047857; border: 1px solid #A7F3D0; }
    .cat-badge-BAO_VE { background: #F1F5F9; color: #334155; border: 1px solid #CBD5E1; }
    .cat-badge-THUE_VAN_PHONG { background: #EDE9FE; color: #6D28D9; border: 1px solid #DDD6FE; }
    .cat-badge-BAO_TRI { background: #FFEDD5; color: #C2410C; border: 1px solid #FED7AA; }
    .cat-badge-TIEP_KHACH { background: #FCE7F3; color: #BE185D; border: 1px solid #FBCFE8; }
    .cat-badge-KHAC { background: #F3F4F6; color: #4B5563; border: 1px solid #E5E7EB; }

    /* Payment Status Badges */
    .pay-badge {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 2px 7px;
      border-radius: 4px;
      font-size: 11px;
      font-weight: 600;
    }
    .pay-badge-PAID { background: #DCFCE7; color: #166534; border: 1px solid #BBF7D0; }
    .pay-badge-UNPAID { background: #FEF3C7; color: #B45309; border: 1px solid #FDE68A; }
    .pay-badge-OVERDUE { background: #FEE2E2; color: #B91C1C; border: 1px solid #FECACA; }

    /* % Progress Mini in Table */
    .grid-progress-wrap {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 11px;
    }
    .grid-progress-bar {
      flex: 1;
      height: 5px;
      background: #E2E8F0;
      border-radius: 3px;
      overflow: hidden;
      min-width: 45px;
    }

    /* Bộ hiển thị tháng tiếng Việt */
    .vn-month-picker-wrap {
      position: relative;
      display: inline-flex;
      align-items: center;
    }
    .vn-month-display {
      min-width: 145px;
      height: 34px;
      padding: 0 10px;
      background: #FFFFFF;
      border: 1px solid var(--border);
      border-radius: 6px;
      font-size: 13px;
      font-weight: 700;
      color: var(--text);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      cursor: pointer;
      user-select: none;
      transition: all 0.15s ease;
    }
    .vn-month-display:hover {
      border-color: var(--primary);
      background: #F8FAFC;
    }
    .vn-month-picker-wrap input[type="month"] {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      opacity: 0;
      cursor: pointer;
      z-index: 2;
    }

    /* ========================================================= */
    /* 14. GIAO DIỆN CHAT AI CHUYÊN NGHIỆP KIỂU CHATGPT / CLAUDE */
    /* ========================================================= */
    .ai-chat-app-layout {
      display: flex;
      width: 100%;
      height: 100%;
      min-height: 0;
      background: #FFFFFF;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      overflow: hidden;
      box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    }

    /* 1. SIDEBAR LỊCH SỬ CHAT (COLLAPSIBLE) */
    .ai-history-sidebar {
      width: 260px;
      min-width: 260px;
      background: #F8FAFC;
      border-right: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      height: 100%;
      transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
      overflow: hidden;
    }
    .ai-history-sidebar.collapsed {
      width: 0 !important;
      min-width: 0 !important;
      border-right: none;
      visibility: hidden;
    }
    .ai-history-header {
      padding: 12px;
      display: flex;
      align-items: center;
      gap: 8px;
      border-bottom: 1px solid var(--border);
    }
    .btn-new-chat {
      flex: 1;
      height: 36px;
      background: #FFFFFF;
      border: 1px solid #CBD5E1;
      border-radius: 8px;
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 0 12px;
      font-size: 13px;
      font-weight: 600;
      color: #1E293B;
      cursor: pointer;
      transition: all 0.15s ease;
      box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    }
    .btn-new-chat:hover {
      background: #F1F5F9;
      border-color: #94A3B8;
      color: var(--primary);
    }
    .btn-icon-toggle {
      width: 36px;
      height: 36px;
      border: 1px solid transparent;
      background: transparent;
      border-radius: 6px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #64748B;
      cursor: pointer;
      transition: all 0.15s ease;
    }
    .btn-icon-toggle:hover {
      background: #E2E8F0;
      color: #0F172A;
    }
    .ai-history-label {
      padding: 12px 14px 6px;
      font-size: 10.5px;
      font-weight: 700;
      color: #94A3B8;
      letter-spacing: 0.5px;
      text-transform: uppercase;
    }
    .ai-history-list {
      flex: 1;
      overflow-y: auto;
      padding: 6px 8px;
      display: flex;
      flex-direction: column;
      gap: 3px;
    }
    .ai-history-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      padding: 8px 10px;
      border-radius: 6px;
      cursor: pointer;
      font-size: 12.5px;
      color: #334155;
      background: transparent;
      transition: all 0.15s ease;
      position: relative;
      user-select: none;
    }
    .ai-history-item:hover {
      background: #EDF2F7;
      color: #0F172A;
    }
    .ai-history-item.active {
      background: #FFFFFF;
      color: var(--primary);
      font-weight: 600;
      box-shadow: 0 1px 3px rgba(0,0,0,0.06);
      border-left: 3px solid var(--primary);
    }
    .ai-history-title-wrap {
      flex: 1;
      min-width: 0;
      display: flex;
      flex-direction: column;
    }
    .ai-history-title {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      font-size: 12.5px;
    }
    .ai-history-time {
      font-size: 10.5px;
      color: #94A3B8;
      margin-top: 2px;
    }
    .btn-del-session {
      width: 22px;
      height: 22px;
      border: none;
      background: transparent;
      color: #94A3B8;
      border-radius: 4px;
      display: none;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      font-size: 12px;
    }
    .ai-history-item:hover .btn-del-session {
      display: flex;
    }
    .btn-del-session:hover {
      background: #FEE2E2;
      color: #DC2626;
    }
    .ai-history-footer {
      padding: 10px 12px;
      border-top: 1px solid var(--border);
      background: #F8FAFC;
    }
    .btn-clear-history {
      width: 100%;
      height: 32px;
      border: 1px dashed #CBD5E1;
      background: transparent;
      color: #64748B;
      border-radius: 6px;
      font-size: 11.5px;
      font-weight: 500;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      transition: all 0.15s ease;
    }
    .btn-clear-history:hover {
      border-color: #EF4444;
      background: #FEF2F2;
      color: #DC2626;
    }

    /* 2. MAIN CHAT AREA */
    .ai-chat-main-area {
      flex: 1;
      min-width: 0;
      display: flex;
      flex-direction: column;
      height: 100%;
      background: #FFFFFF;
      position: relative;
    }
    .ai-chat-topbar {
      height: 48px;
      min-height: 48px;
      padding: 0 16px;
      background: #FFFFFF;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      z-index: 10;
    }
    .ai-topbar-left {
      display: flex;
      align-items: center;
      gap: 12px;
    }
    .btn-toggle-sidebar {
      width: 32px;
      height: 32px;
      border: 1px solid var(--border);
      background: #FFFFFF;
      border-radius: 6px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #475569;
      cursor: pointer;
      transition: all 0.15s ease;
    }
    .btn-toggle-sidebar:hover {
      background: #F1F5F9;
      color: #0F172A;
    }
    .ai-agent-chip {
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .ai-agent-avatar {
      font-size: 18px;
    }
    .ai-agent-name-group {
      display: flex;
      flex-direction: column;
    }
    .ai-agent-title {
      font-size: 13px;
      font-weight: 700;
      color: #0F172A;
      line-height: 1.2;
    }
    .ai-agent-sub {
      font-size: 10.5px;
      color: #64748B;
      line-height: 1.2;
    }
    .ai-topbar-right {
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .ai-status-chip {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 3px 8px;
      border-radius: 12px;
      font-size: 11px;
      font-weight: 600;
      background: #EFF6FF;
      color: #1D4ED8;
      border: 1px solid #BFDBFE;
    }

    /* VÙNG CUỘN TIN NHẮN CHAT (CĂN GIỮA MAX 900PX) */
    .ai-chat-scroll-area {
      flex: 1;
      overflow-y: auto;
      background: #F8FAFC;
    }
    .ai-chat-inner-container {
      max-width: 900px;
      margin: 0 auto;
      padding: 24px 20px 140px;
      display: flex;
      flex-direction: column;
      gap: 16px;
    }

    .ai-msg {
      display: flex;
      gap: 12px;
      max-width: 100%;
      animation: fadeIn 0.15s ease-out;
    }
    @keyframes fadeIn {
      from { opacity: 0; transform: translateY(4px); }
      to { opacity: 1; transform: translateY(0); }
    }
    .ai-msg.user {
      justify-content: flex-end;
    }
    .ai-msg.user .ai-avatar {
      order: 2;
    }
    .ai-msg.user .ai-bubble {
      order: 1;
      background: var(--primary);
      color: #FFFFFF;
      border: none;
      border-radius: 16px 16px 4px 16px;
      max-width: 80%;
      box-shadow: 0 2px 6px rgba(220, 38, 38, 0.2);
    }
    .ai-msg.bot {
      justify-content: flex-start;
    }
    .ai-msg.bot .ai-bubble {
      background: #FFFFFF;
      color: #1E293B;
      border: 1px solid #E2E8F0;
      border-radius: 16px 16px 16px 4px;
      max-width: 90%;
      box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    }
    .ai-avatar {
      width: 32px;
      height: 32px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 14px;
      flex-shrink: 0;
      font-weight: 700;
    }
    .ai-avatar.bot {
      background: #FEE2E2;
      color: var(--primary);
      border: 1px solid #FECACA;
    }
    .ai-avatar.user {
      background: #F1F5F9;
      color: #334155;
      border: 1px solid #CBD5E1;
    }
    .ai-bubble {
      padding: 12px 16px;
      font-size: 13px;
      line-height: 1.6;
    }
    .ai-bubble-meta {
      font-size: 11px;
      margin-top: 6px;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    /* CARD VĂN BẢN TRỰC TIẾP TRONG DÒNG CHAT (INLINE DOCUMENT CARD) */
    .ai-doc-inline-card {
      margin-top: 12px;
      background: #FFFFFF;
      border: 1.5px solid #BFDBFE;
      border-radius: 8px;
      padding: 14px 16px;
      box-shadow: 0 2px 6px rgba(37, 99, 235, 0.08);
      display: flex;
      flex-direction: column;
      gap: 10px;
    }
    .ai-doc-inline-header {
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .ai-doc-inline-badge {
      font-size: 11px;
      font-weight: 700;
      padding: 3px 8px;
      border-radius: 4px;
      background: #FEF3C7;
      color: #B45309;
      border: 1px solid #FDE68A;
      text-transform: uppercase;
    }
    .ai-doc-inline-title {
      font-size: 13.5px;
      font-weight: 700;
      color: #0F172A;
    }
    .ai-doc-inline-summary {
      font-size: 12px;
      color: #64748B;
      line-height: 1.5;
    }
    .ai-doc-inline-actions {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
      padding-top: 6px;
      border-top: 1px dashed #E2E8F0;
    }

    /* KHU VỰC NHẬP LỆNH STICKY DƯỚI ĐÁY */
    .ai-chat-bottom-dock {
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      background: linear-gradient(to top, rgba(248, 250, 252, 1) 75%, rgba(248, 250, 252, 0) 100%);
      padding: 10px 20px 16px;
      pointer-events: none;
    }
    .ai-dock-inner {
      max-width: 900px;
      margin: 0 auto;
      pointer-events: auto;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .ai-quick-pills-bar {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      max-width: 100%;
      padding-bottom: 2px;
    }
    .ai-pill-btn {
      font-size: 11.5px;
      padding: 5px 12px;
      border-radius: 16px;
      background: #FFFFFF;
      color: #334155;
      border: 1px solid #E2E8F0;
      cursor: pointer;
      white-space: nowrap;
      transition: all 0.15s ease;
      box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    }
    .ai-pill-btn:hover {
      background: #F1F5F9;
      color: var(--primary);
      border-color: #CBD5E1;
    }
    .ai-input-box {
      display: flex;
      align-items: flex-end;
      gap: 8px;
      background: #FFFFFF;
      border: 1.5px solid #CBD5E1;
      border-radius: 12px;
      padding: 6px 10px 6px 14px;
      box-shadow: 0 3px 12px rgba(0,0,0,0.06);
      transition: border-color 0.15s ease;
    }
    .ai-input-box:focus-within {
      border-color: var(--primary);
      box-shadow: 0 3px 12px rgba(220, 38, 38, 0.12);
    }
    .ai-input-textarea {
      flex: 1;
      height: 38px;
      max-height: 160px;
      min-height: 38px;
      resize: none;
      border: none;
      background: transparent;
      outline: none;
      font-size: 13.5px;
      font-family: inherit;
      line-height: 1.45;
      color: #0F172A;
      padding: 8px 0;
    }
    .btn-ai-send-round {
      width: 38px;
      height: 38px;
      border-radius: 50%;
      background: var(--primary);
      color: #FFFFFF;
      border: none;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.15s ease;
      flex-shrink: 0;
      margin-bottom: 1px;
    }
    .btn-ai-send-round:hover {
      background: var(--primary-hover);
      transform: scale(1.04);
    }
    .btn-ai-send-round:disabled {
      background: #CBD5E1;
      cursor: not-allowed;
      transform: none;
    }
    .ai-input-footnote {
      font-size: 11px;
      color: #94A3B8;
      text-align: center;
      margin-top: 2px;
    }

    /* Khổ giấy A4 chuẩn: tự động dài ra theo toàn bộ nội dung, không bao giờ bị cắt cụt */
    .a4-sheet {
      width: 780px;
      min-height: 1100px;
      height: auto !important;
      margin-bottom: 48px;
      background: #FFFFFF;
      padding: 48px 54px 64px 54px;
      border-radius: 2px;
      box-shadow: 0 4px 20px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.04);
      box-sizing: border-box;
      outline: none;
      font-family: 'Times New Roman', Times, serif;
      font-size: 13.5pt;
      line-height: 1.45;
      color: #000000;
      text-align: justify;
      position: relative;
    }
    .a4-sheet:focus {
      box-shadow: 0 0 0 2px var(--primary), 0 4px 20px rgba(0,0,0,0.1);
    }
    /* Triệt tiêu mọi lồng khung trang con bên trong tờ giấy A4 */
    .a4-sheet .a4-document,
    .a4-sheet .a4-page,
    .a4-sheet .document-container,
    .a4-sheet > div:first-child {
      width: 100% !important;
      max-width: 100% !important;
      min-height: auto !important;
      box-shadow: none !important;
      padding: 0 !important;
      margin: 0 !important;
      background: transparent !important;
      border: none !important;
    }
    .a4-sheet h1 {
      font-size: 15pt !important;
      line-height: 1.35 !important;
      font-weight: bold !important;
      text-transform: uppercase !important;
      text-align: center !important;
      margin: 10px 0 4px 0 !important;
      letter-spacing: 0.2px;
    }
    .a4-sheet h2 {
      font-size: 14pt !important;
      line-height: 1.3 !important;
      font-weight: bold !important;
      text-align: center !important;
      margin: 8px 0 4px 0 !important;
    }
    .a4-sheet h3, .a4-sheet h4 {
      font-size: 13pt !important;
      line-height: 1.35 !important;
      font-weight: bold !important;
      margin: 8px 0 4px 0 !important;
    }
    .a4-sheet p {
      font-size: 13pt !important;
      line-height: 1.45 !important;
      margin-bottom: 6px !important;
    }
    .a4-duty-list {
      margin: 6px 0 10px 28px !important;
      padding-left: 0 !important;
      list-style-type: disc !important;
    }
    .a4-duty-list li {
      margin-bottom: 4px !important;
      font-size: 13pt !important;
      line-height: 1.4 !important;
      text-align: justify !important;
    }
    .a4-empty-hint {
      text-align: center;
      padding: 120px 20px;
      color: #64748B;
      font-family: var(--font-sans, sans-serif);
      font-size: 13px;
    }

    /* Các phần tử văn bản trong A4 */
    .a4-header-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      margin-bottom: 24px;
      text-align: center;
      font-size: 12pt;
      line-height: 1.35;
    }
    .a4-corp-info {
      text-align: center;
    }
    .a4-national-info {
      text-align: center;
    }
    .a4-divider {
      letter-spacing: -1px;
    }
    .a4-title-block {
      text-align: center;
      margin: 20px 0 18px 0;
    }
    .a4-title {
      font-size: 17pt;
      font-weight: bold;
      text-transform: uppercase;
      margin: 0;
      color: #000000;
    }
    .a4-code {
      font-size: 11.5pt;
      font-style: italic;
      margin-top: 4px;
    }
    .a4-legal-basis {
      margin-bottom: 14px;
      font-size: 12.5pt;
      line-height: 1.35;
    }
    .a4-legal-basis p {
      margin: 3px 0;
      text-indent: 0;
    }
    .a4-meta-table {
      width: 100%;
      border-collapse: collapse;
      margin: 4px 0 10px 0;
      font-size: 13pt;
    }
    .a4-meta-table td {
      padding: 2px 4px;
      vertical-align: top;
    }
    .a4-section {
      margin-top: 14px;
    }
    .a4-section h4 {
      margin: 10px 0 4px 0;
      font-size: 13.5pt;
      font-weight: bold;
      text-transform: uppercase;
    }
    .a4-section p {
      margin: 5px 0;
      text-indent: 28px;
    }
    .a4-signatures-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      margin-top: 32px;
      text-align: center;
      page-break-inside: avoid;
    }
    .a4-sign-box {
      padding: 0 12px;
    }

    /* ==============================================================================
       RESPONSIVE AUTO-ADAPTATION (PHÂN BIỆT RÕ MÀN ĐIỆN THOẠI & MÀN LAPTOP)
       ============================================================================== */

    /* Lớp phủ mờ nền khi mở menu trên điện thoại */
    .sidebar-backdrop {
      display: none;
      position: fixed;
      top: 0;
      left: 0;
      width: 100vw;
      height: 100vh;
      background: rgba(15, 23, 42, 0.45);
      backdrop-filter: blur(2px);
      -webkit-backdrop-filter: blur(2px);
      z-index: 998;
      opacity: 0;
      transition: opacity 0.25s ease;
      pointer-events: none;
    }

    .sidebar-backdrop.active {
      display: block;
      opacity: 1;
      pointer-events: auto;
    }

    /* MÀN HÌNH MÁY TÍNH BẢNG / TABLET (769px - 1024px) */
    @media screen and (min-width: 769px) and (max-width: 1024px) {
      .realtime-clock {
        display: none !important;
      }
      .app-sidebar:not(.mobile-open) {
        width: 68px !important;
        min-width: 68px !important;
      }
    }

    /* MÀN HÌNH ĐIỆN THOẠI / SMARTPHONE (<= 768px, SAMSUNG 6-INCH & IPHONE) */
    @media screen and (max-width: 768px) {
      /* 1. Reset Body & Layout */
      body {
        height: 100%;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
      }
      .app-layout {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        position: relative !important;
        overflow: hidden !important;
        display: block !important;
      }

      /* 2. Menu Sidebar tự động ẩn kiểu Off-Canvas trên điện thoại */
      .app-sidebar,
      .app-sidebar.collapsed,
      .app-sidebar:not(.mobile-open) {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        height: 100vh !important;
        height: 100dvh !important;
        width: 280px !important;
        min-width: 280px !important;
        max-width: 85vw !important;
        z-index: 9999 !important;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25) !important;
        transform: translateX(-100%) !important;
        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
      }

      .app-sidebar.mobile-open {
        transform: translateX(0) !important;
      }

      .app-sidebar .sidebar-brand-text {
        display: flex !important;
      }
      .app-sidebar .sidebar-item-text {
        display: inline !important;
      }
      .app-sidebar .sidebar-group-header {
        display: block !important;
      }
      .app-sidebar .sidebar-footer {
        display: none !important;
      }

      /* 3. Vùng làm việc chính chiếm trọn vẹn 100% màn hình điện thoại */
      .app-main {
        width: 100vw !important;
        max-width: 100vw !important;
        min-width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        flex: 1 1 100% !important;
        margin-left: 0 !important;
        overflow-x: hidden !important;
        position: relative !important;
      }

      /* 4. Top Header tinh gọn trên điện thoại */
      .top-header {
        padding: 0 10px;
        height: 50px;
      }
      .header-left {
        gap: 8px;
        flex: 1;
        min-width: 0;
      }
      .header-left .header-toggle-btn {
        display: flex !important;
        padding: 8px;
        background: var(--bg);
        border: 1px solid var(--border);
        border-radius: 6px;
        cursor: pointer;
        color: var(--text);
      }
      .header-left .breadcrumb {
        font-size: 13px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
      .breadcrumb .bc-root,
      .breadcrumb .bc-sep,
      .breadcrumb .bc-group {
        display: none !important;
      }
      .breadcrumb .bc-item {
        font-weight: 700;
        font-size: 13.5px;
        color: var(--primary);
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: inline-block;
      }

      .header-right {
        gap: 6px;
        flex-shrink: 0;
      }
      .header-right .realtime-clock {
        display: none !important;
      }
      .header-right .user-chip #userInfo {
        display: none !important;
      }
      .header-right .header-btn-text {
        display: none !important;
      }
      .header-right .header-action-btn,
      .header-right a[download] {
        padding: 6px !important;
        border-radius: 6px !important;
        min-width: 32px !important;
        height: 32px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
      }

      /* 4.1 Page Context Header & Metrics Trên Điện Thoại */
      .page-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 6px !important;
      }
      .page-title {
        font-size: 15px !important;
      }
      .page-subtitle {
        display: none !important;
      }
      .metric-chips, .page-metrics-group {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        gap: 6px !important;
        width: 100% !important;
        padding-bottom: 2px !important;
        -webkit-overflow-scrolling: touch !important;
      }
      .metric-chip {
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        font-size: 11px !important;
        padding: 3px 8px !important;
      }

      /* 5. Vùng Workspace */
      .workspace {
        padding: 6px !important;
        width: 100vw !important;
        max-width: 100vw !important;
        height: calc(100vh - 50px) !important;
        height: calc(100dvh - 50px) !important;
        gap: 6px !important;
        overflow-y: auto !important;
      }

      /* 6. Thanh Toolbar & Tìm kiếm tự xếp chồng trên điện thoại */
      .toolbar {
        padding: 8px;
        gap: 6px;
        flex-direction: column;
        align-items: stretch;
      }
      .toolbar-left,
      .toolbar-right,
      .toolbar-filters {
        width: 100% !important;
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
      }
      .toolbar input.input-search,
      .toolbar .search-box {
        width: 100% !important;
        max-width: 100% !important;
      }
      .toolbar select,
      .toolbar button,
      .toolbar .btn {
        flex: 1 1 auto;
        font-size: 12px;
        min-height: 36px;
      }

      /* 7. Bảng Dữ Liệu - Cuộn ngang cảm ứng mượt mà */
      .grid-container,
      .grid-wrapper,
      .table-responsive {
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
      }
      .grid-table {
        min-width: 600px;
      }

      /* 8. Drawers trượt toàn màn hình trên điện thoại */
      .detail-drawer {
        position: fixed !important;
        top: 0;
        right: 0;
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        z-index: 1050 !important;
        border-radius: 0 !important;
      }

      /* 9. Modals trên điện thoại */
      .modal-content {
        width: 95vw !important;
        max-width: 95vw !important;
        max-height: 90vh !important;
        max-height: 90dvh !important;
        padding: 16px !important;
        margin: 8px auto !important;
      }

      /* 10. Phân trang trên điện thoại */
      .grid-pagination {
        flex-direction: column !important;
        height: auto !important;
        gap: 6px !important;
        padding: 8px 10px !important;
      }
      .pag-info {
        font-size: 11px !important;
      }
      .pag-actions {
        width: 100% !important;
        justify-content: space-between !important;
      }

      /* 11. Trợ Lý AI Chat trên điện thoại (Samsung 6-inch & Smartphone) */
      .ai-chat-app-layout {
        position: relative !important;
        border: none !important;
        border-radius: 0 !important;
        height: 100% !important;
        width: 100% !important;
        max-width: 100% !important;
      }

      .ai-history-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        height: 100vh !important;
        height: 100dvh !important;
        width: 280px !important;
        min-width: 280px !important;
        max-width: 85vw !important;
        z-index: 10001 !important;
        box-shadow: 4px 0 24px rgba(0,0,0,0.2) !important;
        transform: translateX(-100%) !important;
        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
      }
      .ai-history-sidebar.open-mobile {
        transform: translateX(0) !important;
        visibility: visible !important;
      }

      .ai-chat-main-area {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        height: 100% !important;
      }

      .ai-chat-topbar {
        padding: 0 8px !important;
        height: 44px !important;
        min-height: 44px !important;
        gap: 6px !important;
      }
      .ai-agent-sub {
        display: none !important;
      }
      .ai-agent-title {
        font-size: 12.5px !important;
      }
      .ai-topbar-right .ai-status-chip {
        display: none !important;
      }
      .ai-topbar-right .btn-new-chat-text {
        display: none !important;
      }

      .ai-chat-scroll-area {
        padding: 8px 8px 120px !important;
      }

      /* Quick Pills vuốt ngang cảm ứng mượt mà */
      .ai-quick-pills-bar {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        gap: 6px !important;
        padding: 2px 0 4px !important;
        width: 100% !important;
        scrollbar-width: none !important;
      }
      .ai-quick-pills-bar::-webkit-scrollbar {
        display: none !important;
      }
      .ai-pill-btn {
        flex-shrink: 0 !important;
        white-space: nowrap !important;
        font-size: 11px !important;
        padding: 4px 10px !important;
        border-radius: 14px !important;
      }

      /* Thanh dock nhập tin nhắn AI */
      .ai-chat-bottom-dock {
        padding: 6px 8px 10px !important;
      }
      .ai-dock-inner {
        width: 100% !important;
        max-width: 100% !important;
        gap: 4px !important;
      }
      .ai-input-box {
        width: 100% !important;
        max-width: 100% !important;
        padding: 4px 8px 4px 10px !important;
        display: flex !important;
        align-items: flex-end !important;
        gap: 6px !important;
      }
      .ai-input-textarea {
        flex: 1 1 auto !important;
        width: 100% !important;
        min-width: 0 !important;
        height: 36px !important;
        font-size: 13px !important;
        padding: 6px 0 !important;
      }
      .btn-ai-send-round {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        flex-shrink: 0 !important;
      }
      .ai-input-footnote {
        font-size: 10px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
      }
    }

    /* IN ẤN CHUẨN A4 */
    @media print {
      body * {
        visibility: hidden;
      }
      .a4-sheet, .a4-sheet * {
        visibility: visible;
      }
      .a4-sheet {
        position: absolute;
        left: 0;
        top: 0;
        width: 100% !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
      }
      @page {
        size: A4;
        margin: 20mm;
      }
    }
/* ===== HỒ SƠ NHÂN SỰ: BỘ CHỌN NHÓM NHIỀU TIÊU CHÍ & TIÊU ĐỀ CỘT SẮP XẾP ĐƯỢC ===== */
.emp-group-picker { position: relative; }
.emp-group-btn { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; padding-right: 10px; }
  background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14); padding: 6px; }
.emp-group-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 4px 10px; border-radius: 14px; background: #FEF2F2; color: var(--primary); border: 1px solid #FECACA; font-weight: 600; }
.emp-group-chip button { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 12px; padding: 0; }
.emp-group-chip.is-warn { background: #FFFBEB; color: #92400E; border-color: #FDE68A; }
table.data-grid th.sortable { cursor: pointer; user-select: none; }
table.data-grid th.sortable:hover { color: var(--primary); }
table.data-grid th .sort-ind { font-size: 10px; opacity: 0.45; margin-left: 2px; }
table.data-grid th.is-sorted { color: var(--primary); }
table.data-grid th.is-sorted .sort-ind { opacity: 1; }

/* ===== HỒ SƠ NHÂN SỰ: PANEL TRƯỢT BÊN TRÁI (NHÓM THEO + GIÁ TRỊ CON) ===== */
.emp-side-panel { width: 0; flex-shrink: 0; overflow: hidden; transition: width 0.25s ease; border-radius: 8px; }
.emp-side-panel.open { width: 310px; }
.emp-side-inner { width: 310px; height: 100%; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--border); border-radius: 8px; }
.emp-side-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.emp-side-title { font-size: 13px; font-weight: 800; color: var(--text); }
.emp-side-hint { font-size: 11px; color: var(--text-muted); line-height: 1.45; margin-top: 3px; }
.emp-side-body { flex: 1; overflow-y: auto; padding: 6px; }
.emp-side-foot { display: flex; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--border); }
.emp-group-btn.is-open { border-color: var(--primary); color: var(--primary); }
.emp-crit { border: 1px solid transparent; border-radius: 8px; margin-bottom: 2px; }
.emp-crit.is-open { border-color: var(--border); background: #FCFCFD; }
.emp-crit.has-filter .emp-crit-title { color: var(--primary); font-weight: 700; }
.emp-crit-head { display: flex; align-items: center; gap: 4px; }
.emp-crit-all { display: inline-flex; align-items: center; padding: 6px 4px 6px 8px; cursor: pointer; }
.emp-crit-title { flex: 1; display: flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 7px 8px; font-size: 12.5px; font-weight: 600; color: var(--text); cursor: pointer; text-align: left; }
.emp-crit-title:hover { color: var(--primary); }
.emp-crit-sel { background: var(--primary); color: #fff; font-size: 10.5px; font-weight: 700; border-radius: 9px; padding: 0 6px; min-width: 16px; text-align: center; }
.emp-crit-chevron { margin-left: auto; transition: transform 0.15s; opacity: 0.6; }
.emp-crit.is-open .emp-crit-chevron { transform: rotate(180deg); }
.emp-crit-body { padding: 0 8px 8px 8px; }
.emp-crit-search { width: 100%; height: 28px; padding: 0 8px; margin-bottom: 4px; font-size: 12px; border: 1px solid var(--border); border-radius: 5px; outline: none; box-sizing: border-box; }
.emp-crit-search:focus { border-color: var(--primary); }
.emp-crit-actions { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--text-muted); padding: 2px 2px 4px; }
.emp-crit-actions button { border: 0; background: transparent; color: var(--primary); font-size: 11px; font-weight: 700; cursor: pointer; padding: 0; }
.emp-crit-list { max-height: 220px; overflow-y: auto; }
.emp-val { display: flex; align-items: center; gap: 7px; padding: 4px 6px; border-radius: 5px; font-size: 12px; cursor: pointer; }
.emp-val:hover { background: #F1F5F9; }
.emp-val.is-on { background: #FEF2F2; font-weight: 600; }
.emp-val-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emp-val-count { font-size: 11px; color: var(--text-muted); background: #F1F5F9; border-radius: 9px; padding: 0 6px; }
.emp-crit-empty { font-size: 12px; color: var(--text-muted); padding: 8px 4px; }
.emp-group-chip.is-filter { background: #EFF6FF; color: #1D4ED8; border-color: #BFDBFE; }
@media (max-width: 900px) { .emp-side-panel.open { position: absolute; z-index: 40; height: 100%; } }

/* BẢNG CỐ ĐỊNH 2 CỘT ĐẦU KHI CUỘN NGANG — bật bằng class "freeze-2" trên table.data-grid.
   --freeze-w-1 = bề rộng cột 1 (cột 2 là cột tên nhân viên, bám ngay sau cột 1). Dùng lại cho mọi bảng nhân sự. */
table.data-grid.freeze-2 th:nth-child(1), table.data-grid.freeze-2 td:nth-child(1) {
  position: sticky; left: 0;
  width: var(--freeze-w-1, 56px); min-width: var(--freeze-w-1, 56px); max-width: var(--freeze-w-1, 56px);
  box-sizing: border-box; overflow: hidden; text-overflow: ellipsis;
}
table.data-grid.freeze-2 th:nth-child(2), table.data-grid.freeze-2 td:nth-child(2) {
  position: sticky; left: var(--freeze-w-1, 56px);
  box-shadow: 3px 0 5px -2px rgba(15, 23, 42, 0.18); /* đường bóng báo hiệu phần cố định */
}
table.data-grid.freeze-2 td:nth-child(1), table.data-grid.freeze-2 td:nth-child(2) { background: #FFFFFF; z-index: 4; }
table.data-grid.freeze-2 th:nth-child(1), table.data-grid.freeze-2 th:nth-child(2) { background: #F8FAFC; z-index: 11; }
table.data-grid.freeze-2 tr:hover td:nth-child(1), table.data-grid.freeze-2 tr:hover td:nth-child(2) { background-color: var(--row-hover); }
/* Màn hình hẹp: bỏ cố định để không chiếm hết chiều ngang */
@media (max-width: 640px) {
  table.data-grid.freeze-2 th:nth-child(1), table.data-grid.freeze-2 td:nth-child(1),
  table.data-grid.freeze-2 th:nth-child(2), table.data-grid.freeze-2 td:nth-child(2) { position: static; box-shadow: none; }
}
/* Dòng thông báo trống (td colspan) không cố định, tránh chữ bị kẹt ở mép trái khi cuộn ngang */
table.data-grid.freeze-2 td[colspan] { position: static; width: auto; min-width: 0; max-width: none; box-shadow: none; overflow: visible; }
