:root {
  --bg: #f6f7fb;
  --panel: #ffffff;
  --line: #dfe5ef;
  --text: #122033;
  --muted: #60708a;
  --blue: #2864f0;
  --purple: #7557f6;
  --nav: #ffffff;
  --rail: #ffffff;
  --shadow: 0 10px 28px rgba(26, 39, 74, 0.08);
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  font-size: 14px;
  overflow: hidden;
}

/* ===== LEFT ICON RAIL ===== */
.rail {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 58px;
  background: var(--rail);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 9px;
  z-index: 20;
}

.rail-logo {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2864f0, #7b4df3);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 20px;
  box-shadow: 0 10px 18px rgba(40, 100, 240, 0.25);
  margin-bottom: 26px;
}

.rail-btn {
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  border-radius: 12px;
  margin: 5px 0;
  color: #789;
  cursor: pointer;
  font-size: 15px;
  display: grid;
  place-items: center;
}

.rail-btn:hover,
.rail-btn.active {
  background: linear-gradient(135deg, #326bf2, #7057f6);
  color: #fff;
  box-shadow: 0 10px 20px rgba(56, 100, 240, 0.22);
}

.rail-spacer {
  flex: 1;
}

.rail-btn.muted {
  font-size: 14px;
}

/* ===== MASTER FLYOUT ===== */
.flyout {
  position: fixed;
  left: 70px;
  top: 92px;
  width: 260px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 38px rgba(18, 32, 51, 0.15);
  z-index: 50;
  padding: 18px;
  backdrop-filter: blur(10px);
}

.hidden {
  display: none !important;
}

.flyout-title {
  font-size: 18px;
  font-weight: 750;
}

.flyout-line {
  height: 2px;
  background: linear-gradient(90deg, #7557f6, #ff4e8a);
  margin: 12px 0 16px;
}

.flyout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.flyout-card {
  height: 58px;
  border: 1px solid #e3e9f4;
  background: #fff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  font-weight: 650;
  color: #172033;
}

.flyout-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.flyout-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
}

.blue .flyout-icon { background: #3977f6; }
.green .flyout-icon { background: #20b86a; }
.orange .flyout-icon { background: #ff8a1f; }

/* ===== APP SHELL ===== */
.app-shell {
  margin-left: 58px;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 64px;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px 0 24px;
  z-index: 10;
}

.top-tabs {
  height: 100%;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  overflow-x: auto;
}

.top-tab {
  height: 48px;
  min-width: 128px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-bottom: 3px solid transparent;
  background: #fff;
  border-radius: 12px 12px 0 0;
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-weight: 650;
  color: #43506a;
}

.top-tab.active {
  color: #175cf0;
  border-bottom-color: #6a53f5;
  background: #fff;
  box-shadow: 0 8px 20px rgba(35, 60, 110, 0.08);
}

.tab-close {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: #617089;
  cursor: pointer;
  font-weight: 800;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-box {
  width: 250px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  background: #fff;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-chip span {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2864f0, #7b4df3);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.user-chip small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.workspace {
  height: calc(100vh - 64px);
  overflow: auto;
  padding: 24px 28px 40px;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #64748b;
  font-weight: 800;
}

.page h1,
.module-titlebar h1 {
  font-size: 24px;
  margin: 6px 0 4px;
}

.page p {
  color: var(--muted);
  margin: 0;
}

.compact-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}

/* ===== DASHBOARD ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 18px;
  max-width: 980px;
}

.kpi-card {
  height: 110px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px;
}

.kpi-icon {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 26px;
}

.kpi-icon.blue { background: #eaf1ff; color: #2864f0; }
.kpi-icon.green { background: #e9f8ef; color: #17a85a; }
.kpi-icon.orange { background: #fff0df; color: #ff8617; }

.kpi-card p {
  font-size: 13px;
}

.kpi-card h2 {
  font-size: 28px;
  margin: 4px 0;
}

/* ===== MODULE / ACCURATE-LIKE TABLE ===== */
.module-titlebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.subtab-row {
  height: 42px;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  border-bottom: 1px solid #cfd7e6;
}

.subtab {
  height: 34px;
  border: 1px solid #cfd7e6;
  border-bottom: 0;
  background: #edf2f8;
  color: #45546b;
  border-radius: 8px 8px 0 0;
  padding: 0 14px;
  font-weight: 650;
  cursor: pointer;
}

.subtab.active {
  background: #fff;
  color: #172033;
}

.subpage {
  display: none;
}

.subpage.active {
  display: block;
}

.toolbar {
  height: 52px;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.primary-mini {
  height: 32px;
  background: #2366e8;
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  font-weight: 800;
  cursor: pointer;
}

.tool-btn {
  height: 32px;
  border: 1px solid #cfd7e6;
  background: #fff;
  border-radius: 6px;
  padding: 0 10px;
  font-weight: 650;
  cursor: pointer;
}

.table-search {
  height: 32px;
  width: 240px;
  border: 1px solid #cfd7e6;
  border-radius: 6px;
  padding: 0 10px;
}

.data-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-top: 0;
  min-height: 470px;
  overflow: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

#tableMaterial,
#tableKaryawan,
#tableProyek {
  table-layout: fixed;
  width: max-content;
}

.data-table th {
  height: 32px;
  background: #5b7189;
  color: #fff;
  font-size: 12px;
  text-align: left;
  padding: 0 10px;
  border-right: 1px solid rgba(255, 255, 255, 0.18);
  position: sticky;
  top: 0;
  z-index: 8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-table td {
  height: 32px;
  padding: 0 10px;
  border-bottom: 1px solid #edf1f6;
  border-right: 1px solid #edf1f6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 0;
}


#tableMaterial th,
#tableMaterial td,
#tableKaryawan th,
#tableKaryawan td,
#tableProyek th,
#tableProyek td {
  box-sizing: border-box;
}

#tableMaterial .table-cell-ellipsis,
#tableKaryawan .table-cell-ellipsis,
#tableProyek .table-cell-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-table tbody tr:nth-child(even) {
  background: #fafbfe;
}

.data-table tbody tr:hover {
  background: #eef5ff;
}

/* ===== FORMS ===== */
.form-actionbar {
  height: 48px;
  background: #fff;
  border: 1px solid #cfd7e6;
  border-top: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
}

.save-btn {
  height: 34px;
  border: 0;
  background: #2e68e8;
  color: #fff;
  border-radius: 6px;
  padding: 0 16px;
  font-weight: 800;
  cursor: pointer;
}

.save-btn:disabled,
.primary-mini:disabled,
.tool-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.form-tabs {
  height: 36px;
  background: #f2f4f8;
  border-left: 1px solid #cfd7e6;
  border-right: 1px solid #cfd7e6;
  display: flex;
  align-items: flex-end;
  padding-left: 10px;
}

.form-tab {
  height: 30px;
  border: 1px solid #c8d0dc;
  border-bottom: 0;
  background: #e7ebf1;
  padding: 0 12px;
  border-radius: 6px 6px 0 0;
  margin-right: 4px;
  cursor: pointer;
}

.form-tab.active {
  background: #fff;
}

.erp-form-card {
  background: #fff;
  border: 1px solid #cfd7e6;
  min-height: 430px;
  padding: 18px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 28px;
  max-width: 980px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px 20px;
  max-width: 1180px;
}

.compact-form label {
  font-size: 13px;
  color: #172033;
  font-weight: 650;
}

.compact-form input,
.compact-form select {
  display: block;
  width: 100%;
  height: 32px;
  margin-top: 6px;
  border: 1px solid #bac6d5;
  border-radius: 4px;
  padding: 0 10px;
  background: #fff;
  font-size: 13px;
}

.compact-form input:focus,
.compact-form select:focus {
  outline: 2px solid #cfe0ff;
  border-color: #4e83f4;
}

@media (max-width: 900px) {
  .top-actions {
    display: none;
  }

  .form-grid-2,
  .form-grid-3,
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .workspace {
    padding: 18px;
  }

  .flyout {
    left: 64px;
    width: 230px;
  }
}

/* === RAPİKAN TABEL INDEX PROYEK === */

/* Sembunyikan kolom Level */
#tableProyek th:nth-child(1),
#tableProyek td:nth-child(1) {
  display: none;
}

/* Sembunyikan kolom Parent */
#tableProyek th:nth-child(3),
#tableProyek td:nth-child(3) {
  display: none;
}

/* Sembunyikan rincian kecil di bawah Nama Proyek */
#tableProyek td:nth-child(4) small,
#tableProyek td:nth-child(4) .project-subtitle,
#tableProyek td:nth-child(4) .muted,
#tableProyek td:nth-child(4) .subtext {
  display: none !important;
}

