:root {
  --xl-green: #0f6b4b;
  --xl-green-dark: #064e3b;
  --xl-green-light: #e6f4ea;
  --xl-ribbon: #f4f7f9;
  --xl-border: #d4dce3;
  --xl-header-bg: #f1f5f9;
  --xl-header-active: #d1fae5;
  --xl-text: #0f172a;
  --font-ui: 'Times New Roman', Times, serif;
  --font-main: 'Times New Roman', Times, serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-ui);
  font-size: 13.5px;
  color: var(--xl-text);
  background: #e9eff5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
input,
select,
textarea {
  font-family: var(--font-main);
}

.hidden {
  display: none !important;
}

.excel-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  max-width: 100vw;
  overflow: hidden;
}

/* 1. FUTURISTIC DEEP EMERALD-GLASS HEADER & FLOATING PILL TABS */
.xl-header {
  position: relative;
  background:
    radial-gradient(ellipse 60% 130% at 15% -20%, rgba(16, 185, 129, 0.32), transparent 65%),
    radial-gradient(ellipse 50% 120% at 88% -15%, rgba(6, 182, 212, 0.24), transparent 65%),
    linear-gradient(135deg, #04221a 0%, #093c2e 42%, #0e543f 78%, #07332a 100%);
  color: #ffffff;
  font-family: var(--font-ui);
  flex-shrink: 0;
  user-select: none;
  box-shadow:
    inset 0 -1px 0 rgba(52, 211, 153, 0.28),
    0 4px 18px rgba(4, 34, 26, 0.22);
}

.xl-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 7px clamp(10px, 1.4vw, 18px) 4px;
}

.xl-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.xl-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  color: #ffffff;
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 15px;
  border-radius: 8px;
  flex-shrink: 0;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.35),
    0 3px 10px rgba(16, 185, 129, 0.45);
}

.xl-title {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: clamp(13.5px, 1.15vw, 15.5px);
  line-height: 1.48;
  padding: 2px 0;
  letter-spacing: 0.2px;
  color: #f0fdf4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.xl-title-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.xl-btn-drive {
  background: rgba(255, 255, 255, 0.1);
  color: #ecfdf5;
  border: 1px solid rgba(110, 231, 183, 0.35);
  border-radius: 999px;
  padding: 5px 14px;
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}

.xl-btn-drive:hover:not(:disabled) {
  background: rgba(16, 185, 129, 0.25);
  border-color: rgba(110, 231, 183, 0.7);
  color: #ffffff;
}

.xl-btn-drive.connected {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #064e3b;
  border-color: #6ee7b7;
}

.xl-btn-drive.connected:hover:not(:disabled) {
  background: #a7f3d0;
}

.xl-btn-drive:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.xl-btn-gear {
  background: rgba(255, 255, 255, 0.1);
  color: #d1fae5;
  border: 1px solid rgba(110, 231, 183, 0.32);
  border-radius: 999px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.xl-btn-gear:hover {
  background: rgba(16, 185, 129, 0.25);
  color: #ffffff;
}

.xl-btn-export {
  background: linear-gradient(135deg, #ffffff 0%, #ecfdf5 100%);
  color: #065f46;
  border: 1px solid rgba(167, 243, 208, 0.9);
  border-radius: 999px;
  padding: 5px 15px;
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.16);
}

.xl-btn-export:hover:not(:disabled) {
  background: #ffffff;
  color: #047857;
}

.xl-btn-export:active:not(:disabled) {
  transform: translateY(1px);
}

.xl-btn-export:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

/* Futuristic Floating Glass Pill Dock for the 7 Main Tabs */
.xl-main-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 5px;
  width: fit-content;
  max-width: calc(100% - 16px);
  margin: 2px auto 8px;
  padding: 4px 6px;
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(110, 231, 183, 0.22);
  border-radius: 14px;
  backdrop-filter: blur(12px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 4px 14px rgba(0, 0, 0, 0.18);
}

.xl-main-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 0 1 auto;
  min-width: 0;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(236, 253, 245, 0.88);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 6px clamp(9px, 1vw, 15px);
  font-family: var(--font-ui);
  font-size: clamp(12.5px, 1vw, 14px);
  line-height: 1.45;
  font-weight: 600;
  letter-spacing: 0.1px;
  text-align: center;
  cursor: pointer;
  white-space: nowrap;
}

.xl-main-tab .tab-ico {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  opacity: 0.85;
  transition: transform 0.2s ease, opacity 0.2s ease, color 0.2s ease;
}

.xl-main-tab .tab-label {
  display: inline-block;
  line-height: 1.48;
  padding: 1px 0;
}

.xl-main-tab:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.xl-main-tab:hover .tab-ico {
  opacity: 1;
  transform: scale(1.08);
}

.xl-main-tab.active {
  background: linear-gradient(180deg, #ffffff 0%, #ecfdf5 100%);
  color: #065f46;
  font-weight: 700;
  border-color: rgba(110, 231, 183, 0.75);
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.24),
    0 0 14px rgba(16, 185, 129, 0.32);
}

.xl-main-tab.active .tab-ico {
  color: #059669;
  opacity: 1;
}

.xl-main-tab.active::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 2px;
  transform: translateX(-50%);
  width: 24px;
  height: 2.5px;
  border-radius: 999px;
  background: linear-gradient(90deg, #10b981, #06b6d4);
  pointer-events: none;
}

/* 2. COMPACT RIBBON (FROSTED MODERN BAR) */
.xl-ribbon {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid #d7e0e8;
  padding: 7px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px 14px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.ribbon-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.ribbon-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ribbon-label {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  white-space: nowrap;
}

.ribbon-select {
  height: 32px;
  padding: 0 11px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.ribbon-select:focus {
  outline: 2px solid #86efac;
  border-color: var(--xl-green);
}

.ribbon-select-wide {
  min-width: 230px;
}

.ribbon-sep {
  width: 1px;
  height: 20px;
  background: #cbd5e1;
}

.ribbon-btns {
  gap: 6px;
}

.actual-readonly-badge {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #ffffff;
  color: #334155;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.ribbon-btn {
  height: 32px;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #1e293b;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.ribbon-btn:hover:not(:disabled) {
  background: #e6f4ea;
  border-color: var(--xl-green);
  color: var(--xl-green-dark);
}

.ribbon-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ribbon-btn-copy {
  background: var(--xl-green);
  color: #ffffff;
  border-color: var(--xl-green-dark);
}

.ribbon-btn-copy:hover:not(:disabled) {
  background: var(--xl-green-dark);
  color: #ffffff;
}

/* Lịch Trực Excel Editing Toolbar */
.truc-new-btn {
  background: #e6f4ea;
  color: var(--xl-green-dark);
  border-color: var(--xl-green);
}

.truc-new-btn:hover:not(:disabled) {
  background: var(--xl-green);
  color: #ffffff;
}

.truc-del-btn {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fca5a5;
}

.truc-del-btn:hover:not(:disabled) {
  background: #dc2626;
  color: #ffffff;
  border-color: #b91c1c;
}

.truc-date-wrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #ffffff;
  border: 1px solid #9ec5ae;
  border-radius: 4px;
  padding: 0 7px;
  height: 30px;
}

.truc-date-wrap:focus-within {
  border-color: var(--xl-green);
  box-shadow: 0 0 0 2px rgba(33, 115, 70, 0.2);
}

.truc-date-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--xl-green-dark);
  white-space: nowrap;
  cursor: pointer;
}

.truc-date-input {
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-main);
  font-size: 13.5px;
  font-weight: 700;
  color: #111111;
  height: 26px;
  cursor: pointer;
}

.truc-controls {
  gap: 6px;
  flex-wrap: wrap;
}

.truc-save-btn {
  background: var(--xl-green);
  color: #ffffff;
  border-color: var(--xl-green-dark);
}

.truc-save-btn:hover:not(:disabled) {
  background: var(--xl-green-dark);
  color: #ffffff;
}

.truc-save-btn.dirty {
  background: #d97706;
  border-color: #b45309;
  color: #ffffff;
  box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.25);
}

.truc-save-btn.dirty:hover:not(:disabled) {
  background: #b45309;
  color: #ffffff;
}

.truc-export-btn {
  background: #ffffff;
  color: var(--xl-green-dark);
  border-color: var(--xl-green);
}

.truc-icon-btn {
  min-width: 30px;
  padding: 0 7px;
  font-size: 14px;
}

.truc-swatch-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 5px;
  background: #ffffff;
  border: 1px solid #c5c5c5;
  border-radius: 4px;
  height: 30px;
}

.truc-swatch {
  width: 21px;
  height: 21px;
  border: 1px solid #444444;
  border-radius: 3px;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #000000;
  transition: transform 0.1s, box-shadow 0.1s;
}

.truc-swatch:hover {
  transform: scale(1.1);
  box-shadow: 0 0 0 2px rgba(33, 115, 70, 0.35);
}

.truc-swatch.sw-normal {
  background: #ffffff;
}

.truc-swatch.sw-note {
  background: #cceffc;
}

.truc-swatch.sw-cover {
  background: #e9f6dc;
}

.truc-swatch.sw-ot {
  background: #ffc000;
}

