:root {
  --excel-like-header-color: #000000;
  --excel-like-header: #e6f0ff;
  --excel-like-row-label: #d9ead3;
  --excel-like-row-label-hover: #e0f2e0;
  --excel-like-row-hover: #f9f9f9;
  --excel-like-cell-hover: #fff2cc;
  --excel-like-border: #d0d0d0;
  --excel-like-border-focus: #65ec70;
  --excel-like-background: #ffffff;
  --excel-like-shadow: rgba(0, 0, 0, 0.5);
}

body {
  font-family: Arial, sans-serif;
  margin: 40px;
  background-color: #f3f3f3;
}

.excel-like {
  border-collapse: collapse;
  width: 100%;
  max-width: 600px;
  background-color: var(--excel-like-background);
  box-shadow: 0 0 10px var(--excel-like-shadow);
}

.excel-like th {
  color: var(--excel-like-header-color);
}

.excel-like th,
.excel-like td {
  border: 1px solid var(--excel-like-border);
  padding: 10px;
  text-align: left;
  position: relative;
}

.excel-like th {
  background-color: var(--excel-like-header);
  font-weight: bold;
  text-align: center;
}

/* Automatically style first <td> in non-header rows for tables with .row */
.excel-like.row tr:not(:first-child) td:first-child {
  background-color: var(--excel-like-row-label);
  font-weight: bold;
  text-align: center;
}

.excel-like.row tr:hover td:first-child {
  background-color: var(--excel-like-row-label-hover) !important;
}

.excel-like tr:hover td {
  background-color: var(--excel-like-row-hover);
}

.excel-like td:hover {
  background-color: var(--excel-like-cell-hover) !important;
}

.excel-like .corner-cell {
  padding: 0;
  position: relative;
  background: none;
}

.excel-like .corner-cell .top-half,
.excel-like .corner-cell .bottom-half {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 0;
}

/* Diagonal from bottom-left to top-right */
.excel-like .corner-cell .top-half {
  background-color: var(--excel-like-header);
  clip-path: polygon(0% 0%, 100% 0%, 100% 100%);
}

.excel-like .corner-cell .bottom-half {
  background-color: var(--excel-like-row-label);
  clip-path: polygon(0% 0%, 0% 100%, 100% 100%);
}

td.focus{
  border: 2px solid var(--excel-like-border-focus);
  background-color: #ffffff;
}
/* Tighten vertical spacing for spreadsheet-like tables when applied to the table element */
table.excel-tight th,
table.excel-tight td {
  /* keep horizontal padding from base rule; only reduce vertical spacing */
  padding-top: 0.15rem;
  padding-bottom: 0.15rem;
  line-height: 1.2;
}

.bold {
  font-weight: bold;
}