/* Biar kolom nama proyek tetap rapi */
#tableProyek td:nth-child(4) {
  font-weight: 700;
  color: #1f2937;
}

/* === INDEX PROYEK - CRUD TABLE OVERRIDE === */
#tableProyek th:nth-child(1),
#tableProyek td:nth-child(1),
#tableProyek th:nth-child(3),
#tableProyek td:nth-child(3) {
  display: none !important;
}

#tableProyek tbody tr.project-level-row td,
#tableProyek tbody tr.project-level-row td *,
#tableProyek tbody tr.project-level-row td div,
#tableProyek tbody tr.project-level-row td span {
  font-weight: 700 !important;
}

#tableProyek tbody tr.project-sub-row td,
#tableProyek tbody tr.project-sub-row td *,
#tableProyek tbody tr.project-sub-row td div,
#tableProyek tbody tr.project-sub-row td span {
  font-weight: 400 !important;
}

#tableProyek tbody tr.project-sub-row td:nth-child(2),
#tableProyek tbody tr.project-sub-row td:nth-child(4),
#tableProyek tbody tr.project-sub-row td:nth-child(5) {
  font-weight: 500 !important;
}

#tableProyek tbody td:nth-child(5) {
  color: #334155;
}

#tableProyek tbody td:nth-child(9) span.project-status-badge {
  font-family: "Segoe UI", Inter, Arial, sans-serif !important;
  font-size: 11px;
  font-weight: 700 !important;
}

.project-action-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.project-action-wrap .tool-btn {
  height: 26px;
  padding: 0 8px;
  font-size: 12px;
  border-radius: 6px;
}

.project-action-edit {
  border-color: #93c5fd !important;
  color: #1d4ed8 !important;
  background: #eff6ff !important;
}

.project-action-delete {
  border-color: #fecaca !important;
  color: #b91c1c !important;
  background: #fff5f5 !important;
}

.project-form-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.project-form-tab-close {
  display: inline-flex;
  width: 16px;
  height: 16px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #475569;
  font-weight: 800;
  cursor: pointer;
}

.project-form-tab-close:hover {
  background: #e2e8f0;
  color: #b91c1c;
}

/* =========================
   LOGIN GATE
========================= */
.hidden {
  display: none !important;
}

.login-gate {
  min-height: 100vh;
  width: 100%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at top left, rgba(79, 70, 229, 0.16), transparent 32%),
    linear-gradient(135deg, #f8fafc 0%, #eef2ff 45%, #f8fafc 100%);
  padding: 24px;
}

.login-card {
  width: min(440px, 100%);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
  padding: 28px;
}

.login-brand {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
}

.login-logo {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #4f46e5, #2563eb);
  color: #fff;
  font-weight: 900;
  font-size: 24px;
  box-shadow: 0 14px 30px rgba(79, 70, 229, 0.24);
}

.login-eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #4f46e5;
}

.login-brand h1 {
  margin: 4px 0 4px;
  font-size: 24px;
  color: #111827;
}

.login-brand p {
  margin: 0;
  color: #6b7280;
  font-size: 13px;
}

.login-form {
  display: grid;
  gap: 10px;
}

.login-form label {
  font-size: 12px;
  font-weight: 800;
  color: #374151;
  margin-top: 8px;
}

.login-form input {
  width: 100%;
  height: 44px;
  border: 1px solid #d1d5db;
  border-radius: 14px;
  padding: 0 14px;
  font-size: 14px;
  outline: none;
  background: #fff;
}

.login-form input:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.10);
}

.login-form button {
  margin-top: 14px;
  height: 46px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #4f46e5, #2563eb);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(79, 70, 229, 0.20);
}

.login-form button:hover {
  filter: brightness(0.98);
  transform: translateY(-1px);
}

