/* Excel-like sheet grid. Plain table, grid lines like the workbook. */
.page:has(> .xl-frame) {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}

.xl-frame {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #fff;
  font-family: Calibri, Carlito, 'Segoe UI', Arial, sans-serif;
}

.xl-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  background: #f2f2f2;
  border-bottom: 1px solid #d4d4d4;
}

.xl-search {
  min-width: 200px;
  padding: 3px 8px;
  font: inherit;
  font-size: 15px;
  border: 1px solid #a6a6a6;
  border-radius: 2px;
}

/* formula bar */
.xl-fbar {
  display: flex;
  align-items: stretch;
  height: 28px;
  border-bottom: 1px solid #d4d4d4;
  background: #fff;
  font-size: 15px;
}
.xl-fbar__name {
  width: 90px;
  padding: 0 8px;
  line-height: 28px;
  border-right: 1px solid #d4d4d4;
  background: #fff;
}
.xl-fbar__fx {
  width: 32px;
  line-height: 28px;
  text-align: center;
  font-style: italic;
  color: #217346;
  border-right: 1px solid #d4d4d4;
}
.xl-fbar__content {
  flex: 1;
  min-width: 0;
  padding: 0 8px;
  line-height: 28px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* scroll box */
.xl-scroll {
  overflow: auto;
  height: calc(100vh - 230px);
  min-height: 240px;
  background: #fff;
  outline: none;
}
.xl-scroll:focus-visible {
  box-shadow: inset 0 0 0 2px #217346;
}

.xl-grid {
  zoom: var(--xl-zoom, 1);
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 15px;
  color: #000;
}
/* Only the column-header rows and the total row stay frozen; letters + title rows scroll away. */
.xl-grid .xl-thead-fix {
  position: sticky;
  top: 0;
  z-index: 5;
}
.xl-grid thead tr {
  background: #fff;
}
.xl-grid th,
.xl-grid td {
  box-sizing: border-box;
  padding: 0 4px;
  border-right: 1px solid #d4d4d4;
  border-bottom: 1px solid #d4d4d4;
  background: #fff;
}

/* column letters and row-number gutter */
.xl-letters th,
.xl-gutter,
.xl-corner {
  background: #e6e6e6;
  color: #444;
  font-size: 12px;
  font-weight: 400;
  text-align: center;
  height: 20px;
  user-select: none;
}
.xl-gutter {
  z-index: 3;
  padding: 0;
}
.xl-corner {
  z-index: 6;
}
tbody .xl-gutter {
  z-index: 2;
}
.is-selrow .xl-gutter {
  background: #d3f0e0;
  color: #217346;
  font-weight: 700;
}

/* title + header rows */
.xl-title__cell {
  height: 32px;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
}
.xl-head__cell {
  background: #f2f2f2;
  font-weight: 700;
  text-align: center;
  white-space: normal;
  overflow: visible;
  padding: 2px 4px;
  position: relative;
}
.xl-head__text {
  display: inline-block;
}
.xl-head .xl-head__cell {
  border-color: #bfbfbf;
}

/* totals */
.xl-total td {
  background: #e2f0d9;
  font-weight: 700;
  height: 26px;
}
.xl-total .xl-gutter {
  background: #e6e6e6;
}

/* body cells */
.xl-cell {
  height: 24px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 15px;
  position: relative;
}
.xl-cell.k-money,
.xl-cell.k-int,
.xl-cell.k-dec {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.xl-cell.k-mark,
.xl-cell.k-date {
  text-align: center;
}
.xl-cell.al-left {
  text-align: left;
}
.xl-cell.al-center {
  text-align: center;
}
.xl-cell.al-right {
  text-align: right;
}
.xl-cell.is-weekend {
  background: #ececec;
}
.xl-cell.mk-x {
  color: #000;
}
.xl-cell.mk-p {
  color: #c00000;
}
.xl-cell.mk-b {
  color: #0047ab;
}
.xl-cell.is-editable {
  cursor: cell;
}
.xl-cell.is-sel {
  outline: 2px solid #217346;
  outline-offset: -2px;
  z-index: 1;
}
.xl-cell.is-pending {
  opacity: 0.55;
  font-style: italic;
}
.xl-cell.is-error::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  border-top: 8px solid #d00000;
  border-left: 8px solid transparent;
}
.xl-tip {
  position: absolute;
  left: 0;
  top: 100%;
  z-index: 20;
  padding: 3px 8px;
  background: #fffbd0;
  border: 1px solid #8a7a00;
  color: #000;
  font-size: 13px;
  font-style: normal;
  white-space: nowrap;
}

/* autofilter */
.xl-af {
  position: relative;
  display: inline-block;
  margin-left: 2px;
  vertical-align: middle;
}
.xl-af__btn {
  width: 18px;
  height: 18px;
  padding: 0;
  font-size: 11px;
  line-height: 16px;
  color: #333;
  background: #fff;
  border: 1px solid #a6a6a6;
  cursor: pointer;
}
.xl-af__btn.is-active {
  color: #217346;
  border-color: #217346;
  font-weight: 700;
}
.xl-af__menu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 30;
  width: 240px;
  padding: 6px;
  text-align: left;
  font-weight: 400;
  background: #fff;
  border: 1px solid #8c8c8c;
  box-shadow: 2px 3px 8px rgb(0 0 0 / 25%);
}
.xl-af__search {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 4px;
  padding: 3px 6px;
  font: inherit;
  font-size: 14px;
  border: 1px solid #a6a6a6;
}
.xl-af__list {
  max-height: 260px;
  overflow: auto;
  border: 1px solid #d4d4d4;
}
.xl-af__item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  font-size: 14px;
  cursor: pointer;
}
.xl-af__item:hover {
  background: #e2f0d9;
}

/* status bars */
.xl-selbar,
.xl-statusbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding: 2px 10px;
  font-size: 13px;
  color: #333;
  background: #f2f2f2;
  border-top: 1px solid #d4d4d4;
}
.xl-selbar__msg {
  color: #9c0006;
  font-weight: 700;
}
.xl-statusbar__legend {
  margin-left: auto;
}

/* pager */
.xl-pager {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.xl-pager__btn {
  min-width: 26px;
  padding: 0 6px;
  text-align: center;
  color: #000;
  text-decoration: none;
  background: #fff;
  border: 1px solid #a6a6a6;
}
.xl-pager__btn.is-disabled {
  color: #999;
}
.xl-pager__page {
  padding: 0 6px;
}

@media print {
  @page {
    size: A4 landscape;
    margin: 10mm;
  }
  .xl-fbar,
  .xl-selbar,
  .xl-toolbar,
  .xl-pager,
  .xl-af,
  .xl-letters,
  .xl-gutter,
  .xl-corner {
    display: none !important;
  }
  .xl-scroll {
    height: auto;
    overflow: visible;
  }
  .xl-grid {
    zoom: 1;
    table-layout: auto;
    width: 100% !important;
    font-size: 10pt;
  }
  .xl-grid thead {
    position: static;
    display: table-header-group;
  }
  .xl-grid th,
  .xl-grid td {
    position: static !important;
    border: 1px solid #000;
    background: #fff !important;
  }
  .xl-grid tr {
    break-inside: avoid;
  }
  .xl-cell.is-sel {
    outline: none;
  }
}
