/* Standard Tables */

table {
  border-collapse: collapse;
  width:100%;
}

caption {
  text-align: left;
  font-style: italic;
  padding: 0.25em 0.5em 0.5em 0.5em;
}

th,
td {
  padding:8px;
  line-height:20px;
  text-align:right;
  vertical-align:top;
  border-top:1px solid #dddddd;
  text-indent: -0.5em;
}

th {
  background-color: #666;
  color: #fff;
}

tr:nth-child(even) th[scope=row] {
  background-color: #f2f2f2;
}

tr:nth-child(odd) th[scope=row] {
  background-color: #fff;
}

tr:nth-child(even) {
  background-color: rgba(0, 0, 0, 0.05);
}

tr:nth-child(odd) {
  background-color: rgba(255, 255, 255, 0.05);
}

th:nth-of-type(1) {
  text-align: center;
}

th:nth-of-type(12) {
  font-style: italic;
}

td:nth-of-type(11) {
  font-style: italic;
}

/* Fixed Headers */

.sticktop {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 2;
}

th {
  position: -webkit-sticky;
  position: sticky;
  top: 51px; /* ให้ตรึงต่อจากแถบเมนู */
  z-index: 2;
}

th[scope=row] {
  position: -webkit-sticky;
  position: sticky;
  left: 0;
  z-index: 1;
}

th[scope=row] {
  vertical-align: top;
  color: inherit;
  background-color: inherit;
  background: linear-gradient(90deg, transparent 0%, transparent calc(100% - .05em), #d6d6d6 calc(100% - .05em), #d6d6d6 100%);
}

th:not([scope=row]):first-child {
  left: 0;
  z-index: 3;
  background: linear-gradient(90deg, #666 0%, #666 calc(100% - .05em), #ccc calc(100% - .05em), #ccc 100%);
}

/* Scrolling wrapper */

div[tabindex="0"][aria-labelledby][role="region"] {
  overflow: auto;
}

div[tabindex="0"][aria-labelledby][role="region"]:focus {
  box-shadow: 0 0 .5em rgba(0,0,0,.5);
  outline: .1em solid rgba(0,0,0,.1);
}

div[tabindex="0"][aria-labelledby][role="region"] table {
  margin: 0;
}

div[tabindex="0"][aria-labelledby][role="region"].rowheaders {
  background:
    linear-gradient(to right, transparent 30%, rgba(255,255,255,0)),
    linear-gradient(to right, rgba(255,255,255,0), white 70%) 0 100%,
    radial-gradient(farthest-side at 0% 50%, rgba(0,0,0,0.2), rgba(0,0,0,0)),
    radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,0.2), rgba(0,0,0,0)) 0 100%;
  background-repeat: no-repeat;
  background-color: #fff;
  background-size: 4em 100%, 4em 100%, 1.4em 100%, 1.4em 100%;
  background-position: 0 0, 100%, 0 0, 100%;
  background-attachment: local, local, scroll, scroll;
}

div[tabindex="0"][aria-labelledby][role="region"].colheaders {
	background:
		linear-gradient(white 30%, rgba(255,255,255,0)),
		linear-gradient(rgba(255,255,255,0), white 70%) 0 100%,
		radial-gradient(farthest-side at 50% 0, rgba(0,0,0,.2), rgba(0,0,0,0)),
		radial-gradient(farthest-side at 50% 100%, rgba(0,0,0,.2), rgba(0,0,0,0)) 0 100%;
	background-repeat: no-repeat;
	background-color: #fff;
	background-size: 100% 4em, 100% 4em, 100% 1.4em, 100% 1.4em;
	background-attachment: local, local, scroll, scroll;
}

/* Strictly for making the scrolling happen. */

th[scope=row] {
  min-width: 40vw;
}
  
th[scope=row] + td {
  min-width: 0em;
}

/* div[tabindex="0"][aria-labelledby][role="region"]:nth-child(3) {
  max-height: 18em;
} */

div[tabindex="0"][aria-labelledby][role="region"]:nth-child(4) {
  max-height: 91%;
}

@media all and (min-width: 0em) {
  th[scope=row] {
    min-width: 0em;
  }
}