.login-error {
  min-height: 18px;
  color: #dc2626;
  font-size: 12px;
  font-weight: 700;
  margin-top: 4px;
}

/* =========================
   TOAST NOTIFICATION
========================= */
.toast-container {
  position: fixed;
  right: 22px;
  bottom: 22px;
  display: grid;
  gap: 10px;
  width: min(380px, calc(100vw - 32px));
  z-index: 9999;
  pointer-events: none;
}

.toast {
  min-height: 46px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #dbe4ef;
  background: #fff;
  color: #172033;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.18);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
  white-space: pre-line;
  animation: toastIn 160ms ease-out;
  pointer-events: auto;
}

.toast-success {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.toast-error {
  border-color: #fecaca;
  background: #fff5f5;
  color: #b91c1c;
}

.toast-warning {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.toast-info {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.toast-hide {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

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

/* =========================
   SETTINGS / USER ACCESS
========================= */
.settings-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
  margin-top: 0;
}

.settings-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-top: 0;
  min-height: 540px;
  box-shadow: var(--shadow);
}

.settings-panel-head {
  min-height: 72px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-panel-head h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.settings-panel-head p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.user-list {
  padding: 10px;
  display: grid;
  gap: 8px;
}

.user-list-item {
  width: 100%;
  min-height: 68px;
  border: 1px solid #e3e9f4;
  background: #fff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 10px;
  cursor: pointer;
}

.user-list-item:hover,
.user-list-item.active {
  background: #eef5ff;
  border-color: #8bb7ff;
}

.user-list-avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #2864f0, #7b4df3);
  color: #fff;
  font-weight: 900;
}

.user-list-item b,
.user-list-item small,
.user-list-item em {
  display: block;
}

.user-list-item small {
  color: #475569;
  font-size: 12px;
  margin-top: 2px;
}

.user-list-item em {
  color: #64748b;
  font-size: 11px;
  font-style: normal;
  margin-top: 3px;
}

.permission-panel {
  overflow: hidden;
}

.permission-table-wrap {
  overflow: auto;
  max-height: 420px;
}

.permission-table th,
.permission-table td {
  text-align: center;
}

.permission-table th:first-child,
.permission-table td:first-child {
  text-align: left;
  min-width: 280px;
}

.permission-table td small {
  display: block;
  color: #64748b;
  font-size: 11px;
  margin-top: 2px;
}

.permission-table input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #2563eb;
  cursor: pointer;
}

.permission-panel .save-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.permission-message {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 700;
  color: #475569;
}

.permission-message.success {
  color: #15803d;
}

.permission-message.error {
  color: #b91c1c;
}

.empty-state {
  color: #64748b;
  font-size: 13px;
  padding: 16px;
}

.empty-state.error {
  color: #b91c1c;
}

@media (max-width: 900px) {
  .settings-layout {
    grid-template-columns: 1fr;
  }
}


/* === FINAL REFRESH + FLYOUT LAYER FIX v5 === */
.rail {
  z-index: 100000 !important;
}

.flyout,
#masterFlyout {
  z-index: 99999 !important;
  pointer-events: auto !important;
}

.app-shell {
  position: relative;
  z-index: 1;
}

.topbar {
  position: relative;
  z-index: 100;
}

.workspace,
.page,
.subpage,
.data-panel {
  position: relative;
  z-index: auto;
}

.toolbar,
.compact-toolbar {
  position: relative !important;
  z-index: 500 !important;
  pointer-events: auto !important;
}

.toolbar-left,
.toolbar-right {
  position: relative !important;
  z-index: 600 !important;
  pointer-events: auto !important;
}

.refresh-btn,
button[data-refresh-module],
#btnRefreshProjects,
#btnRefreshEmployees,
#btnRefreshMaterials,
#btnRefreshUsers {
  position: relative !important;
  z-index: 9000 !important;
  pointer-events: auto !important;
  cursor: pointer !important;
  min-width: 32px;
  min-height: 32px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}


/* === DOUBLE CLICK ROW EDIT CONCEPT === */
.master-data-row {
  cursor: pointer;
}

.master-data-row:hover td {
  background: #eef5ff !important;
}

.master-data-row.selected-row td {
  background: #dbeafe !important;
}

.danger-btn {
  height: 34px;
  border: 1px solid #fecaca;
  background: #fff5f5;
  color: #b91c1c;
  border-radius: 6px;
  padding: 0 16px;
  font-weight: 800;
  cursor: pointer;
}

.danger-btn:hover {
  background: #fee2e2;
  color: #991b1b;
}

.form-mode-note {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  margin-right: auto;
}


/* === MULTI SUB TAB UX === */
.subtab-row {
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: thin;
}

.project-form-tab {
  max-width: 210px;
  flex: 0 0 auto;
}

.project-form-tab .project-form-tab-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* === CUSTOM DELETE CONFIRMATION MODAL === */
.delete-modal {
  position: fixed;
  inset: 0;
  z-index: 200000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.delete-modal.hidden {
  display: none !important;
}

.delete-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.38);
  backdrop-filter: blur(2px);
}

.delete-modal-card {
  position: relative;
  width: min(460px, 100%);
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
  padding: 22px;
  animation: deleteModalIn 140ms ease-out;
}

.delete-modal-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: #fee2e2;
  color: #b91c1c;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 14px;
}

.delete-modal-content h3 {
  margin: 0 0 8px;
  color: #111827;
  font-size: 19px;
}

.delete-modal-content p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.55;
}

.delete-modal-data {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #fecaca;
  border-radius: 12px;
  background: #fff5f5;
  color: #991b1b;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
  white-space: pre-line;
}

.delete-modal-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.delete-modal-actions .danger-btn {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
}

.delete-modal-actions .danger-btn:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #ffffff;
}

@keyframes deleteModalIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* === MASTER EMPLOYEE FORM EXTENSION === */
.employee-master-form {
  min-height: 520px;
}

.employee-form-tabs {
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
}

.employee-form-section {
  display: none;
}

.employee-form-section.active {
  display: block;
}

.form-section-title {
  font-size: 14px;
  font-weight: 900;
  color: #172033;
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
}

.form-section-title.secondary {
  margin-top: 22px;
}

