body, html{
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  color: #333;
  background: #eee;
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  overflow-y: hidden;
}
button {
  background: none;
  border: none;
}
body > header{
  background: #333;
  height: 50px;
  color: white;
  display: flex;
  align-items: center;
  padding: 0 5px;
}
body > header > div {
  flex: 1;
  font-size: 1.5em;
}
body > header > button {
  color: white;
  font-weight: bold;
}
#ent-summary th,
#ent-summary header{
  background: rgb(10, 4, 65);
}
#ent-summary button:hover{
  background: rgb(52, 39, 165);
}
#ent-summary{
  grid-column: span 8;
}
#ent-piece{
  grid-column: span 10;
}
/* #ent-piece.closed{
  grid-column: span 3;
} */
#ent-room{
  grid-column: span 3;
}
/* #ent-room.closed{
  grid-column: span 2;
} */
#ent-sensor{
  grid-column: span 8;
}
/* #ent-sensor.closed{
  grid-column: span 2;
} */
#ent-appearance{
  grid-column: span 8;
}
/* #ent-appearance.closed{
  grid-column: span 3;
} */

body > main{
  padding: 3px;
  overflow-y: auto;
  display: grid;
  grid-auto-flow: dense;
  grid-gap: 5px;
  grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
  grid-auto-rows: minmax(min-content, max-content);
  height: 100%;
}
footer{
  padding: 3px;
}
button {
  font-weight: bold;
  min-width: 40px;
}
.entity {
  display: inline-flex;
  vertical-align: top;
  flex-direction: column;
  margin-bottom: 5px;
}
.entity > header {
  display: flex;
  border-radius: 5px 5px 0px 0px;
  margin-bottom: 0px;
  background: #666;
  color: white;
}
.entity > header > h2{
  padding: 5px;
  font-weight: 300;
  font-size: 1.3em;
  flex: 1;
  margin: 0px;
}
.entity > header > :last-child {
  border-radius: 0px 5px 0px 0px;
}
.entity > header > button {
  color: white;
  cursor: pointer;
}
.entity > header > button:hover {
  background-color: #333;
}
.entity > main {
  display: flex;
  overflow-y: auto;
  max-height: 1000px;
}

.entity > main, table {
  -webkit-transition: all .3s linear;
  -moz-transition: all .3s linear;
  -o-transition: all .3s linear;
  transition: all .3s linear;
}

.entity.closed > main {
  max-height: 0;
}
table {
  transform: translateY(0);
}
.closed table {
  transform: translateY(-100%);
}
.closed > h2{
  border-radius: 5px;
}
th{
  font-weight: 400;
  background: #666;
}
th{
  padding: 7px;
}
td{
  border-bottom: 1px solid #ddd;
  padding: 3px 10px;
}
thead{
  color: white;
}
table{
  border-collapse: collapse;
  border-radius: 0px 0px 5px 5px;
  background-color: white;
  overflow-y:auto;
  width: 100%; margin-bottom: 0; display: table;
}
.closed table{
  /* display: none; */
}
.closed .btn-hide{
  display: none;
}
.closed .btn-show, .closed .btn-update{
  display: block;
}
.btn-show, .closed .btn-update{
  display: none;
}

tbody > tr:hover {
  background: #efefef;
  background-blend-mode: difference;
  cursor: pointer;
}
tbody > tr.new:hover {
  background: rgb(133, 219, 133);
}
.new{
  background: lightgreen;
  
}
.new td{
  border-bottom: 1px solid rgb(111, 223, 111);
}