.truc-swatch.sw-missing {
  background: #ffffff;
}

.truc-swatch.sw-slashed {
  background: linear-gradient(to top left,
      #ffffff calc(50% - 0.8px),
      #000000 50%,
      #ffffff calc(50% + 0.8px));
}

/* Timesheet 2-mode switch controls */
.ts-controls {
  gap: 8px;
  flex-wrap: wrap;
}

.ts-scope-switch {
  display: inline-flex;
  border: 1px solid #1d4ed8;
  border-radius: 4px;
  overflow: hidden;
  background: #ffffff;
}

.ts-scope-btn {
  height: 28px;
  padding: 0 11px;
  border: none;
  background: #ffffff;
  color: #1e40af;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}

.ts-scope-btn+.ts-scope-btn {
  border-left: 1px solid #1d4ed8;
}

.ts-scope-btn:hover {
  background: #eff6ff;
}

.ts-scope-btn.active {
  background: #1d4ed8;
  color: #ffffff;
}

.ts-mode-switch {
  display: inline-flex;
  border: 1px solid var(--xl-green);
  border-radius: 4px;
  overflow: hidden;
  background: #ffffff;
}

.ts-mode-btn {
  height: 28px;
  padding: 0 12px;
  border: none;
  background: #ffffff;
  color: var(--xl-green-dark);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}

.ts-mode-btn+.ts-mode-btn {
  border-left: 1px solid var(--xl-green);
}

.ts-mode-btn:hover {
  background: var(--xl-green-light);
}

.ts-mode-btn.active {
  background: var(--xl-green);
  color: #ffffff;
}

.ts-area-select {
  min-width: 120px;
}

.ribbon-search {
  height: 30px;
  width: 145px;
  padding: 0 9px;
  border: 1px solid #b5b5b5;
  border-radius: 4px;
  font-size: 13px;
  background: #ffffff;
}

.ribbon-search:focus {
  outline: 2px solid #86efac;
  border-color: var(--xl-green);
}

.ribbon-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: #222222;
}

.leg-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.leg-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 15px;
  border: 1px solid #333333;
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
}

.leg-blue {
  background: #cceffc;
}

.leg-green {
  background: #e9f6dc;
}

.leg-yellow {
  background: #ffc000;
}

.leg-zero {
  background: #ffffff;
  color: #000000;
}

