*,
*:after,
*:before {
  box-sizing: border-box;
}

:root {
  --dark-color: #333e48;
  --link-color: #069;
  --border-color: #ccc;
  --shade-color: #eee;
}

select,
input,
th,
button,
textarea {
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
}

body {
  font-family: "Roboto", "Noto Sans", sans-serif;
  padding: 0;
  margin: 0;
  font-size: 16px;
  color: var(--dark-color);
}

a {
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

h1 {
  font-size: 28px;
}

p {
  margin: 5px auto;
}

select,
input {
  border: 1px solid var(--border-color);
  border-radius: 3px;
}
input {
  padding: 3px 6px;
}
select {
  display: inline;
  width: auto;
  padding: 2px;
}
.Link {
  background: none !important;
  border: none;
  padding: 0 !important;
  cursor: pointer;
  color: var(--link-color);
  text-align: left;
}
.Link:hover {
  text-decoration: underline;
}
.sLink {
  background: none !important;
  border: none;
  padding: 0 !important;
  cursor: pointer;
  color: var(--link-color);
  vertical-align: -20%;
  font-size: inherit;
  font-weight: inherit;
}
.sLink:hover {
  text-decoration: underline;
}
input::placeholder,
textarea::placeholder {
  color: var(--border-color);
}

/***************** Element specific stuff *****************/
#body {
  display: flex;
  flex-direction: column;
  max-height: 100vh;
  padding: 10px 0 0 0;
}
#body > * {
  flex: 0 0 auto;
}
#body > .MainSpace {
  flex: 0 1 auto;
  overflow-y: hidden;
}

.MainSpace {
  display: flex;
  flex-flow: row;
  padding: 0;
  max-width: 100vw;
  justify-content: space-between;
}
.MainSpace > * {
  flex: 0 0 auto;
}
.MainSpace > .Results {
  margin: 10px;
  flex: 0 1 auto;
  overflow: hidden;
}
.MainSpace > .Results > .Scroller {
  max-width: 100%;
  max-height: 100%;
  overflow: auto;
}
.MainSpace > .FieldsList {
  margin: 10px 0 10px 10px;
}

.ModelSelector {
  margin: 0 auto;
  text-align: center;
  text-align-last: center;
  border: none;
  padding: 1px;
  font-size: 28px;
  color: var(--dark-color);
}
.ModelSelector:hover {
  border: 1px solid var(--border-color);
  border-radius: 3px;
  padding: 0;
}

/* Filters */

.Filters {
  margin: 0 auto;
  display: flex;
  align-items: center;
  flex-direction: column;
}
.Filters p {
  margin: 5px;
}
select.FilterValue,
input.FilterValue {
  width: 100%;
}
.FilterValue.Half {
  width: 50%;
}
select.Lookup {
  width: 100%;
}
.Filters table,
.Filters table.Flat th,
.Filters table.Flat td {
  border: none;
  padding: 3px 1px;
}

/* Fields */

.FieldsList {
  margin: 0;
  overflow-y: auto;
}
.FieldsList table {
  border: 1px solid var(--border-color);
  border-radius: 3px;
}
.FieldsList tbody,
.FieldsList th,
.FieldsList td {
  border: none;
  vertical-align: top;
}
.FieldsList th,
.FieldsList td {
  padding: 0px;
  padding: 1px;
}
.FieldsList td {
  text-align: left;
}

/* Results */
.Results {
  position: relative;
}
.Results .Freeze {
  position: sticky;
  top: 2px;
}
.Results th {
  background-color: var(--shade-color);
}
.Results .Scroller,
.Results th,
.Results td {
  border: 1px solid var(--border-color);
  border-radius: 2px;
}
.Results tr {
  line-height: 120%;
}
.Results th,
.Results td {
  padding: 5px;
}
.Results td.number,
.Results td.time {
  text-align: right;
}
.Results td.Empty {
  border: none;
}
.Results td.HoriBorder,
.Results th.HoriBorder {
  border-top: 2px solid black;
  /*border-bottom: 1px solid black;*/
}
.Results td.LeftBorder,
.Results th.LeftBorder {
  border-left: 2px solid black;
}
.Results th {
  text-align: center;
}

/* Logo */

a.Logo {
  position: absolute;
  margin: 0 15px;
  font-size: 40px;
  font-family: "Anton", sans-serif;
  cursor: pointer;
  color: var(--dark-color);
}
a.Logo > span {
  display: inline-block;
}
a.Logo > span.Version {
  font-size: 20px;
}

/* Index Page */

div.Index {
  margin: 30px;
}
div.Index > div {
  width: 46%;
  float: left;
  color: var(--dark-color);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  margin: 30px 2% 0 2%;
  padding: 0 2% 2% 2%;
}
div.Index .Link {
  display: inline-block;
  font-size: 20px;
}

/* Edit View */

.EditSavedView {
  margin: 50px auto 30px auto;
}
.EditSavedView .SavedViewTitle {
  font-weight: bold;
  font-size: 28px;
}
.EditSavedView form {
  border: 1px solid var(--border-color);
  border-radius: 3px;
  padding: 15px 15px 12px 15px;
}
.EditSavedView .SavedViewName {
  font-size: 20px;
  width: 100%;
}
.EditSavedView textarea {
  border: 1px solid var(--border-color);
  border-radius: 3px;
  padding: 10px;
  min-width: 500px;
  width: 100%;
  min-height: 100px;
}
.EditSavedView th {
  padding: 2px;
  font-weight: bold;
  text-align: left;
}
.EditSavedView td {
  padding: 2px;
}
.EditSavedView table {
  padding: 5px 2px;
}
.SavedViewActions {
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
td.SavedViewLimit {
  padding: 0px;
}

input.RowLimit {
  padding: 1px 3px;
  width: 100px;
}

.CopyToClipboard {
  font-size: 13px;
}

.Overlay {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  pointer-events: none;
}

.Fade {
  opacity: 0.3;
}

.Error {
  color: red;
}

.ContextMenu {
  position: fixed;
  background: white;
  border: 1px solid var(--border-color);
  padding: 10px;
  box-shadow: 3px 3px 10px var(--dark-color);
}

.ContextMenu p {
  padding: 5px;
  margin: 0px;
}