.full-row {
  grid-column: 1 / -1;
}

.field-label {
  font-size: 13px;
  color: #172033;
  font-weight: 650;
  margin-bottom: 6px;
}

.compact-form textarea {
  display: block;
  width: 100%;
  min-height: 72px;
  border: 1px solid #b9c5d6;
  border-radius: 6px;
  margin-top: 5px;
  padding: 8px 9px;
  outline: none;
  resize: vertical;
  font-family: inherit;
}

.compact-form input[type="checkbox"] {
  width: auto;
  height: auto;
  margin: 0 8px 0 0;
}

.checkbox-card {
  min-height: 32px;
  border: 1px solid #d8e0ec;
  border-radius: 6px;
  background: #f8fafc;
  padding: 8px 10px;
  display: flex !important;
  align-items: center;
  gap: 4px;
  margin-top: 18px;
}

.checkbox-card.strong {
  margin-top: 0;
  font-weight: 900;
  background: #eef6ff;
  border-color: #bfdbfe;
}

.checkbox-group {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 8px;
}

.checkbox-group label {
  border: 1px solid #d8e0ec;
  border-radius: 6px;
  background: #f8fafc;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nonaktif-card {
  border: 1px solid #d8e0ec;
  border-radius: 10px;
  padding: 14px;
  background: #fbfdff;
  margin-bottom: 18px;
}

.nonaktif-detail {
  margin-top: 14px;
}

.form-helper {
  margin: 8px 0 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 650;
}

@media (max-width: 980px) {
  .checkbox-group {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 680px) {
  .checkbox-group {
    grid-template-columns: 1fr;
  }
}

.import-report {
  margin: 10px 0 12px;
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  font-size: 13px;
}

.import-report-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.import-report-meta {
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
}

.import-report-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(90px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.import-report-grid > div {
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #ffffff;
}

.import-report-grid span {
  display: block;
  margin-bottom: 2px;
  color: #64748b;
  font-size: 11px;
}

.import-report-grid strong {
  font-size: 16px;
}

.import-report-ok {
  color: #166534;
  font-weight: 600;
}

.import-report-errors {
  color: #991b1b;
}

.import-report-rules {
  margin-top: 8px;
  color: #334155;
}

.import-report-errors ul,
.import-report-rules ul {
  margin: 6px 0 0 18px;
  padding: 0;
}

@media (max-width: 900px) {
  .import-report-grid {
    grid-template-columns: repeat(2, minmax(90px, 1fr));
  }
}

.data-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 4px 0;
}

.data-pager-info {
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
}

.data-pager-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Standard index filter/export controls */
.table-filter-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  white-space: nowrap;
}

.table-filter-select {
  height: 32px;
  min-width: 96px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  padding: 0 8px;
  font-size: 12px;
  color: #111827;
}

.export-dropdown {
  position: relative;
  display: inline-flex;
}

.export-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 50;
  min-width: 130px;
  padding: 6px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.16);
}

.export-menu button {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 8px 10px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: #1f2937;
  cursor: pointer;
}

.export-menu button:hover {
  background: #f1f5f9;
}

.toolbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}


/* === STEP 12 TOOLBAR CLICK FIX ===
   Empty flex area from right-side toolbar controls can overlap left buttons on wide screens.
   Keep actual controls clickable, but make empty toolbar space ignore pointer events. */
.toolbar,
.compact-toolbar {
  position: relative !important;
  z-index: 1200 !important;
  overflow: visible !important;
  isolation: isolate;
}

.toolbar-left {
  flex: 0 0 auto !important;
  position: relative !important;
  z-index: 1300 !important;
  pointer-events: auto !important;
}

.toolbar-right {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  position: relative !important;
  z-index: 1200 !important;
  pointer-events: none !important;
}

.toolbar-right > *,
.toolbar-right input,
.toolbar-right select,
.toolbar-right button,
.toolbar-right label {
  pointer-events: auto !important;
}

.data-panel {
  position: relative !important;
  z-index: 1 !important;
}

.refresh-btn,
button[data-refresh-module],
#btnRefreshProjects,
#btnRefreshEmployees,
#btnRefreshMaterials,
#btnRefreshUsers {
  position: relative !important;
  z-index: 1400 !important;
  pointer-events: auto !important;
  touch-action: manipulation;
}


.table-loading-row {
  padding: 18px !important;
  color: #6b7280;
  font-weight: 700;
  text-align: center;
  background: #f9fafb;
}

.table-empty-row {
  padding: 16px;
  text-align: center;
  color: #64748b;
  background: #f8fafc;
}

/* Table column personalization */
.column-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
  z-index: 25;
}

.column-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 230px;
  max-height: 320px;
  overflow: auto;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
  padding: 8px;
  z-index: 80;
}

.column-menu-title {
  font-weight: 700;
  font-size: 12px;
  color: #0f172a;
  padding: 4px 4px 8px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 4px;
}

.column-menu-list {
  display: grid;
  gap: 2px;
}

.column-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  color: #1e293b;
}

.column-menu-item:hover {
  background: #f1f5f9;
}

.column-menu-item input {
  width: 14px;
  height: 14px;
  margin: 0;
}

.column-menu-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
  margin-top: 6px;
}

.small-btn {
  padding: 5px 8px;
  min-height: 26px;
  font-size: 11px;
}


.table-header-draggable {
  cursor: grab;
  user-select: none;
  position: relative;
}

.table-header-draggable:active {
  cursor: grabbing;
}

.table-header-draggable.dragging {
  opacity: 0.55;
}

.table-header-draggable.drag-over {
  outline: 2px dashed #2563eb;
  outline-offset: -3px;
  background: rgba(37, 99, 235, 0.08);
}

.table-header-sortable {
  user-select: none;
}

.table-header-sortable span:first-child {
  pointer-events: none;
}

.table-sort-indicator {
  margin-left: 4px;
  font-size: 10px;
  opacity: 0.85;
  pointer-events: none;
}

.table-header-sortable.sorted {
  background: #475569;
}


.table-header-resizable {
  padding-right: 18px;
  position: sticky;
}