.leg-slash {
  background: linear-gradient(to top left,
      #ffffff calc(50% - 0.8px),
      #000000 50%,
      #ffffff calc(50% + 0.8px));
}

/* 3. MODERN FORMULA BAR */
.xl-formulabar {
  height: 34px;
  background: #ffffff;
  border-bottom: 1px solid #d5dfe8;
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 8px;
  flex-shrink: 0;
  font-family: var(--font-ui);
}

.xl-namebox {
  min-width: 64px;
  height: 24px;
  padding: 0 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 700;
  color: #065f46;
  background: #f8fafc;
  flex-shrink: 0;
}

.xl-fx-label {
  width: 28px;
  height: 24px;
  border-radius: 6px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-style: italic;
  font-weight: 800;
  color: #059669;
  font-size: 13px;
  flex-shrink: 0;
}

.xl-formula-display {
  flex: 1;
  padding: 0 6px;
  font-size: 13px;
  font-weight: 500;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.xl-formula-input {
  flex: 1;
  height: 26px;
  border: 1px solid transparent;
  border-radius: 6px;
  outline: none;
  padding: 0 10px;
  font-family: var(--font-ui);
  font-size: 13px;
  color: #0f172a;
  background: #f8fafc;
}

.xl-formula-input:focus {
  background: #ffffff;
  border-color: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.16);
}

.xl-loading {
  padding: 3px 12px;
  margin-right: 4px;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #6ee7b7;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

/* 4. MODERN ELEVATED SPREADSHEET VIEWPORT & TABLE */
.xl-viewport {
  flex: 1;
  overflow: auto;
  background: linear-gradient(180deg, #e9eff5 0%, #eef3f7 100%);
  position: relative;
  -webkit-overflow-scrolling: touch;
}

.xl-grid-container {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 0;
  margin: 0;
  transform-origin: top left;
}

.xl-sheet-wrap {
  padding: 10px 12px 20px;
  width: max-content;
  min-width: 100%;
  display: flex;
  justify-content: center;
}

.xl-empty-state {
  padding: 56px 24px;
  text-align: center;
  color: #475569;
  font-size: 15px;
  font-weight: 500;
}

table.xl-sheet {
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  background: #ffffff;
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
  color: #0f172a;
  margin: 0 auto;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  box-shadow:
    0 8px 28px rgba(15, 23, 42, 0.08),
    0 2px 6px rgba(15, 23, 42, 0.04);
}

table.xl-sheet td.xl-cell {
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  padding: 3px 6px;
  line-height: 1.28;
  white-space: pre-wrap;
  word-break: normal;
  overflow-wrap: break-word;
  position: relative;
  cursor: cell;
  background-color: #ffffff;
}

table.xl-sheet td.xl-cell.xl-desc-cell {
  padding: 4px 10px;
  line-height: 1.32;
  color: #1e293b;
  vertical-align: middle;
}

.xl-desc-clamp {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.32;
  max-height: 34px;
  white-space: normal;
  word-break: break-word;
}

table.xl-sheet td.xl-cell.xl-single-line {
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
  text-overflow: ellipsis;
  overflow: hidden;
  padding: 5px 8px;
}

table.xl-sheet td.xl-cell.xl-num-cell {
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
  padding: 3px 3px;
  overflow: hidden;
}

table.xl-sheet td.xl-cell.xl-slot-cell {
  padding: 3px 4px;
  line-height: 1.18;
  overflow: hidden;
}

/* Soft zebra striping & gentle row highlight on plain white data cells */
table.xl-sheet tr.xl-data-row:nth-child(even) td.xl-cell.xl-plain-bg {
  background-color: #f8fafc;
}

table.xl-sheet tr.xl-data-row:hover td.xl-cell.xl-plain-bg {
  background-color: #f0fdf4;
}

/* Sticky left identity columns (STT, Vị trí / Họ tên, Số hiệu) */
table.xl-sheet th.xl-col-hdr.xl-sticky-hdr {
  position: sticky;
  z-index: 30;
  background: #e9eff5;
}

table.xl-sheet td.xl-sticky-col {
  position: sticky;
  z-index: 14;
}

table.xl-sheet th.xl-sticky-edge,
table.xl-sheet td.xl-sticky-edge {
  border-right: 1.5px solid #000000 !important;
  box-shadow: 4px 0 10px -4px rgba(15, 23, 42, 0.18);
}

table.xl-sheet th.xl-corner {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 35;
  width: 34px;
  min-width: 34px;
  height: 28px;
  background: #e2e8f0;
  border-right: 1px solid #cbd5e1;
  border-bottom: 1px solid #cbd5e1;
  border-top-left-radius: 11px;
}

table.xl-sheet th.xl-col-hdr {
  position: sticky;
  top: 0;
  z-index: 22;
  height: 28px;
  background: #f1f5f9;
  border-right: 1px solid #cbd5e1;
  border-bottom: 1.5px solid #cbd5e1;
  font-family: var(--font-ui);
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
  text-align: center;
  vertical-align: middle;
  user-select: none;
}

table.xl-sheet th.xl-col-hdr:last-child {
  border-top-right-radius: 11px;
}

table.xl-sheet th.xl-col-hdr.active-hdr {
  background: #d1fae5;
  color: #065f46;
  border-bottom: 2px solid #059669;
}

table.xl-sheet td.xl-row-hdr {
  position: sticky;
  left: 0;
  z-index: 18;
  width: 34px;
  min-width: 34px;
  background: #f1f5f9;
  border-right: 1px solid #cbd5e1;
  border-bottom: 1px solid #e2e8f0;
  font-family: var(--font-ui);
  font-size: 11.5px;
  font-weight: 600;
  color: #64748b;
  text-align: center;
  vertical-align: middle;
  user-select: none;
  padding: 0 2px;
}

table.xl-sheet td.xl-row-hdr.active-hdr {
  background: var(--xl-header-active);
  color: var(--xl-green-dark);
  border-right: 2px solid var(--xl-green);
}

table.xl-sheet td.xl-cell.xl-editable:hover {
  outline: 1px solid var(--xl-green);
  outline-offset: -1px;
}

table.xl-sheet td.xl-cell.xl-date-editable {
  cursor: pointer;
}

table.xl-sheet td.xl-cell.xl-date-editable:hover {
  background-color: #ecfdf5 !important;
  outline: 1.5px dashed var(--xl-green);
  outline-offset: -2px;
}

.xl-inline-date-editor {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  height: 36px;
  min-width: 190px;
  padding: 2px 10px;
  border: 2px solid var(--xl-green);
  border-radius: 4px;
  background: #ffffff;
  color: #000000;
  font-family: var(--font-main);
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  z-index: 40;
}

table.xl-sheet td.xl-cell.xl-selected {
  outline: none !important;
  box-shadow: 0 0 6px rgba(14, 107, 78, 0.28) !important;
  z-index: 11;
}

table.xl-sheet td.xl-cell.xl-selected::before {
  content: '';
  position: absolute;
  inset: 0;
  padding: 1.5px;
  border-radius: 2px;
  background: linear-gradient(135deg, #04221a 0%, #093c2e 26%, #0e6b4e 58%, #10b981 82%, #06b6d4 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 21;
}

table.xl-sheet td.xl-cell.xl-sticky-col.xl-selected {
  z-index: 16;
}

table.xl-sheet td.xl-cell.xl-in-range {
  box-shadow: inset 0 0 0 1000px rgba(16, 185, 129, 0.13);
}

table.xl-sheet td.xl-cell.xl-range-top {
  border-top: 1.5px solid #0e6b4e !important;
}

table.xl-sheet td.xl-cell.xl-range-bottom {
  border-bottom: 1.5px solid #0e6b4e !important;
}

table.xl-sheet td.xl-cell.xl-range-left {
  border-left: 1.5px solid #0e6b4e !important;
}

table.xl-sheet td.xl-cell.xl-range-right {
  border-right: 1.5px solid #0e6b4e !important;
}

table.xl-sheet td.xl-cell.xl-fill-preview {
  box-shadow: inset 0 0 0 1000px rgba(16, 185, 129, 0.16);
  outline: 1.5px dashed #0e6b4e !important;
  outline-offset: -1.5px;
}

table.xl-sheet td.xl-cell.xl-cell-has-handle {
  overflow: visible !important;
}

.xl-fill-handle {
  position: absolute;
  right: -3.5px;
  bottom: -3.5px;
  width: 7px;
  height: 7px;
  background: linear-gradient(135deg, #064e3b 0%, #10b981 100%);
  border: 1px solid #ffffff;
  cursor: crosshair;
  z-index: 25;
}

.xl-inline-editor {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  outline: 2px solid var(--xl-green);
  outline-offset: -2px;
  background: #ffffff;
  color: #000000;
  font-family: var(--font-main);
  text-align: center;
  padding: 0 4px;
  z-index: 35;
  box-sizing: border-box;
}

table.xl-sheet.xl-selecting {
  user-select: none;
}

table.xl-sheet td.xl-diag-up {
  background-image: linear-gradient(to top left,
      transparent calc(50% - 0.6px),
      #000000 50%,
      transparent calc(50% + 0.6px)) !important;
}

table.xl-sheet td.xl-diag-down {
  background-image: linear-gradient(to top right,
      transparent calc(50% - 0.6px),
      #000000 50%,
      transparent calc(50% + 0.6px)) !important;
}

/* REPORT VIEW (MODERN CRISP DOCUMENT CARD) */
.report-sheet-bg {
  min-height: 100%;
  width: 100%;
  background: linear-gradient(180deg, #e9eff5 0%, #eef3f7 100%);
  padding: 20px 24px 32px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.report-paper {
  width: 100%;
  max-width: 1080px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-top: 4px solid #059669;
  border-radius: 14px;
  box-shadow:
    0 10px 30px rgba(15, 23, 42, 0.08),
    0 2px 6px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.report-paper-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 26px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
}

.report-paper-title {
  font-size: 15.5px;
  font-weight: 700;
  color: #065f46;
  letter-spacing: 0.2px;
}

.report-copy-btn {
  background: linear-gradient(135deg, #059669 0%, #0d9488 100%);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.28);
}

.report-copy-btn:hover {
  background: linear-gradient(135deg, #047857 0%, #0f766e 100%);
}

.report-content {
  padding: 26px 34px 34px;
  font-family: var(--font-ui);
  font-size: 15.5px;
  line-height: 1.85;
  color: #0f172a;
}

.report-line {
  margin: 0 0 7px;
}

.report-line-heading {
  font-size: 17.5px;
  font-weight: 700;
  color: #064e3b;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px dashed #cbd5e1;
}

.report-line-section {
  font-size: 16px;
  font-weight: 700;
  color: #065f46;
  margin-top: 16px;
  margin-bottom: 8px;
}

.report-line-sub {
  font-weight: 700;
  color: #1e293b;
  margin-top: 6px;
  margin-bottom: 4px;
  padding-left: 8px;
}

.report-line-bullet {
  padding-left: 22px;
  margin-bottom: 6px;
  color: #1e293b;
}

.report-missing-hl {
  color: #b91c1c;
  background: #fef2f2;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
}

.report-ot-hl {
  background: #fef08a;
  color: #854d0e;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
}

/* 5. FUTURISTIC FLOATING BOTTOM SHEET SWITCHER BAR */
.xl-sheetbar {
  height: 44px;
  background: linear-gradient(180deg, #f4f7f9 0%, #e9eff4 100%);
  border-top: 1px solid #cbd5e1;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  user-select: none;
  overflow: visible;
  font-family: var(--font-ui);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.xl-sheet-tabs {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  padding: 3px;
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.09);
  border-radius: 11px;
  overflow: visible;
  scrollbar-width: none;
  flex-shrink: 0;
}

.xl-sheet-tabs::-webkit-scrollbar {
  display: none;
}

.xl-sheet-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 29px;
  min-width: 96px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #334155;
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.xl-sheet-tab .sheet-ico {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.82;
}

.xl-sheet-tab .sheet-ico.ico-day {
  color: #d97706;
}

.xl-sheet-tab .sheet-ico.ico-night {
  color: #4f46e5;
}

.xl-sheet-tab:hover {
  background: rgba(255, 255, 255, 0.88);
  color: #0f172a;
}

.xl-sheet-tab.active {
  background: linear-gradient(135deg, #059669 0%, #0d9488 100%);
  color: #ffffff;
  font-weight: 700;
  border-color: rgba(16, 185, 129, 0.65);
  box-shadow:
    0 3px 10px rgba(5, 150, 105, 0.34),
    0 0 10px rgba(13, 148, 136, 0.22);
}

.xl-sheet-tab.active .sheet-ico,
.xl-sheet-tab.active .sheet-ico.ico-day,
.xl-sheet-tab.active .sheet-ico.ico-night {
  color: #ffffff;
  opacity: 1;
}

.xl-status-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 100%;
  font-family: var(--font-ui);
  font-size: 12.5px;
  color: #334155;
  white-space: nowrap;
  flex-shrink: 0;
}

#statusInfo {
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid #d5dfe8;
  color: #1e293b;
  font-weight: 600;
  font-size: 12px;
}

.xl-zoom {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 5px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid #cbd5e1;
  border-radius: 999px;
}

.zoom-fit-btn {
  height: 24px;
  padding: 0 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #065f46;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.zoom-fit-btn:hover {
  background: #d1fae5;
  color: #064e3b;
}

.zoom-fit-btn.active {
  background: linear-gradient(135deg, #059669 0%, #0d9488 100%);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.28);
}

#zoomLabel {
  min-width: 38px;
  text-align: center;
  font-weight: 700;
  font-size: 12px;
  color: #0f172a;
  cursor: pointer;
}

#zoomLabel:hover {
  color: var(--xl-green-dark);
  text-decoration: underline;
}

.zoom-btn {
  width: 24px;
  height: 24px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  padding: 0;
  color: #1e293b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.zoom-btn:hover {
  background: #ecfdf5;
  border-color: #10b981;
  color: #065f46;
}

/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.modal-dialog {
  background: #ffffff;
  width: 100%;
  max-width: 620px;
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  border: 1px solid #b5b5b5;
}

.modal-header {
  padding: 12px 16px;
  background: var(--xl-green);
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.modal-header h3 {
  margin: 0;
  font-size: 16px;
}

.modal-sub {
  margin: 2px 0 0;
  font-size: 13px;
  color: #dcfce7;
}

.icon-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 16px;
  cursor: pointer;
}

.modal-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field-group label {
  font-size: 13px;
  font-weight: 700;
  color: #222222;
}

.field-group input {
  padding: 7px 9px;
  border: 1px solid #b8b8b8;
  border-radius: 4px;
  font-size: 14px;
}

.field-group input:focus {
  outline: 2px solid #86efac;
  border-color: var(--xl-green);
}

.status-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.status-opt {
  border: 1px solid #b8b8b8;
  background: #ffffff;
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-opt.active {
  border-color: var(--xl-green);
  background: var(--xl-green-light);
  color: var(--xl-green-dark);
}

.dot {
  width: 12px;
  height: 12px;
  border: 1px solid #444444;
  display: inline-block;
}

.dot-normal {
  background: #ffffff;
}

.dot-note {
  background: #cceffc;
}

.dot-cover {
  background: #e9f6dc;
}

.dot-ot {
  background: #ffc000;
}

.dot-missing {
  background: #ffffff;
}

.dot-slashed {
  background: linear-gradient(to top left, #ffffff 45%, #000000 50%, #ffffff 55%);
}

.structured-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) minmax(0, 0.78fr) minmax(0, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.structured-grid .field-group,
.structured-grid input {
  min-width: 0;
  width: 100%;
}

.raw-input {
  font-weight: 700;
  background: #f9fafb;
}

.calc-preview {
  margin-top: 8px;
  padding: 7px 10px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 4px;
  font-size: 13px;
  color: #166534;
}

.modal-footer {
  padding: 10px 16px;
  background: var(--xl-ribbon);
  border-top: 1px solid #d1d1d1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.modal-btn {
  padding: 6px 16px;
  border-radius: 4px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}

.modal-btn-cancel {
  border: 1px solid #b8b8b8;
  background: #ffffff;
  color: #222222;
}

.modal-btn-save {
  border: none;
  background: var(--xl-green);
  color: #ffffff;
}

.modal-btn-save:hover {
  background: var(--xl-green-dark);
}

.drive-modal-dialog {
  max-width: 620px;
}

.new-truc-dialog {
  max-width: 520px;
}

.new-truc-date-input {
  font-size: 16px !important;
  font-weight: 700;
  color: #111111;
  cursor: pointer;
}

.new-truc-hint {
  font-size: 12.5px;
  color: #166534;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 4px;
  padding: 6px 9px;
  margin-top: 4px;
  line-height: 1.45;
}

.new-truc-hint.warn {
  color: #92400e;
  background: #fffbeb;
  border-color: #fde68a;
}

.new-truc-modes {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.new-truc-mode-opt {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  text-align: left;
  padding: 10px 12px;
  border: 1.5px solid #cbd5e1;
  border-radius: 5px;
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}

.new-truc-mode-opt:hover:not(:disabled) {
  border-color: var(--xl-green);
  background: #f7fdf9;
}

.new-truc-mode-opt.active {
  border-color: var(--xl-green);
  background: var(--xl-green-light);
}

.new-truc-mode-opt:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ntm-title {
  font-size: 14px;
  font-weight: 700;
  color: #111111;
}

.ntm-desc {
  font-size: 12.5px;
  color: #444444;
  line-height: 1.4;
}

.drive-status-box {
  padding: 8px 11px;
  border-radius: 4px;
  background: #fefce8;
  border: 1px solid #fde047;
  color: #713f12;
  font-size: 13px;
  line-height: 1.45;
}

.drive-status-box.connected {
  background: #f0fdf4;
  border-color: #86efac;
  color: #166534;
}

.drive-target-link {
  color: #1d4ed8;
  font-size: 13px;
  word-break: break-all;
  text-decoration: underline;
}

.drive-steps {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
}

.drive-steps-title {
  font-weight: 700;
  color: var(--xl-green-dark);
  margin-bottom: 6px;
}

.drive-steps ol {
  margin: 0 0 8px 18px;
  padding: 0;
}

.drive-steps li {
  margin-bottom: 4px;
}

.drive-steps a {
  color: #1d4ed8;
  font-weight: 700;
}

.drive-script-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast {
  position: fixed;
  bottom: 42px;
  right: 16px;
  background: #1f2937;
  color: #ffffff;
  padding: 9px 14px;
  border-radius: 4px;
  font-size: 13.5px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  z-index: 200;
}

/* ==================== RESPONSIVE BREAKPOINTS ==================== */
@media (max-width: 1280px) {
  .xl-ribbon {
    padding: 6px 10px;
    gap: 6px 10px;
  }

  .ribbon-select-wide {
    min-width: 180px;
  }

  #statusInfo {
    font-size: 12px;
  }
}

@media (max-width: 1120px) {
  .xl-main-tabs {
    flex-wrap: wrap;
    border-radius: 12px;
    gap: 4px;
    padding: 4px 5px;
    max-width: calc(100% - 14px);
  }

  .xl-main-tab {
    padding: 5px 10px;
    font-size: 12.5px;
  }

  .ribbon-sep {
    display: none;
  }

  .ribbon-select-wide {
    min-width: 160px;
  }

  .xl-sheetbar {
    display: flex;
    flex-wrap: wrap;
    height: auto;
    min-height: 42px;
    justify-content: space-between;
    padding: 5px 10px;
    gap: 6px 10px;
  }

  .xl-sheet-tab {
    width: auto;
    min-width: 92px;
    padding: 0 10px;
    font-size: 12.5px;
  }

  #statusInfo {
    display: none;
  }
}

@media (max-width: 820px) {
  .xl-top-row {
    padding: 6px 10px 4px;
    gap: 6px;
  }

  .xl-title {
    font-size: 13.5px;
  }

  .xl-btn-export,
  .xl-btn-drive {
    padding: 4px 10px;
    font-size: 12px;
  }

  .xl-btn-gear {
    width: 27px;
    height: 27px;
    font-size: 12.5px;
  }

  .xl-main-tab {
    padding: 5px 8px;
    font-size: 12px;
    gap: 4px;
  }

  .xl-main-tab .tab-ico {
    width: 13px;
    height: 13px;
  }

  .panel-sheet-bg,
  .report-sheet-bg {
    padding: 10px 8px 20px;
  }

  .panel-card-header {
    padding: 10px 14px;
  }

  .panel-card-body {
    padding: 12px 14px 14px;
  }

  /* Bỏ ghim cột trái trên tablet nhỏ & điện thoại để cột B (270px) không che khuất bảng lịch */
  table.xl-sheet th.xl-col-hdr.xl-sticky-hdr,
  table.xl-sheet td.xl-sticky-col {
    position: static !important;
    left: auto !important;
    box-shadow: none !important;
  }

  table.xl-sheet th.xl-sticky-edge,
  table.xl-sheet td.xl-sticky-edge {
    border-right: 1px solid #000000 !important;
    box-shadow: none !important;
  }
}

@media (max-width: 640px) {
  .xl-top-row {
    padding: 5px 7px 3px;
    gap: 4px;
    flex-wrap: nowrap;
  }

  .xl-brand {
    gap: 5px;
    min-width: 0;
  }

  .xl-icon {
    width: 22px;
    height: 22px;
    font-size: 12px;
    border-radius: 6px;
  }

  .xl-title {
    font-size: 12px;
  }

  .xl-title-actions {
    gap: 4px;
  }

  .xl-btn-export,
  .xl-btn-drive {
    padding: 3px 7px;
    font-size: 10.5px;
  }

  .xl-btn-gear {
    width: 24px;
    height: 24px;
    font-size: 11.5px;
  }

  /* Thanh 7 tab trượt ngang mượt chuẩn ứng dụng di động (không xếp 3 hàng chiếm màn hình) */
  .xl-main-tabs {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 3px 4px;
    gap: 4px;
    margin: 2px 6px 6px;
    width: calc(100% - 12px);
    max-width: calc(100% - 12px);
    border-radius: 10px;
  }

  .xl-main-tabs::-webkit-scrollbar,
  .truc-controls::-webkit-scrollbar,
  .ts-controls::-webkit-scrollbar,
  .summary-controls::-webkit-scrollbar,
  .ribbon-legend::-webkit-scrollbar,
  .xl-sheet-tabs::-webkit-scrollbar {
    display: none;
  }

  .xl-main-tab {
    flex: 0 0 auto;
    padding: 5px 10px;
    font-size: 12.5px;
  }

  .xl-main-tab .tab-ico {
    display: none;
  }

  .xl-ribbon {
    padding: 5px 8px;
    gap: 5px;
    justify-content: flex-start;
  }

  .ribbon-left {
    width: 100%;
    gap: 5px;
  }

  .ribbon-group {
    flex: 1 1 46%;
    min-width: 0;
    gap: 4px;
  }

  .ribbon-group-file {
    flex: 1 1 100%;
  }

  .ribbon-label {
    font-size: 12px;
  }

  .ribbon-select,
  .ribbon-select-wide {
    width: 100%;
    min-width: 0;
    height: 30px;
    font-size: 12px;
    padding: 0 7px;
  }

  .ribbon-btns {
    flex: 1 1 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .actual-readonly-badge {
    height: 26px;
    font-size: 11.5px;
    padding: 0 9px;
  }

  /* Thanh công cụ Lịch trực / Tính công / Bảng kê trượt ngang 1 dòng gọn trên điện thoại */
  .truc-controls,
  .ts-controls,
  .summary-controls {
    flex: 1 1 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .ribbon-btn {
    height: 29px;
    padding: 0 9px;
    font-size: 12px;
    flex-shrink: 0;
  }

  .ribbon-legend {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    width: 100%;
    justify-content: flex-start;
    font-size: 11px;
    gap: 8px;
  }

  .leg-item {
    flex-shrink: 0;
  }

  .xl-formulabar {
    height: 30px;
    padding: 0 6px;
    gap: 5px;
  }

  .xl-namebox {
    min-width: 46px;
    height: 22px;
    padding: 0 6px;
    font-size: 11.5px;
  }

  .xl-fx-label {
    width: 22px;
    height: 22px;
    font-size: 11.5px;
  }

  .xl-formula-display,
  .xl-formula-input {
    font-size: 12px;
  }

  .xl-sheet-wrap {
    padding: 6px 6px 14px;
    justify-content: flex-start;
  }

  .report-sheet-bg,
  .panel-sheet-bg {
    padding: 8px 6px 18px;
  }

  .panel-wrap {
    gap: 12px;
  }

  .panel-card {
    border-radius: 10px;
  }

  .panel-card-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 10px;
  }

  .panel-card-title {
    font-size: 15px;
  }

  .panel-card-sub {
    font-size: 12px;
  }

  .panel-card-body {
    padding: 10px;
    gap: 10px;
  }

  .leave-filter-bar {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .leave-month-select,
  .leave-date-wrap,
  .leave-date-input {
    width: 100%;
    min-width: 0;
  }

  .leave-filter-bar .ribbon-search {
    grid-column: span 2;
    width: 100% !important;
  }

  .leave-subtabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    padding: 5px;
  }

  .leave-subtab {
    justify-content: center;
    padding: 6px 6px;
    font-size: 12px;
    gap: 4px;
  }

  .emp-picker-row {
    flex-wrap: wrap;
  }

  .emp-picker-row input {
    min-width: 100%;
  }

  .emp-picker-row .fx-card-btn {
    width: 100%;
    justify-content: center;
  }

  .panel-actions-row {
    flex-wrap: wrap;
  }

  .report-content {
    padding: 12px 10px 16px;
    font-size: 13.5px;
    line-height: 1.6;
  }

  .report-line-bullet {
    padding-left: 10px;
  }

  .modal-overlay {
    padding: 8px;
  }

  .modal-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px;
  }

  .structured-grid {
    grid-template-columns: 1fr 1fr;
  }

  .xl-sheetbar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    height: auto;
    min-height: 40px;
    justify-content: space-between;
    padding: 4px 6px;
    gap: 6px;
  }

  .xl-sheet-tabs {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .xl-sheet-tab {
    flex: 0 0 auto;
    width: auto;
    min-width: 68px;
    height: 28px;
    padding: 0 9px;
    font-size: 11.5px;
  }

  .xl-status-right {
    flex-shrink: 0;
    gap: 4px;
  }

  .zoom-fit-btn {
    padding: 0 8px;
    height: 24px;
    font-size: 11px;
  }

  .toast {
    left: 8px;
    right: 8px;
    bottom: 48px;
    font-size: 12.5px;
    text-align: center;
  }
}

/* ============================================================================
   FUTURISTIC SMOOTH HOVER TRACER + ELEVATION (CELLS, TABS, BUTTONS)
   ============================================================================ */
@property --fx-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@keyframes fxBorderSpin {
  from {
    --fx-angle: 0deg;
  }

  to {
    --fx-angle: 360deg;
  }
}

/* Smooth lift + running glowing perimeter border on buttons & tabs */
.ribbon-btn,
.xl-btn-drive,
.xl-btn-export,
.xl-btn-gear,
.xl-main-tab,
.xl-sheet-tab,
.modal-btn,
.report-copy-btn,
.zoom-fit-btn,
.zoom-btn,
.truc-swatch,
.fx-card-btn,
.alert-pill {
  position: relative;
  transition:
    transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.22s ease,
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease;
}

.ribbon-btn::after,
.xl-btn-drive::after,
.xl-btn-export::after,
.xl-btn-gear::after,
.xl-main-tab::after,
.xl-sheet-tab::after,
.modal-btn::after,
.report-copy-btn::after,
.zoom-fit-btn::after,
.zoom-btn::after,
.fx-card-btn::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 2px;
  background: conic-gradient(from var(--fx-angle),
      rgba(16, 185, 129, 0.08) 0deg,
      #06b6d4 65deg,
      #34d399 135deg,
      #38bdf8 205deg,
      rgba(16, 185, 129, 0.08) 275deg,
      #10b981 360deg);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 2;
}

.ribbon-btn:hover:not(:disabled),
.xl-btn-drive:hover:not(:disabled),
.xl-btn-export:hover:not(:disabled),
.xl-btn-gear:hover:not(:disabled),
.modal-btn:hover:not(:disabled),
.report-copy-btn:hover:not(:disabled),
.zoom-fit-btn:hover:not(:disabled),
.zoom-btn:hover:not(:disabled),
.fx-card-btn:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.015);
  box-shadow:
    0 6px 18px rgba(16, 185, 129, 0.26),
    0 0 12px rgba(6, 182, 212, 0.22);
  z-index: 6;
}

.xl-main-tab:hover,
.xl-sheet-tab:hover {
  transform: translateY(-2px);
  box-shadow:
    0 5px 16px rgba(16, 185, 129, 0.26),
    0 0 12px rgba(56, 189, 248, 0.24);
  z-index: 6;
}

.ribbon-btn:hover:not(:disabled)::after,
.xl-btn-drive:hover:not(:disabled)::after,
.xl-btn-export:hover:not(:disabled)::after,
.xl-btn-gear:hover:not(:disabled)::after,
.xl-main-tab:hover::after,
.xl-sheet-tab:hover::after,
.modal-btn:hover:not(:disabled)::after,
.report-copy-btn:hover:not(:disabled)::after,
.zoom-fit-btn:hover:not(:disabled)::after,
.zoom-btn:hover:not(:disabled)::after,
.fx-card-btn:hover:not(:disabled)::after {
  opacity: 1;
  animation: fxBorderSpin 1.8s linear infinite;
}

/* Futuristic smooth elevation + running border on hovered Excel cells */
table.xl-sheet td.xl-cell {
  transition:
    transform 0.16s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.18s ease;
}

table.xl-sheet:not(.xl-selecting) td.xl-cell:hover:not(:has(.xl-inline-editor)):not(:has(.xl-inline-date-editor)) {
  z-index: 18;
  overflow: visible;
  transform: translateY(-0.5px) scale(1.008);
  box-shadow:
    0 3px 10px rgba(9, 60, 46, 0.2),
    0 0 6px rgba(16, 185, 129, 0.22);
}

table.xl-sheet:not(.xl-selecting) td.xl-cell:hover:not(:has(.xl-inline-editor)):not(:has(.xl-inline-date-editor))::after {
  content: '';
  position: absolute;
  inset: -0.5px;
  padding: 1.5px;
  border-radius: 2px;
  background: conic-gradient(from var(--fx-angle),
      #04221a 0deg,
      #0e543f 75deg,
      #10b981 155deg,
      #06b6d4 225deg,
      #093c2e 300deg,
      #34d399 360deg);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 22;
  animation: fxBorderSpin 1.8s linear infinite;
}

.xl-fill-handle {
  z-index: 30 !important;
}

/* ============================================================================
   LỊCH TRỰC LIVE ALERTS: ĐỎ NHẠT (ĐANG NGHỈ) & HỒNG NHẠT (TRÙNG NHÂN VIÊN)
   ============================================================================ */
table.xl-sheet td.xl-cell.xl-alert-dup {
  background-color: #fbcfe8 !important;
  color: #831843 !important;
  font-weight: 700 !important;
  box-shadow: inset 0 0 0 1.5px #f472b6;
}

table.xl-sheet td.xl-cell.xl-alert-leave {
  background-color: #fecaca !important;
  color: #991b1b !important;
  font-weight: 700 !important;
  box-shadow: inset 0 0 0 1.5px #f87171;
}

table.xl-sheet td.xl-cell.xl-alert-time {
  background-color: #fecaca !important;
  color: #991b1b !important;
  font-weight: 700 !important;
  box-shadow: inset 0 0 0 1.5px #ef4444;
}

table.xl-sheet td.xl-cell.xl-alert-over16 {
  background-color: #fed7aa !important;
  color: #9a3412 !important;
  font-weight: 700 !important;
  box-shadow: inset 0 0 0 1.5px #f97316;
}

table.xl-sheet td.xl-cell.xl-alert-leave.xl-alert-dup,
table.xl-sheet td.xl-cell.xl-alert-time.xl-alert-dup {
  background: linear-gradient(135deg, #fecaca 50%, #fbcfe8 100%) !important;
  color: #881337 !important;
  box-shadow: inset 0 0 0 1.5px #f87171;
}

table.xl-sheet td.xl-cell.xl-alert-over16.xl-alert-dup {
  background: linear-gradient(135deg, #fed7aa 50%, #fbcfe8 100%) !important;
  color: #7c2d12 !important;
  box-shadow: inset 0 0 0 1.5px #f97316;
}

table.xl-sheet td.xl-cell.xl-alert-over16.xl-alert-leave {
  background: linear-gradient(135deg, #fecaca 50%, #fed7aa 100%) !important;
  color: #991b1b !important;
  box-shadow: inset 0 0 0 1.5px #ef4444;
}

/* Editable Ghi chú 1 & 2 on Tab Tính công NV, plus manual cells on sheet Đào tạo */
table.xl-sheet td.xl-cell.xl-note-editable,
table.xl-sheet td.xl-cell.xl-training-editable {
  cursor: text;
}

table.xl-sheet td.xl-cell.xl-note-editable:hover,
table.xl-sheet td.xl-cell.xl-training-editable:hover {
  background-color: #f0fdf4 !important;
}

/* Ô giờ có cộng thêm giờ đặc biệt bên ngoài từ trang Note -> in chữ xanh dương đậm (#1D4ED8) giống file Excel */
table.xl-sheet td.xl-cell.xl-hour-manual {
  color: #1d4ed8 !important;
  font-weight: 700 !important;
  background-color: #eff6ff !important;
}

/* Trang Note (Giờ đặc biệt bên ngoài) trên tab Tính công NV */
.sp-summary-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.sp-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.sp-stat-pill.blue {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.sp-stat-pill.green {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.sp-hours-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12.5px;
}

.sp-hours-badge.pos {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #93c5fd;
}

.sp-hours-badge.neg {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

.sp-area-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  background: #e2efda;
  color: #14532d;
  border: 1px solid #bbf7d0;
}

.sp-area-pill.f2 {
  background: #e0e7ff;
  color: #3730a3;
  border-color: #c7d2fe;
}

.sp-quick-hours {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.sp-hour-chip {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  cursor: pointer;
  transition: all 0.14s ease;
}

.sp-hour-chip:hover {
  background: #dbeafe;
  border-color: #60a5fa;
}

.sp-jump-bar {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

/* ============================================================================
   CELL COMMENTS (LỊCH TRỰC → ĐỒNG BỘ LỊCH THỰC TẾ)
   ============================================================================ */
.xl-comment-corner {
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 9px 9px 0;
  border-color: transparent #bd67c9 transparent transparent;
  pointer-events: none;
  z-index: 15;
}

.truc-comment-btn.has-comment {
  background: #faf5ff;
  border-color: #bd67c9;
  color: #6b21a8;
  font-weight: 700;
}

.truc-comment-btn.has-comment:hover:not(:disabled) {
  background: #f3e8ff;
  border-color: #9333ea;
  color: #581c87;
}

.comment-textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-family: var(--font-main);
  font-size: 14px;
  line-height: 1.45;
  color: #0f172a;
  resize: vertical;
  min-height: 54px;
}

.comment-textarea:focus {
  outline: 2px solid #d8b4fe;
  border-color: #9333ea;
}

.comment-modal-dialog {
  max-width: 480px;
}

.comment-modal-header {
  background: linear-gradient(135deg, #6b21a8 0%, #9333ea 100%);
}

.comment-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.comment-modal-footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.modal-btn-danger {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

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

.xl-context-menu {
  position: fixed;
  z-index: 260;
  min-width: 210px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 5px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.2), 0 2px 6px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.xl-ctx-item {
  width: 100%;
  border: none;
  background: transparent;
  padding: 7px 11px;
  border-radius: 6px;
  text-align: left;
  font-family: var(--font-main);
  font-size: 13.5px;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
}

.xl-ctx-item:hover:not(:disabled) {
  background: #ecfdf5;
  color: #065f46;
}

.xl-ctx-item.xl-ctx-danger:hover:not(:disabled) {
  background: #fef2f2;
  color: #b91c1c;
}

.xl-ctx-item:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.xl-ctx-sep {
  height: 1px;
  background: #e2e8f0;
  margin: 3px 6px;
}

.xl-comment-tooltip {
  position: fixed;
  z-index: 250;
  max-width: 320px;
  min-width: 170px;
  background: #fffdf7;
  border: 1px solid #c084fc;
  border-top: 3px solid #bd67c9;
  border-radius: 8px;
  padding: 8px 11px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.2);
  pointer-events: none;
  font-family: var(--font-main);
  color: #0f172a;
}

.xl-comment-tooltip-hdr {
  font-size: 11.5px;
  font-weight: 700;
  color: #7e22ce;
  margin-bottom: 4px;
  padding-bottom: 3px;
  border-bottom: 1px dashed #e9d5ff;
}

.xl-comment-tooltip-body {
  font-size: 13.5px;
  line-height: 1.42;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Auto-save status badge in top header */
.xl-autosave-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 700;
  color: #d1fae5;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(52, 211, 153, 0.42);
  white-space: nowrap;
  user-select: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.xl-autosave-badge.saving {
  background: rgba(251, 191, 36, 0.24);
  border-color: rgba(251, 191, 36, 0.65);
  color: #fef3c7;
}

.xl-autosave-badge.saved {
  background: rgba(16, 185, 129, 0.28);
  border-color: rgba(52, 211, 153, 0.65);
  color: #ecfdf5;
}

.xl-autosave-badge.error {
  background: rgba(239, 68, 68, 0.3);
  border-color: rgba(248, 113, 113, 0.78);
  color: #fee2e2;
  cursor: pointer;
}

.autosave-inline-note {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 700;
  color: #065f46;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 999px;
  padding: 4px 11px;
}

@media (max-width: 640px) {
  .xl-autosave-badge {
    padding: 3px 8px;
    font-size: 10.5px;
  }
}

table.xl-sheet td.xl-cell.xl-search-hit {
  background-color: #fef9c3 !important;
  box-shadow: inset 0 0 0 2px #eab308;
}

.truc-alert-badges {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
}

.alert-pill {
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.alert-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.alert-dot-red {
  background: #ef4444;
  border: 1px solid #991b1b;
}

.alert-dot-pink {
  background: #ff85c0;
  border: 1px solid #db2777;
}

.alert-dot-orange {
  background: #f97316;
  border: 1px solid #c2410c;
}

.alert-pill-over16 {
  background: #fff7ed;
  color: #9a3412;
  border-color: #f97316;
}

.alert-pill-over16:hover {
  background: #f97316;
  color: #ffffff;
  transform: translateY(-1.5px);
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.35);
}

.alert-pill-detail {
  background: #f0fdf4;
  color: #065f46;
  border-color: #059669;
}

.alert-pill-detail:hover,
.alert-pill-detail.open {
  background: linear-gradient(135deg, #064e3b 0%, #0f6b4b 100%);
  color: #ffffff;
  border-color: #064e3b;
}

/* Detailed Alert Drawer under Ribbon on Lịch trực */
.truc-alert-drawer {
  background: #ffffff;
  border-bottom: 1.5px solid #cbd5e1;
  padding: 8px 16px;
  max-height: 190px;
  overflow-y: auto;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  flex-shrink: 0;
}

.truc-alert-drawer-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.truc-alert-drawer-close {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.truc-alert-drawer-close:hover {
  background: #e2e8f0;
}

.truc-alert-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.truc-alert-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 7px;
  border: 1px solid #e2e8f0;
  font-size: 13px;
  line-height: 1.38;
  cursor: pointer;
  text-align: left;
  width: 100%;
  background: #f8fafc;
  transition: transform 0.12s ease, box-shadow 0.14s ease;
}

.truc-alert-item:hover {
  transform: translateX(2px);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.truc-alert-item.kind-dup {
  background: #fdf2f8;
  border-color: #f9a8d4;
  color: #831843;
}

.truc-alert-item.kind-leave,
.truc-alert-item.kind-time {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}

.truc-alert-item.kind-over16 {
  background: #fff7ed;
  border-color: #fdba74;
  color: #9a3412;
}

.truc-alert-item-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.truc-alert-item-jump {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0.85;
}

/* Leave History 4 Sub-tabs + Month & Date Filter Bar */
.leave-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.leave-month-select,
.leave-date-input {
  height: 32px;
  padding: 0 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: #0f172a;
  font-family: var(--font-main);
  font-size: 13.5px;
  font-weight: 600;
}

.leave-date-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.leave-date-clear {
  height: 32px;
  padding: 0 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.leave-date-clear:hover {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}

.leave-subtabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 6px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.leave-subtab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: #334155;
  font-family: var(--font-main);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
}

.leave-subtab:hover {
  background: #ffffff;
  color: #064e3b;
}

.leave-subtab.active {
  background: linear-gradient(135deg, #064e3b 0%, #0f6b4b 65%, #10b981 100%);
  color: #ffffff;
  border-color: #064e3b;
  box-shadow: 0 3px 10px rgba(6, 78, 59, 0.25);
}

.leave-subtab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(15, 23, 42, 0.08);
  color: inherit;
}

.leave-subtab.active .leave-subtab-count {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.alert-pill-leave {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #ef4444;
}

.alert-pill-leave:hover {
  background: #ef4444;
  color: #ffffff;
  transform: translateY(-1.5px);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}

.alert-pill-dup {
  background: #fdf2f8;
  color: #9d174d;
  border-color: #ec4899;
}

.alert-pill-dup:hover {
  background: #ec4899;
  color: #ffffff;
  transform: translateY(-1.5px);
  box-shadow: 0 4px 14px rgba(236, 72, 153, 0.35);
}

.ts-only-worked-wrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 700;
  color: #222222;
  cursor: pointer;
  white-space: nowrap;
  padding: 0 4px;
}

/* ============================================================================
   TAB ĐƠN NGHỈ VIỆC & TAB CÀI ĐẶT (CLEAN MODERN CARDS)
   ============================================================================ */
.panel-sheet-bg {
  min-height: 100%;
  width: 100%;
  background: linear-gradient(180deg, #e9eff5 0%, #eef3f7 100%);
  padding: 20px 24px 32px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.panel-wrap {
  width: 100%;
  max-width: 1220px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.panel-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-top: 3.5px solid #059669;
  border-radius: 14px;
  box-shadow:
    0 8px 26px rgba(15, 23, 42, 0.06),
    0 2px 5px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.panel-card-header {
  padding: 12px 18px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.panel-card-title {
  margin: 0;
  font-size: 16.5px;
  font-weight: 700;
  color: var(--xl-green-dark);
}

.panel-card-sub {
  margin: 2px 0 0;
  font-size: 13px;
  color: #475569;
}

.panel-card-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.panel-form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.panel-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.panel-field.span-2 {
  grid-column: span 2;
}

.panel-field.span-4 {
  grid-column: span 4;
}

.panel-field label {
  font-size: 13.5px;
  font-weight: 700;
  color: #1f2937;
}

.panel-field input,
.panel-field select {
  height: 36px;
  padding: 0 10px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  font-family: var(--font-main);
  font-size: 14px;
  background: #ffffff;
  color: #111111;
}

.panel-field input:focus,
.panel-field select:focus {
  outline: 2px solid #86efac;
  border-color: var(--xl-green);
}

.panel-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-input-row input {
  flex: 1;
}

.panel-actions-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.fx-card-btn {
  height: 35px;
  padding: 0 15px;
  border-radius: 5px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #1f2937;
  font-family: var(--font-main);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  text-decoration: none;
}

.fx-card-btn.primary {
  background: var(--xl-green);
  color: #ffffff;
  border-color: var(--xl-green-dark);
}

.fx-card-btn.primary:hover:not(:disabled) {
  background: var(--xl-green-dark);
}

.fx-card-btn.danger {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fca5a5;
}

.fx-card-btn.danger:hover:not(:disabled) {
  background: #dc2626;
  color: #ffffff;
}

.fx-card-btn.small {
  height: 28px;
  padding: 0 10px;
  font-size: 12.5px;
}

.reason-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.reason-chip {
  padding: 3px 9px;
  font-size: 12.5px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  cursor: pointer;
  font-family: var(--font-main);
  font-weight: 600;
  transition: all 0.15s ease;
}

.reason-chip:hover {
  border-color: var(--xl-green);
  background: #e6f4ea;
  color: var(--xl-green-dark);
  transform: translateY(-1px);
}

.panel-check-inline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 700;
  color: #991b1b;
  cursor: pointer;
  margin-top: 4px;
}

.panel-check-inline input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.panel-table-wrap {
  overflow-x: auto;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
}

.panel-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  background: #ffffff;
}

.panel-table th {
  background: #e2efda;
  color: #14532d;
  font-weight: 700;
  padding: 9px 10px;
  border-bottom: 1px solid #cbd5e1;
  border-right: 1px solid #e2e8f0;
  text-align: center;
  white-space: nowrap;
}

.panel-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e5e7eb;
  border-right: 1px solid #f1f5f9;
  text-align: center;
  vertical-align: middle;
}

.panel-table td.left {
  text-align: left;
}

.panel-table tbody tr {
  transition: background-color 0.14s ease;
}

.panel-table tbody tr:hover {
  background: #f0fdf4;
}

.panel-table tbody tr.row-active-leave {
  background: #fef2f2;
}

.status-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-tag.red {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #f87171;
}

.status-tag.amber {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fbbf24;
}

.status-tag.green {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.status-tag.gray {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.emp-status-banner {
  padding: 10px 14px;
  border-radius: 6px;
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: #166534;
  font-size: 13.5px;
  line-height: 1.5;
}

.emp-status-banner.empty {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

/* Single-Search Employee Picker on Tab "Nghỉ việc/ Nghỉ việc không lương" */
.retention-note-banner {
  padding: 9px 13px;
  border-radius: 6px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e40af;
  font-size: 13px;
  line-height: 1.45;
}

.emp-picker-box {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.emp-picker-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.emp-picker-row input {
  flex: 1;
  height: 38px;
  padding: 0 12px;
  border: 1.5px solid #9ec5ae;
  border-radius: 6px;
  font-family: var(--font-main);
  font-size: 14.5px;
  background: #ffffff;
  color: #111111;
}

.emp-picker-row input:focus {
  outline: 2px solid #86efac;
  border-color: var(--xl-green);
}

.emp-picker-results {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.emp-picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 13px;
  border: none;
  border-bottom: 1px solid #f1f5f9;
  background: #ffffff;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-main);
  font-size: 14px;
  color: #111827;
  transition: background-color 0.12s ease;
}

.emp-picker-item:last-child {
  border-bottom: none;
}

.emp-picker-item:hover,
.emp-picker-item.is-active {
  background: #ecfdf5;
}

.emp-picker-item-main,
.emp-picker-name {
  font-weight: 700;
  color: #0f172a;
}

.emp-picker-id-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  white-space: nowrap;
  flex-shrink: 0;
}

.emp-picker-item-sub {
  font-size: 12.5px;
  color: #475569;
  white-space: nowrap;
}

/* Ô tìm kiếm nhanh Tên + ID trên Tab Tính công NV */
.ts-search-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.ts-search-wrap .ribbon-search {
  padding-right: 28px;
  width: 220px;
}

.ts-search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #e2e8f0;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.ts-search-clear:hover {
  background: #cbd5e1;
  color: #0f172a;
}

.ts-search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 310px;
  max-width: 380px;
  max-height: 280px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
  z-index: 260;
  display: flex;
  flex-direction: column;
}

.ts-search-hdr {
  padding: 6px 12px;
  font-size: 11.5px;
  font-weight: 600;
  color: #475569;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

table.xl-sheet tr.xl-search-hidden {
  display: none !important;
}

.emp-picker-empty {
  padding: 12px 14px;
  color: #64748b;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.selected-emp-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-radius: 6px;
  border: 1.5px solid #86efac;
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  color: #14532d;
}

.selected-emp-card.empty {
  border-style: dashed;
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #64748b;
}

.selected-emp-meta {
  display: flex;
  align-items: center;
  gap: 10px 16px;
  flex-wrap: wrap;
  font-size: 14px;
}

.summary-controls {
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 960px) {
  .panel-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel-field.span-4 {
    grid-column: span 2;
  }
}

@media (max-width: 820px) {
  .panel-sheet-bg {
    padding: 10px 8px 20px;
  }

  .panel-card-header {
    padding: 10px 14px;
  }

  .panel-card-body {
    padding: 12px 14px 14px;
  }
}

@media (max-width: 640px) {
  .summary-controls {
    flex: 1 1 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 5px;
    padding-bottom: 2px;
  }

  .panel-sheet-bg {
    padding: 8px 6px 18px;
  }

  .panel-wrap {
    gap: 12px;
  }

  .panel-card {
    border-radius: 10px;
  }

  .panel-card-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px;
  }

  .panel-card-title {
    font-size: 15px;
  }

  .panel-card-sub {
    font-size: 12px;
  }

  .panel-card-body {
    padding: 10px;
    gap: 10px;
  }

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

  .panel-field.span-2,
  .panel-field.span-4 {
    grid-column: span 1;
  }

  .leave-filter-bar {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 6px;
  }

  .leave-month-select,
  .leave-date-wrap,
  .leave-date-input {
    width: 100%;
    min-width: 0;
    font-size: 12.5px;
  }

  .leave-filter-bar .ribbon-search {
    grid-column: span 2;
    width: 100% !important;
  }

  .leave-subtabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    padding: 5px;
  }

  .leave-subtab {
    justify-content: center;
    padding: 7px 6px;
    font-size: 12px;
    gap: 4px;
    white-space: nowrap;
  }

  .emp-picker-row {
    flex-wrap: wrap;
  }

  .emp-picker-row input {
    min-width: 100%;
  }

  .emp-picker-row .fx-card-btn {
    width: 100%;
    justify-content: center;
  }

  .panel-actions-row {
    flex-wrap: wrap;
    gap: 8px;
  }

  .panel-table {
    font-size: 12.5px;
  }

  .panel-table th,
  .panel-table td {
    padding: 6px 7px;
  }
}


/* ============================================================================
   CRISP UNIFIED LUCIDE-STYLE SVG ICONS (ZERO RAW WINDOWS EMOJIS)
   ============================================================================ */
.ui-ico {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: -2.5px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ui-ico.ico-sm {
  width: 13.5px;
  height: 13.5px;
}

.ui-ico.ico-lg {
  width: 17px;
  height: 17px;
}

.ui-ico.ico-ok {
  color: #16a34a;
}

.xl-autosave-badge .ui-ico.ico-ok {
  color: #86efac;
}

.xl-autosave-badge.saving .ui-ico {
  color: #fde68a;
}

.xl-autosave-badge.error .ui-ico {
  color: #fca5a5;
}

.ui-ico.ico-warn {
  color: #d97706;
}

.ui-ico.ico-err {
  color: #dc2626;
}

.ui-ico.ico-info {
  color: #2563eb;
}

.ui-ico.ico-teal {
  color: #0d9488;
}

.ui-ico.ico-purple {
  color: #7c3aed;
}

.ui-ico.ico-muted {
  color: #64748b;
}

.ui-ico.ico-spin {
  animation: seevSpin 0.9s linear infinite;
}

.ico-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

.ico-dot-red {
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.22);
}

.ico-dot-green {
  background: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18);
}

.ico-dot-amber {
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.xl-autosave-badge,
.xl-btn-export,
.xl-btn-gear,
.ribbon-btn,
.actual-readonly-badge,
.truc-date-label,
.modal-btn,
.fx-card-btn,
.panel-card-title,
.status-tag,
.autosave-inline-note,
.inline-label-ico,
.inline-title-ico,
.ntm-title,
.leave-subtab,
.xl-comment-tooltip-hdr,
.report-copy-btn,
.truc-alert-drawer-close {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.xl-btn-gear,
.truc-icon-btn,
.icon-btn {
  justify-content: center;
}

.emp-status-banner,
.retention-note-banner,
.drive-status-box {
  line-height: 1.55;
}

.emp-status-banner .ui-ico,
.retention-note-banner .ui-ico,
.drive-status-box .ui-ico {
  margin-right: 4px;
  vertical-align: -3px;
}

.toast {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.toast.hidden {
  display: none !important;
}

/* ============================================================================
   MODERN ANIMATED TAB-SWITCH LOADING SCREEN (SKELETON GRID + GLASS LOADER CARD)
   ============================================================================ */
.seev-loader-wrap {
  position: relative;
  min-height: calc(100vh - 210px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  overflow: hidden;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  animation: seevFadeIn 0.16s ease-out;
}

.seev-loader-skeleton {
  position: absolute;
  inset: 22px 26px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  opacity: 0.72;
  pointer-events: none;
}

.seev-skel-bar,
.seev-skel-row span {
  border-radius: 7px;
  background: linear-gradient(90deg, #e2e8f0 0%, #f1f5f9 38%, #e2e8f0 72%);
  background-size: 240% 100%;
  animation: seevShimmer 1.35s ease-in-out infinite;
}

.seev-skel-hdr {
  height: 36px;
  width: 100%;
  background: linear-gradient(90deg, #d1fae5 0%, #ecfdf5 42%, #d1fae5 78%);
  background-size: 240% 100%;
}

.seev-skel-row {
  display: grid;
  grid-template-columns: 0.5fr 2.2fr 1.1fr 1fr 1fr 1.4fr;
  gap: 10px;
  height: 30px;
}

.seev-skel-row:nth-child(2n) span {
  animation-delay: 0.14s;
}

.seev-skel-row:nth-child(3n) span {
  animation-delay: 0.28s;
}

.seev-loader-card {
  position: relative;
  z-index: 2;
  width: min(410px, 92%);
  padding: 26px 28px 24px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(16, 185, 129, 0.24);
  box-shadow:
    0 20px 48px rgba(15, 23, 42, 0.1),
    0 4px 14px rgba(16, 185, 129, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}

.seev-loader-orb {
  position: relative;
  width: 62px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.seev-loader-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(16, 185, 129, 0.15);
  border-top-color: #10b981;
  border-right-color: #0d9488;
  animation: seevSpin 0.85s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite;
}

.seev-loader-ring-inner {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 2.5px solid rgba(13, 148, 136, 0.12);
  border-bottom-color: #15803d;
  animation: seevSpinReverse 1.25s linear infinite;
}

.seev-loader-mark {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #0f766e;
  user-select: none;
}

.seev-loader-title {
  font-size: 15.5px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.seev-loader-sub {
  font-size: 13px;
  color: #475569;
  line-height: 1.45;
  max-width: 340px;
}

.seev-loader-track {
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  margin-top: 4px;
}

.seev-loader-fill {
  height: 100%;
  width: 44%;
  border-radius: 999px;
  background: linear-gradient(90deg, #10b981 0%, #0d9488 55%, #059669 100%);
  animation: seevProgressSlide 1.15s ease-in-out infinite;
}

@keyframes seevSpin {
  to { transform: rotate(360deg); }
}

@keyframes seevSpinReverse {
  to { transform: rotate(-360deg); }
}

@keyframes seevShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

@keyframes seevProgressSlide {
  0% { transform: translateX(-110%); }
  55% { transform: translateX(130%); }
  100% { transform: translateX(250%); }
}

@keyframes seevFadeIn {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

.xl-sheet-wrap,
.panel-sheet-bg,
.report-wrap {
  animation: seevFadeIn 0.14s ease-out;
}

/* ==================== PHASE 1-3: AUTH PILL, MONTH BANNER, LOCK BTN, MODALS & REPORT ALERTS ==================== */
.xl-auth-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  color: #ecfdf5;
  background: rgba(15, 23, 42, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.34);
  transition: background-color 0.16s ease, transform 0.12s ease;
  white-space: nowrap;
}
.xl-auth-pill:hover {
  background: rgba(15, 23, 42, 0.48);
  transform: translateY(-1px);
}
.xl-auth-pill.role-viewer {
  background: rgba(245, 158, 11, 0.25);
  border-color: rgba(251, 191, 36, 0.65);
  color: #fef3c7;
}

.month-status-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 7px 16px;
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 600;
  border-bottom: 1px solid #fde68a;
  background: #fffbeb;
  color: #92400e;
  flex-shrink: 0;
}
.month-status-banner.is-locked-only {
  background: #fef2f2;
  border-bottom-color: #fecaca;
  color: #991b1b;
}
.month-status-banner-items {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.month-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.month-status-chip.locked {
  color: #991b1b;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  border-radius: 999px;
  padding: 2px 10px;
  font-weight: 700;
}

.ts-lock-btn {
  border-color: #d97706 !important;
  color: #92400e !important;
  background: #fffbeb !important;
}
.ts-lock-btn:hover:not(:disabled) {
  background: #fef3c7 !important;
}
.ts-lock-btn.locked {
  border-color: #dc2626 !important;
  background: #fee2e2 !important;
  color: #991b1b !important;
  font-weight: 700;
}
.ts-lock-btn.locked:hover:not(:disabled) {
  background: #fecaca !important;
}

.confirm-modal-card {
  max-width: 460px;
  width: 92vw;
}
.login-modal-card {
  max-width: 420px;
  width: 92vw;
}
.confirm-modal-msg {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: #1e293b;
  white-space: pre-line;
}
.modal-btn-danger {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
  color: #ffffff !important;
  border-color: #b91c1c !important;
}
.modal-btn-danger:hover {
  filter: brightness(1.06);
}

/* Monthly Overview Alerts Card on Tab Báo cáo */
.report-monthly-alerts {
  margin-top: 16px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-top: 3px solid #0f766e;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}
.report-ma-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.report-ma-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}
.report-ma-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 680px) {
  .report-ma-grid {
    grid-template-columns: 1fr;
  }
}
.auth-pwd-grid {
  gap: 14px;
}
.report-ma-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  padding: 10px 12px;
}
.report-ma-box.warn {
  background: #fffbeb;
  border-color: #fde68a;
}
.report-ma-box.danger {
  background: #fef2f2;
  border-color: #fecaca;
}
.report-ma-box.ok {
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.report-ma-box-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.report-ma-box-body {
  font-size: 12.5px;
  color: #1e293b;
  line-height: 1.48;
}
.report-ma-list {
  margin: 4px 0 0;
  padding-left: 16px;
  max-height: 120px;
  overflow-y: auto;
}
.report-ma-list li {
  margin-bottom: 2px;
}

.auth-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  font-size: 13.5px;
  font-weight: 600;
  color: #0f172a;
}
.auth-toggle-row input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: #0f766e;
  cursor: pointer;
}

/* ==================== MULTI-USER ACCOUNT & PERMISSION MANAGEMENT UI ==================== */
.user-form-box {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 13px 14px;
  margin-top: 10px;
}
.user-form-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.user-form-row4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 980px) {
  .user-form-row4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.perm-section-label {
  font-size: 12.5px;
  font-weight: 700;
  color: #334155;
  margin: 10px 0 6px;
}
.perm-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}
@media (max-width: 1080px) {
  .perm-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.perm-chk-card {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 7px 9px;
  border-radius: 7px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  font-size: 12px;
  color: #1e293b;
  cursor: pointer;
  transition: border-color 0.14s ease, background-color 0.14s ease;
}
.perm-chk-card:hover {
  border-color: #0f766e;
  background: #f0fdfa;
}
.perm-chk-card input[type="checkbox"] {
  margin-top: 2px;
  accent-color: #0f766e;
  cursor: pointer;
  flex-shrink: 0;
}
.perm-chk-name {
  font-weight: 700;
  display: block;
  line-height: 1.28;
}
.perm-chk-desc {
  font-size: 11px;
  color: #64748b;
  display: block;
  margin-top: 1px;
  line-height: 1.25;
}
.perm-pills-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.perm-pill {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  white-space: nowrap;
}
.perm-pill.admin {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}
.perm-pill.muted {
  background: #f1f5f9;
  color: #64748b;
  border-color: #cbd5e1;
}
.change-pwd-details {
  margin-top: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: 12.5px;
}
.change-pwd-details summary {
  cursor: pointer;
  font-weight: 700;
  color: #0f766e;
}

/* ==================== CENTERED PERMISSION DENIED MODAL ==================== */
.perm-denied-dialog {
  max-width: 440px;
  width: 92vw;
}
.perm-denied-header {
  background: linear-gradient(135deg, #991b1b 0%, #dc2626 100%) !important;
}
.perm-denied-body {
  text-align: center;
  padding: 22px 22px 16px !important;
}
.perm-denied-icon-ring {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  margin: 0 auto 12px;
  background: #fef2f2;
  border: 2px solid #fecaca;
  color: #dc2626;
  display: flex;
  align-items: center;
  justify-content: center;
}
.perm-denied-msg {
  margin: 0 0 8px;
  font-size: 14.5px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.5;
}
.perm-denied-hint {
  margin: 0;
  font-size: 12.5px;
  color: #64748b;
  line-height: 1.48;
}
