table {
  background-color: #fff;
  border: 1px solid #000;
  border-bottom: 0px solid #000;
}
th {
  background-color: #fff;
  border-right: 1px solid #000;
  border-bottom: 1px solid #000;
}
td {
  background-color: #fff;
  border-right: 1px solid #000;
  border-bottom: 1px solid #000;
}
.nborder {
  background-color: #09f;
  color: #fff;
  border-right: 1px;
  border-right: 1px solid #000;
  text-align: left;
  font-weight: bold;
  border-bottom: 1px;
  border-bottom: 1px solid #000;
}

.df {
  background-color: #fff;
}
.fa {
  background-color: #fc9;
}
.ha {
  background-color: #ff9;
}
.fs {
  background-color: #cfc;
}
.hs {
  background-color: #6ff;
}
.bt {
  background-color: #c9c;
}
.xtd {
  background-color: #6c0;
}
.ph {
  background-color: #f00;
}
.wk {
  background-color: #999;
  color: #900;
}
.lastcell {
  border-right-style: hidden;
}

/* Normal screen padding for the Name column */
table.leave-calendar-table td:first-child {
  padding-left: 8px;
}

/* --- LEAVE CALENDAR PRINT OPTIMIZATION --- */
@media print {
  /* 1. Force A4 Landscape to maximize horizontal space */
  @page {
    size: A4 landscape;
    margin: 8mm;
  }

  /* 2. Hide UI controls natively */
  .printbtn,
  .selectbtn {
    display: none !important;
  }

  /* 3. Force printers to render leave-type background colors */
  body,
  table,
  th,
  td {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* 4. Mathematically lock table width to the page bounds */
  table.leave-calendar-table {
    width: 100% !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
  }

  /* 5. Shrink fonts and clip overflowing text to prevent column stretching */
  table.leave-calendar-table td,
  table.leave-calendar-table th {
    padding: 1px !important;
    font-size: 8px !important;
    white-space: nowrap;
    overflow: hidden;
  }

  /* 6. Optimized Name Column: Allow text wrapping and allocate slightly more width */
  table.leave-calendar-table td:first-child,
  table.leave-calendar-table th:first-child {
    width: 135px !important;
    white-space: normal !important;
    word-break: break-word !important;
    line-height: 1.1 !important;
    overflow: visible !important;
  }
}