.table-header-resizable > span:first-child {
  display: inline-block;
  max-width: calc(100% - 18px);
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.column-resize-handle {
  position: absolute;
  top: 0;
  right: -4px;
  width: 10px;
  height: 100%;
  cursor: col-resize;
  z-index: 4;
  user-select: none;
}

.column-resize-handle::after {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 3px;
  width: 1px;
  background: rgba(255, 255, 255, 0.25);
}

.column-resize-handle:hover::after,
.table-header-resizable.resizing .column-resize-handle::after {
  background: rgba(255, 255, 255, 0.85);
}

body.is-column-resizing,
body.is-column-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

/* === STEP 16B - Project table column key resize fix === */
/* Override legacy nth-child project-table rules so dynamic columns stay aligned. */
#tableProyek th[data-column-key],
#tableProyek td[data-column-key] {
  display: table-cell !important;
}

#tableProyek th[data-column-key="level"],
#tableProyek td[data-column-key="level"],
#tableProyek th[data-column-key="parent_project_code"],
#tableProyek td[data-column-key="parent_project_code"] {
  display: table-cell !important;
}

#tableProyek td[data-column-key] {
  font-weight: inherit;
  color: inherit;
}

#tableProyek tbody tr.project-level-row td[data-column-key],
#tableProyek tbody tr.project-level-row td[data-column-key] *,
#tableProyek tbody tr.project-level-row td[data-column-key] div,
#tableProyek tbody tr.project-level-row td[data-column-key] span {
  font-weight: 700 !important;
}

#tableProyek tbody tr.project-sub-row td[data-column-key],
#tableProyek tbody tr.project-sub-row td[data-column-key] *,
#tableProyek tbody tr.project-sub-row td[data-column-key] div,
#tableProyek tbody tr.project-sub-row td[data-column-key] span {
  font-weight: 400 !important;
}

#tableProyek tbody tr.project-sub-row td[data-column-key="kode"],
#tableProyek tbody tr.project-sub-row td[data-column-key="nama_proyek"],
#tableProyek tbody tr.project-sub-row td[data-column-key="nama_proyek_dalam_kontrak"] {
  font-weight: 500 !important;
}

#tableProyek tbody td[data-column-key="nama_proyek_dalam_kontrak"] {
  color: #334155;
}

#tableProyek tbody td[data-column-key="status_proyek"] span.project-status-badge {
  font-family: "Segoe UI", Inter, Arial, sans-serif !important;
  font-size: 11px;
  font-weight: 700 !important;
  opacity: 0.85;
}

/* ===== HR / PLACEHOLDER MODULE ===== */
.purple .flyout-icon { background: #7c3aed; }

#btnHR {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.module-subtitle {
  margin-top: 4px;
  color: #64748b;
  font-size: 13px;
}

.placeholder-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
  border-radius: 16px;
  color: #334155;
}

.placeholder-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  color: #0f172a;
}

.placeholder-card p {
  margin: 0;
  line-height: 1.6;
  font-size: 13px;
  color: #64748b;
}

.placeholder-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #ede9fe;
  color: #6d28d9;
  font-weight: 800;
  flex: 0 0 auto;
}

/* Step 18C - HR Gaji Harian Lepas Grade */
.hr-grade-table th,
.hr-grade-table td {
  white-space: nowrap;
}

.hr-grade-table td.number-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.hr-category-badge,
.hr-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.hr-category-badge.badge-gaji {
  background: #e8f1ff;
  color: #1d4ed8;
}

.hr-category-badge.badge-tunjangan {
  background: #f3e8ff;
  color: #7e22ce;
}

.hr-status-badge.status-active {
  background: #dcfce7;
  color: #15803d;
}

.hr-status-badge.status-inactive {
  background: #f1f5f9;
  color: #64748b;
}

.hr-grade-table tr.row-muted td {
  color: #94a3b8;
  background: #f8fafc;
}

.wide-modal-card {
  width: min(920px, calc(100vw - 36px));
  max-width: 920px;
}

.hr-grade-modal-card {
  max-height: calc(100vh - 72px);
  overflow: auto;
}

.modal-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.modal-card-head h3 {
  margin: 0;
  font-size: 18px;
  color: #0f172a;
}

.modal-card-head p {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 13px;
}

.hr-grade-form {
  margin-top: 8px;
}

.message-error {
  color: #b91c1c;
}

.message-success {
  color: #15803d;
}

.message-info {
  color: #64748b;
}

/* HR Daily Worker Salary - input gaji/tunjangan */
.hr-salary-table th,
.hr-salary-table td {
  white-space: nowrap;
}

.hr-input-modal-card {
  max-width: 980px;
}

.hr-input-pane {
  display: none;
}

.hr-input-pane.active {
  display: block;
}

.status-warning {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
}

/* Step 18F - Daily worker history modal and stable flyout actions */
.table-action-cell {
  white-space: nowrap;
  text-align: center;
}

.mini-action-btn {
  padding: 6px 10px;
  font-size: 12px;
  min-height: 28px;
}

.hr-history-modal-card {
  width: min(1180px, calc(100vw - 56px));
  max-height: calc(100vh - 72px);
  overflow: auto;
}

.history-panel {
  max-height: 58vh;
  overflow: auto;
}

.hr-history-table th,
.hr-history-table td {
  white-space: nowrap;
}

.hr-history-table td:last-child {
  white-space: normal;
  min-width: 180px;
}

/* Step 18G - HR Harian Lepas internal navigation */
.hr-workspace-shell {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  width: 100%;
  overflow: visible;
}

.hr-workspace-sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  padding: 12px 8px;
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
  min-height: 160px;
  position: relative;
  z-index: 80;
  overflow: visible;
}

.hr-workspace-icon-btn {
  width: 38px;
  height: 38px;
  border: 1px solid #d8e0ec;
  border-radius: 12px;
  background: #f8fafc;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  cursor: pointer;
  transition: 0.18s ease;
  position: relative;
}

.hr-workspace-icon-btn:hover {
  background: #eef2ff;
  border-color: #c4b5fd;
  transform: translateY(-1px);
}

.hr-workspace-icon-btn.active {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #ffffff;
  box-shadow: 0 10px 18px rgba(79, 70, 229, 0.22);
}

.hr-workspace-icon-btn::after {
  content: attr(title);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  padding: 6px 9px;
  border-radius: 8px;
  background: #0f172a;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: 0.15s ease;
  z-index: 99999;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.25);
}

.hr-workspace-icon-btn:hover::after {
  opacity: 1;
}

.hr-workspace-content {
  min-width: 0;
}

.hr-internal-tabs {
  margin-top: 0;
}

@media (max-width: 760px) {
  .hr-workspace-shell {
    grid-template-columns: 1fr;
  }

  .hr-workspace-sidebar {
    flex-direction: row;
    min-height: auto;
    justify-content: flex-start;
  }

  .hr-workspace-icon-btn::after {
    left: 50%;
    top: calc(100% + 8px);
    transform: translateX(-50%);
  }
}


/* Step 18G-2 - HR Harian Lepas internal navigation polish */
.hr-internal-tabs {
  min-height: 42px;
  align-items: flex-end;
}

.hr-internal-tabs .subtab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.subtab-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  color: #64748b;
  font-size: 14px;
  line-height: 1;
}

.subtab-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.hr-empty-subpage.active {
  display: block;
}

.empty-state-card {
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
  padding: 28px;
  color: #475569;
}

.empty-state-card h3 {
  margin: 0 0 6px;
  color: #0f172a;
}

.empty-state-card p {
  margin: 0;
}

.empty-state-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: #ede9fe;
  color: #5b21b6;
  font-weight: 800;
  margin-bottom: 12px;
}

/* Step 18G-3 - Fix HR Harian Lepas sidebar tooltip layering */
.hr-workspace-shell,
.hr-workspace-sidebar,
.hr-workspace-content,
.hr-page-body,
.hr-daily-worker-page,
.hr-subpage,
.hr-section,
.hr-table-wrap {
  overflow: visible;
}

.hr-workspace-shell {
  position: relative;
  z-index: 1;
  isolation: isolate;
}

.hr-workspace-sidebar {
  position: relative;
  z-index: 10000;
}

.hr-workspace-content {
  position: relative;
  z-index: 1;
}

.hr-workspace-icon-btn {
  position: relative;
  z-index: 10001;
}

.hr-workspace-icon-btn::after {
  z-index: 10002;
  left: calc(100% + 14px);
}

.hr-workspace-icon-btn:hover,
.hr-workspace-icon-btn:hover::after {
  z-index: 10003;
}

/* Step 18G-4 - Use native browser tooltip only for Harian Lepas sidebar icons */
.hr-workspace-icon-btn::after,
.hr-workspace-icon-btn:hover::after {
  content: none !important;
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

/* Step 18H - Daily Worker Salary polish */
.text-truncate {
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-danger {
  background: #fee2e2;
  color: #991b1b;
}

.project-picker-search {
  width: 100%;
  margin-top: 6px;
  margin-bottom: 8px;
}

.project-picker-list {
  max-height: 170px;
  overflow-y: auto;
  border: 1px solid #d8e1ec;
  border-radius: 8px;
  background: #fff;
  padding: 6px;
}

.project-picker-option {
  display: flex !important;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
}

.project-picker-option:hover {
  background: #f1f5f9;
}

.project-picker-option input {
  width: auto !important;
  min-width: 16px;
}

.project-picker-empty {
  padding: 10px;
  color: #64748b;
  font-size: 13px;
}

.hr-history-table th:last-child,
.hr-history-table td:last-child {
  width: 84px;
  text-align: center;
}

/* Step 18I - Gaji Harian Lepas UI fixes */
.hr-salary-table th,
.hr-salary-table td {
  white-space: nowrap;
}

.hr-salary-table .text-truncate {
  max-width: 240px;
}

.hr-salary-pager {
  padding: 10px 8px 4px;
  border-left: 1px solid #e5edf6;
  border-right: 1px solid #e5edf6;
  border-bottom: 1px solid #e5edf6;
  background: #fff;
}

.hr-history-table th:first-child,
.hr-history-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
  background: #fff;
  width: 76px;
  min-width: 76px;
  text-align: center;
}

.hr-history-table th:first-child {
  background: #566b82;
  z-index: 4;
}

.hr-history-table th:last-child,
.hr-history-table td:last-child {
  width: auto;
  min-width: 180px;
  text-align: left;
}

.project-picker-list {
  max-height: 220px;
}

.project-picker-option span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Step 18J - Daily Worker salary UX fix */
.pager-size-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}

.pager-size-select {
  min-width: 76px;
  height: 34px;
  padding: 4px 8px;
}

.project-chip-box {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 38px;
  padding: 7px;
  margin-top: 6px;
  border: 1px solid #d8e1ec;
  border-radius: 8px;
  background: #f8fafc;
}

.project-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #e8f0ff;
  color: #1e3a8a;
  font-weight: 700;
  font-size: 12px;
}

.project-chip button {
  border: 0;
  background: transparent;
  color: #475569;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 1px;
}

.project-chip button:hover {
  color: #dc2626;
}

.project-chip-empty {
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  align-self: center;
}

.project-picker-combobox {
  position: relative;
  margin-top: 8px;
}

.project-picker-search {
  width: 100%;
  margin: 0;
}

.project-picker-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 12000;
  max-height: 230px;
  overflow-y: auto;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  padding: 4px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.18);
}

.project-picker-option {
  width: 100%;
  display: flex !important;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  font-weight: 700;
  color: #0f172a;
}

.project-picker-option:hover {
  background: #eef4ff;
}

.project-picker-empty {
  padding: 10px;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
}

.hr-history-table .mini-action-btn {
  min-width: 58px;
  height: 30px;
  padding: 4px 8px;
  cursor: pointer;
  pointer-events: auto;
}

/* Step 18K - Daily Worker salary toolbar, split input, and column customization */
.salary-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.toolbar-pager-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.toolbar-pager-inline .data-pager-info {
  min-width: 104px;
  text-align: center;
}

.secondary-action {
  background: #eef4ff !important;
  color: #1d4ed8 !important;
  border: 1px solid #c7d7fe !important;
}

.hr-input-modal-card.single-pane-mode #dailyWorkerInputTabs {
  display: none;
}

.hr-salary-table {
  table-layout: fixed;
  min-width: max-content;
}

.hr-salary-table th {
  position: relative;
  user-select: none;
}

.hr-salary-table th[draggable="true"] {
  cursor: grab;
}

.hr-salary-table th[draggable="true"]:active {
  cursor: grabbing;
}

.hr-salary-table th,
.hr-salary-table td {
  overflow: hidden;
  text-overflow: ellipsis;
}

.column-resize-handle {
  position: absolute;
  top: 0;
  right: -3px;
  width: 7px;
  height: 100%;
  cursor: col-resize;
  z-index: 5;
}

.column-resize-handle:hover {
  background: rgba(37, 99, 235, 0.25);
}

body.is-resizing-column {
  cursor: col-resize !important;
  user-select: none;
}

.column-menu {
  min-width: 220px;
  max-height: 420px;
  overflow-y: auto;
}

.column-menu-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 6px 0;
}

.column-menu > button {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 700;
  color: #1d4ed8;
}

.column-menu > button:hover {
  background: #eef4ff;
}

@media (max-width: 1100px) {
  .salary-toolbar-right {
    justify-content: flex-start;
  }
  .toolbar-pager-inline {
    width: 100%;
    justify-content: flex-start;
  }
}

/* Step 18L - Daily Worker salary paging placement and allowance type dropdown */
.top-page-size-label {
  margin-left: 4px;
}

#dailyWorkerSalaryBottomPager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#dailyWorkerSalaryBottomPager .data-pager-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#dailyWorkerAllowanceJenis {
  width: 100%;
}

/* Step 18N - latest-only history actions and ellipsis fix */
.hr-history-table th:first-child,
.hr-history-table td:first-child {
  width: 132px;
  min-width: 132px;
  max-width: 132px;
}

.hr-history-table th:nth-child(9),
.hr-history-table td:nth-child(9) {
  width: 96px;
  min-width: 96px;
  text-align: center;
  overflow: visible;
  white-space: nowrap;
}

.hr-history-table .hr-status-badge,
.hr-grade-table .hr-status-badge,
.hr-salary-table .hr-status-badge {
  min-width: 72px;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.history-action-cell {
  overflow: visible !important;
  text-overflow: clip !important;
}

.history-action-stack {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 112px;
  white-space: nowrap;
}

.history-action-stack .mini-action-btn {
  min-width: 52px;
  width: auto;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.muted-action-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.import-report-title {
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
}

.import-report-grid > span {
  display: block;
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #ffffff;
  color: #475569;
}

.import-report-note {
  margin-top: 8px;
  color: #334155;
}

.import-report-note ul {
  margin: 6px 0 0 18px;
  padding: 0;
}


/* Step 18V - isolated project badge fix and grade table customization */
#tableProyek thead th {
  z-index: 20 !important;
}

#tableProyek tbody td[data-column-key="status_proyek"],
#tableProyek tbody td[data-column-key="status_penagihan"] {
  overflow: hidden !important;
  text-overflow: clip !important;
  vertical-align: middle;
}

#tableProyek .project-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 96px;
  height: 22px;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  vertical-align: middle;
  position: relative;
  z-index: 1;
}

#tableDailyWorkerGrade {
  table-layout: fixed;
  width: max-content;
  min-width: 100%;
}

#tableDailyWorkerGrade th[data-column-key] {
  position: sticky;
  top: 0;
  z-index: 12;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  user-select: none;
}

#tableDailyWorkerGrade td[data-column-key] {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: none;
}

#tableDailyWorkerGrade td.badge-cell {
  overflow: hidden;
  text-overflow: clip;
  text-align: center;
}

#tableDailyWorkerGrade .hr-category-badge,
#tableDailyWorkerGrade .hr-status-badge {
  max-width: calc(100% - 8px);
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
  vertical-align: middle;
}

#tableDailyWorkerGrade .column-resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  z-index: 2;
}

/* Step 18W - isolated grade/salary table interaction fixes */
#tableDailyWorkerGrade,
#tableDailyWorkerSalaryList {
  table-layout: fixed !important;
  width: max-content;
  min-width: 100%;
}

#tableDailyWorkerGrade th.table-header-draggable,
#tableDailyWorkerSalaryList th.table-header-draggable {
  cursor: grab !important;
  position: sticky;
  top: 0;
  z-index: 18;
  user-select: none;
  overflow: hidden;
  white-space: nowrap;
}

#tableDailyWorkerGrade th.table-header-draggable:active,
#tableDailyWorkerSalaryList th.table-header-draggable:active,
#tableDailyWorkerGrade th.table-header-draggable.dragging,
#tableDailyWorkerSalaryList th.table-header-draggable.dragging {
  cursor: grabbing !important;
}

#tableDailyWorkerGrade th.table-header-sortable > span:first-child,
#tableDailyWorkerSalaryList th.table-header-sortable > span:first-child {
  display: inline-block;
  max-width: calc(100% - 34px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

#tableDailyWorkerGrade .table-sort-indicator,
#tableDailyWorkerSalaryList .table-sort-indicator {
  display: inline-block;
  width: 18px;
  margin-left: 2px;
  font-size: 10px;
  opacity: 0.9;
  vertical-align: middle;
}

#tableDailyWorkerGrade th.drag-over,
#tableDailyWorkerSalaryList th.drag-over {
  outline: 2px dashed #2563eb;
  outline-offset: -3px;
}

#tableDailyWorkerGrade td[data-column-key],
#tableDailyWorkerSalaryList td[data-column-key] {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

#tableDailyWorkerGrade .column-resize-handle,
#tableDailyWorkerSalaryList .column-resize-handle {
  position: absolute;
  top: 0;
  right: -4px;
  width: 10px;
  height: 100%;
  cursor: col-resize !important;
  z-index: 6;
}


/* Step 18W-2 - fixed-width resize isolation for HR daily worker tables */
#tableDailyWorkerGrade.hr-grade-table,
#tableDailyWorkerSalaryList.hr-salary-table {
  table-layout: fixed !important;
  width: max-content;
  min-width: max-content;
  max-width: none;
}

#tableDailyWorkerGrade.hr-grade-table col,
#tableDailyWorkerSalaryList.hr-salary-table col {
  box-sizing: border-box;
}

#tableDailyWorkerGrade.hr-grade-table th[data-column-key],
#tableDailyWorkerGrade.hr-grade-table td[data-column-key],
#tableDailyWorkerSalaryList.hr-salary-table th[data-column-key],
#tableDailyWorkerSalaryList.hr-salary-table td[data-column-key] {
  box-sizing: border-box;
  flex: none !important;
}

#tableDailyWorkerGrade.hr-grade-table .column-resize-handle,
#tableDailyWorkerSalaryList.hr-salary-table .column-resize-handle {
  right: -5px;
  width: 10px;
  cursor: col-resize !important;
  touch-action: none;
}

/* Step 18Y - HR Pembawa master insentif */
.hr-referrer-table th,
.hr-referrer-table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hr-referrer-table .action-cell {
  min-width: 150px;
  overflow: visible;
}

.hr-referrer-table .small-btn {
  padding: 6px 10px;
  font-size: 12px;
  margin-right: 6px;
}


/* Step 20A - Absensi Harian Lepas foundation */
.hr-attendance-workspace-shell .hr-workspace-sidebar {
  min-height: 250px;
}

.attendance-placeholder-card {
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
  padding: 22px;
  color: #475569;
}

.attendance-placeholder-card h3 {
  margin: 0 0 8px;
  color: #0f172a;
  font-size: 18px;
}

.attendance-placeholder-card p {
  margin: 0;
  color: #64748b;
  line-height: 1.55;
  max-width: 820px;
}

.placeholder-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.attendance-flow-note {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #334155;
  font-size: 13px;
}

/* Step 20B-4 - Pekerja Mobile form layout */
.hr-mobile-modal-card {
  width: min(620px, calc(100vw - 36px));
  max-width: 620px;
}

.hr-mobile-form {
  max-width: none;
  margin-top: 8px;
  gap: 14px 18px;
}

.hr-mobile-form .full-row {
  grid-column: 1 / -1;
}

.hr-mobile-form textarea {
  display: block;
  width: 100%;
  min-height: 82px;
  margin-top: 6px;
  border: 1px solid #bac6d5;
  border-radius: 4px;
  padding: 9px 10px;
  background: #fff;
  font-size: 13px;
  resize: vertical;
  font-family: inherit;
}

.hr-mobile-form textarea:focus {
  outline: 2px solid #cfe0ff;
  border-color: #4e83f4;
}


.hr-mobile-form input[list] {
  display: block;
  width: 100%;
  margin-top: 6px;
  border: 1px solid #bac6d5;
  border-radius: 4px;
  padding: 9px 10px;
  background: #fff;
  font-size: 13px;
  font-family: inherit;
}

.hr-mobile-form input[list]:focus {
  outline: 2px solid #cfe0ff;
  border-color: #4e83f4;
}

.hr-mobile-form .field-hint {
  display: block;
  margin-top: 5px;
  color: #64748b;
  font-size: 11px;
  font-weight: 500;
}

@media (max-width: 720px) {
  .hr-mobile-form {
    grid-template-columns: 1fr;
  }
}

/* Step 20C - Upload Raw Hadirr */
.attendance-upload-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 16px;
  margin-bottom: 16px;
}

.attendance-upload-card,
.attendance-summary-card,
.attendance-panel {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #ffffff;
  padding: 16px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.attendance-upload-card h3,
.attendance-summary-card h3,
.attendance-panel h3 {
  margin: 0 0 8px;
  color: #0f172a;
  font-size: 17px;
}

.attendance-upload-card p,
.attendance-panel p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
}

.attendance-upload-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.attendance-upload-form input[type="file"] {
  min-width: 260px;
  max-width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 8px;
  background: #f8fafc;
}

.attendance-message {
  margin-top: 10px;
}

.attendance-message.success { color: #15803d; }
.attendance-message.warning { color: #b45309; }
.attendance-message.error { color: #b91c1c; }
.attendance-message.info { color: #2563eb; }

.attendance-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.attendance-summary-item {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 12px;
  background: #f8fafc;
}

.attendance-summary-item span {
  display: block;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.attendance-summary-item strong {
  display: block;
  margin-top: 4px;
  color: #0f172a;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attendance-panel {
  margin-top: 16px;
}

.panel-header-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.attendance-filter-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.attendance-filter-row input {
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 13px;
}

.attendance-import-table th,
.attendance-import-table td,
.attendance-staging-table th,
.attendance-staging-table td {
  white-space: nowrap;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attendance-import-table tbody tr {
  cursor: pointer;
}

.attendance-import-table tbody tr:hover,
.attendance-import-table tbody tr.selected-row {
  background: #eff6ff;
}

@media (max-width: 980px) {
  .attendance-upload-grid {
    grid-template-columns: 1fr;
  }

  .panel-header-row {
    flex-direction: column;
  }

  .attendance-filter-row {
    justify-content: flex-start;
    width: 100%;
  }
}

/* Step 20D - Cleaning Case */
.cleaning-case-only-action {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #334155;
  white-space: nowrap;
}

/* Prev/Next + info halaman diposisikan ke pojok kanan bawah panel (dikonfirmasi
   user 7 Jul 2026), sama seperti pola pagination di tabel Upload Raw Absen. */
.cleaning-case-pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

/* Tabel Cleaning Case sekarang pakai pola generik yang sama dengan tabel
   Gaji Harian Lepas / Grade (resize, sort, drag kolom, filter kolom) - lihat
   .table-header-draggable / .table-header-sortable / .table-header-resizable /
   .column-resize-handle / .column-menu di bagian atas file ini.
   .cleaning-case-scroll meniru pola .attendance-staging-scroll (scroll
   horizontal, lebar tabel dikunci lewat JS sesuai total lebar kolom) - fix
   untuk "tabel over". Header tetap ikut .data-table th (position: sticky,
   #5b7189 / putih) - JANGAN dioverride manual - fix untuk "judul tabel
   nyangkut" (sebelumnya wrapper .table-scroll polos tanpa CSS sama sekali). */
.cleaning-case-scroll {
  overflow: auto;
  max-width: 100%;
}

.cleaning-case-kendala {
  color: #b45309;
  font-weight: 600;
}

.cleaning-case-row-action td.cleaning-case-kendala {
  color: #b91c1c;
}

.cleaning-case-row-auto td.cleaning-case-kendala {
  color: #64748b;
  font-weight: 500;
}
