/* General. */

body {
  min-width: 1200px;
}

pre {
  color: #666;
  white-space: pre-wrap;
}

/* Typography. */

.red,
.low,
.low a {
  color: #b94a48 !important;
}

.green {
  color: #468847;
}

.blue {
  color: #3a87ad;
}

.highlight {
  background-color: #fcf8e3;
}

a.no-deco {
  text-decoration: none;
}

/* Fieldset. */

fieldset {
  border: none;
  margin: 0;
  padding: 0;
}

fieldset.center {
  text-align: left;
  margin: 0 auto 0 auto;
}

fieldset.width-600 {
  width: 600px;
}

fieldset.width-600 .row > div {
  width: 180px;
}

fieldset.width-600 .row > div + div {
  width: 400px;
}

fieldset.width-600 .right {
  margin-left: 200px;
}

/* Input fields/buttons. */

input {
   -webkit-appearance: none;
}

select,
textarea,
input[type=text],
input[type=email],
input[type=password],
input[type=datetime-local],
input[type=date],
#stripe-card {
  color: #666;
  margin: 0;
  padding: 2px 5px 2px 5px;
  border: 1px solid #e1e1e1;
  border-radius: 2px;
  height: 20px;
  width: calc(100% - 12px);
  max-width: 250px;
}

#stripe-card {
  background-color: white;
}

textarea {
  max-width: 80%;
  min-height: 5em;
  color: #888;
}

input.number {
  max-width: 100px;
}

input[type=datetime-local],
input[type=date] {
  margin: 0;
  width: auto;
}

input.narrow {
  max-width: 30px;
}

input.narrow-80 {
  max-width: 80%;
}

input.narrow + input.narrow {
  margin-left: 30px;
}

select {
  font-size: 12px;
  background-color: white;
  height: 26px;
  max-width: 262px;
}

select[multiple] {
  height: auto;
}

select[multiple] option {
  color: #666;
}

select.narrow {
  width: auto;
}

input[type=checkbox] {
  -webkit-appearance: checkbox;
  background-color: #e1e1e1;
  border: 1px solid #e1e1e1;
}

input[type=submit],
a.button {
  color: #f05a23;
  background-color: white;
  margin: 10px 0 10px 0;
  padding: 2px 20px 2px 44px;
  border: 1px solid #e1e1e1;
  border-radius: 2px;
  height: 26px;
  background-position: 20px 50%;
  box-shadow: 1px 1px 3px rgba(200, 200, 200, 0.4);
  cursor: pointer;
}

td > input[type=submit] {
  margin: 0;
}

a.button {
  display: inline-block;
  line-height: 24px;
  height: 24px;
  padding-top: 0;
  padding-bottom: 0;
}

a.button.disabled {
  color: #ccc;
  cursor: default;
}

a.arrow {
  font-size: 12px;
  text-decoration: none;
  padding: 0 2px 0 2px;
}

input::-moz-focus-inner {
  border: 0;
  padding: 0;
}

input.error {
  border-color: #eed3d7;
}

select:disabled,
input[type=submit]:disabled {
  opacity: 0.5;
}

select + input[type=text],
input[type=submit] + input[type=submit] {
  margin-left: 10px;
}

/* Form labels. */

label {
  line-height: 26px;
}

label.error {
  color: #b94a48;
}

label.mandatory:after {
  position: relative;
  content: "*";
  padding: 0 0 0 3px;
  top: 0;
  right: 0;
}

label.small {
  font-size: 12px;
}

/* Row. */

.row {
  margin: 10px 0 10px 0;
}

.row:not(.right) {
  display: flex;
  align-items: center;
}

.row > div {
  text-align: right;
  margin: 0 10px 0 0;
}

.row > div + div {
  text-align: left;
  margin: 0 0 0 10px;
}

/* Tables. */

th {
  text-align: left;
}

tr.status.hidden,
tr.status.inactive,
tr.status.remove {
  display: table-row;
  opacity: 0.5;
}

td.strike,
tr.status.inactive td:not(.edit),
tr.status.remove td {
  text-decoration: line-through;
}

tr.expands:hover {
  cursor: pointer;
}

tr.expands:nth-child(4n-1) {
  background-color: rgb(245, 245, 245);
}

tr.expands + tr {
  display: none;
}

td pre {
  line-height: normal;
  font-size: 0.9em;
}

td.edit a,
td.phone a,
td.graph a {
  display: block;
  text-decoration: none;
}

td.right,
th.right {
  text-align: right;
  padding-right: 2em;
}

/* Alerts. */

div.alert {
  border-radius: 4px;
  border: 1px solid;
  margin: 20px 0 20px 0;
  padding: 0 20px 0 50px;
  background-position: 20px 50%;
  background-repeat: no-repeat;
}

div.alert:first-child {
  margin-top: 0;
}

div.alert.error {
  background-color: #f2dede;
  border-color: #eed3d7;
  background-image: url("../graphics/icons/alert-error.svg");
  background-size: 16px 16px;
}

div.alert.error p,
div.alert.error p a {
  color: #b94a48;
}

div.alert.warning {
  background-color: #fcf8e3;
  border-color: #fbeed5;
  background-image: url("../graphics/icons/alert-warning.svg");
  background-size: 10px 16px;
}

div.alert.warning.spinner {
  background-image: url("../graphics/icons/alert-warning-spinner.svg");
  background-size: 16px 16px;
}

div.alert.warning p,
div.alert.warning p a {
  color: #c09853;
}

div.alert.success {
  background-color: #dff0d8;
  border-color: #d6e9c6;
  background-image: url("../graphics/icons/alert-success.svg");
  background-size: 16px 16px;
}

div.alert.success p,
div.alert.success p a {
  color: #468847;
}

div.alert.info {
  background-color: #d9edf7;
  border-color: #bce8f1;
  background-image: url("../graphics/icons/alert-info.svg");
  background-size: 16px 16px;
}

div.alert.info p,
div.alert.info p a {
  color: #3a87ad;
}

/* Header search. */

div.logo .search {
  position: absolute;
  top: 28px;
  right: 20px;
}

div.logo .search input {
  margin: 0;
  height: 40px;
  width: 150px;
  background-image: url("../graphics/icons/search.svg");
  background-repeat: no-repeat;
  background-size: 18px auto;
  background-position: 10px center;
  padding: 2px 10px 2px 40px;
  border: 1px solid #eee;
}

/* Panel. */

div.panel {
  position: relative;
  border-top: 1px solid #e1e1e1;
}

div.panel > div {
  float: left;
  box-sizing: border-box;
  -moz-box-sizing: border-box;
  padding: 0 20px 20px 20px;
  min-height: 400px;
  background-image: -ms-linear-gradient(bottom, white, #f5f5f5);
  background-image: -webkit-linear-gradient(bottom, white, #f5f5f5);
  background-image: -moz-linear-gradient(bottom, white, #f5f5f5);
}

div.panel > div.left {
  width: 20%;
  border-right: 1px solid #e1e1e1;
}

div.panel > div.right {
  width: 80%;
  background-image: -ms-linear-gradient(top, white, #f5f5f5);
  background-image: -webkit-linear-gradient(top, white, #f5f5f5);
  background-image: -moz-linear-gradient(top, white, #f5f5f5);
}

/* Sub menu. */

nav.sub-menu ol li {
  float: none;
  line-height: 28px;
  white-space: nowrap;
}

/* View menu. */

nav.view-menu {
  position: absolute;
  right: 20px;
  top: 20px;
}

nav.view-menu ol li {
  width: 20px;
  height: 20px;
  margin-left: 10px;
}

nav.view-menu ol li a {
  display: block;
  width: 100%;
  height: 100%;
}

/* Data source type icons. */

.temp figure,
.temp-probe figure {
  background-size: 20px auto;
  background-position: 50% 0px;
  background-image: url("../graphics/icons/temp.svg");
}

.cold figure {
  background-image: url("../graphics/icons/temp-cold.svg");
}

.humi figure,
.humi-probe figure,
.moisture figure {
  background-size: 20px auto;
  background-position: 50% 5px;
  background-image: url("../graphics/icons/humi.svg");
}

.humi.wet figure,
.humi-probe.wet figure {
  background-image: url("../graphics/icons/humi-wet.svg");
}

.water figure {
  background-size: 26px auto;
  background-position: 50% 5px;
  background-image: url("../graphics/icons/water.svg");
}

.water.wet figure {
  background-image: url("../graphics/icons/water-wet.svg");
}

.co2 figure,
.voc figure {
  background-size: 35px auto;
  background-position: 50% 8px;
  background-image: url("../graphics/icons/co2.svg");
}

.binary figure {
  background-size: 35px auto;
  background-position: 50% 8px;
  background-image: url("../graphics/icons/binary.svg");
}

.binary.on figure {
  background-image: url("../graphics/icons/binary-on.svg");
}

.baro figure {
  background-size: 30px auto;
  background-position: 50% 2px;
  background-image: url("../graphics/icons/baro.svg");
}

.batt.high {
  background-image: url("../graphics/icons/battery-high.svg");
}

.batt.mid {
  background-image: url("../graphics/icons/battery-mid.svg");
}

.batt.low {
  background-image: url("../graphics/icons/battery-low.svg");
}

.wireless.high {
  background-image: url("../graphics/icons/wireless-high.svg");
}

.wireless.mid {
  background-image: url("../graphics/icons/wireless-mid.svg");
}

.wireless.low {
  background-image: url("../graphics/icons/wireless-low.svg");
}

/* Other icons. */

.graph {
  background-image: url("../graphics/icons/graph.svg");
}

.download {
  background-image: url("../graphics/icons/download.svg");
}

.img.list {
  background-image: url("../graphics/icons/list.svg");
}

.img.list.selected {
  background-image: url("../graphics/icons/list-on.svg");
}

.img.grid {
  background-image: url("../graphics/icons/grid.svg");
}

.img.grid.selected {
  background-image: url("../graphics/icons/grid-on.svg");
}

.img.fullscreen {
  background-image: url("../graphics/icons/fullscreen.svg");
  background-size: 90%;
}

.img.fullscreen.selected {
  background-image: url("../graphics/icons/fullscreen-on.svg");
}

.img.shared {
  background-image: url("../graphics/icons/shared.svg");
}

.img.calibration,
.img.qualification {
  background-image: url("../graphics/icons/calibration.svg");
}

.img.wf {
  background-image: url("../graphics/icons/wf.svg");
}

.img.matrix {
  background-image: url("../graphics/icons/matrix.svg");
}

/* Table cell icons. */

td.online,
td.offline,
td.alarm,
td.note,
td.edit,
td.calibration,
td.phone,
td.graph {
  background-repeat: no-repeat;
  background-size: auto 16px;
  background-position: center;
}

.online {
  background-image: url("../graphics/icons/tick.svg");
}

td.offline {
  background-image: url("../graphics/icons/cross.svg");
}

td.alarm {
  background-size: 18px 18px;
}

.alarm.in {
  background-image: url("../graphics/icons/alarm-in.svg");
}

.alarm.out {
  background-image: url("../graphics/icons/alarm-out.svg");
}

.note {
  background-image: url("../graphics/icons/note.svg");
}

.note.empty {
  background-image: url("../graphics/icons/note-empty.svg");
}

.edit {
  background-image: url("../graphics/icons/edit.svg");
}

.calibration.active {
  background-image: url("../graphics/icons/calibration-active.svg");
}

.calibration.expired {
  background-image: url("../graphics/icons/calibration-expired.svg");
}

.calibration.ended {
  background-image: url("../graphics/icons/calibration-ended.svg");
}

.phone {
  background-image: url("../graphics/icons/phone-gray.svg");
}

.phone.yellow {
  background-image: url("../graphics/icons/phone-yellow.svg");
}

/* Flags. */

.flag {
  display: inline-block;
  width: 20px;
  margin: 0 10px 2px 10px;
  vertical-align: middle;
}

td > .flag {
  margin-left: 0;
}

/* Data overview. */

#overview .gateway + .gateway {
  margin-top: 40px;
}

h2.img,
h3.img {
  background-size: auto 100% !important;
  background-position: left;
  padding-left: 30px;
}

/* Data overview (common sensor section). */

section.sensor {
  border-bottom: 1px solid #e1e1e1;
}

section.sensor.alarm {
  background-image: none;
}

section.sensor:last-child {
  border-bottom: none;
}

/* Data overview (common data source section). */

section.data-source {
  position: relative;
  float: left;
  width: 460px;
  margin: 0 0 20px 0;
}

section.data-source figure {
  width: 50px;
  height: 50px;
}

section.data-source h5 {
  margin: 0;
  max-width: 200px;
}

section.data-source div {
  position: absolute;
  top: 0;
  left: 80px;
  width: 360px;
}

section.data-source time,
ol.tools li,
ol.tools li a {
  font-size: 12px;
  color: #999;
}

section.data-source p.value {
  position: absolute;
  top: 0;
  right: 80px;
  margin: 0;
  font-size: 25px;
  line-height: 30px;
}

section.data-source.offline p {
  text-decoration: line-through;
}

/* Data overview (grid view). */

.grid section.gateway,
.grid section.sensor,
.grid section.sensor section.group {
  display: flex;
  flex-flow: row wrap;

  display: -webkit-flex;
  -webkit-flex-flow: row wrap;
}

.grid section.gateway > :not(.sensor),
.grid section.sensor  > :not(.data-source) {
  flex: 1 100%;
  -webkit-flex: 1 100%;
  margin-top: 0;
  min-width: 0;
}

.grid section.sensor {
  width: 180px;
  margin: 10px 20px 10px 0;
  padding: 20px;
  background-color: #dff0d8;
  border: 1px solid #d6e9c6;
  border-radius: 4px;
  text-align: center;
}

.grid section.sensor.offline {
  background-color: #fcf8e3;
  border-color: #fbeed5;
}

.grid section.sensor h4 {
  font-size: 18px;
  line-height: 20px;
  margin: 0;
  text-transform: uppercase;
  color: #666;
  word-wrap: break-word;
}

.grid section.sensor time {
  font-size :12px;
  padding-top: 10px;
  text-transform: uppercase;
  align-self: flex-end;
  -webkit-align-self: flex-end;
}

.grid section.sensor time a {
  color: #666;
  text-decoration: none;
}

.grid section.data-source {
  margin: 0;
}

.grid section.data-source p {
  position: static;
  font-family: "digi";
}

.grid section.data-source:nth-of-type(1) p {
  font-size: 50px;
  line-height: 80px;
}

.grid section.data-source:nth-of-type(n+2) {
  width: 50%;
}

.grid section.data-source:nth-of-type(even):last-of-type {
  width: 100%;
}

/* Data overview (grid view with alarm). */

.grid section.sensor.alarm {
  -webkit-animation: pulse 1s linear;
  animation: pulse 1s linear;
}

@keyframes pulse {
  0% { transform: scale(1); }

  10%, 20% { transform: scale(0.9) rotate(-3deg); }

  30%, 50%, 70%, 90% { transform: scale(1.1) rotate(3deg); }

  40%, 60%, 80% { transform: scale(1.1) rotate(-3deg); }

  100% { transform: scale(1) rotate(0); }
}

@-webkit-keyframes pulse {
  0% { -webkit-transform: scale(1); }

  10%, 20% { -webkit-transform: scale(0.9) rotate(-3deg); }

  30%, 50%, 70%, 90% { -webkit-transform: scale(1.1) rotate(3deg); }

  40%, 60%, 80% { -webkit-transform: scale(1.1) rotate(-3deg); }

  100% { -webkit-transform: scale(1) rotate(0); }
}

.grid section.sensor.alarm {
  background-color: #f2dede;
  border: 1px solid #eed3d7;
}

/* Fullscreen. */

:fullscreen {
  overflow-y: scroll;
}

:-webkit-full-screen {
  position: relative;
  width: 100% !important;
  height: 100%;
  overflow-y: scroll;
}

:-moz-full-screen {
  overflow-y: scroll;
}

:-ms-full-screen {
  overflow-y: scroll;
}

.fullscreen nav.view-menu,
.fullscreen ol.paginator {
  display: none;
}

/* Tools. */

ol.tools {
  clear: both;
  margin: 0 0 20px 15px;
}

ol.tools li {
  background-position: left center;
  background-size: 20px auto;
  padding: 0 30px 0 30px;
}

/* Data overview (alarm bell). */

#overview a.alarm {
  position: absolute;
  top: -20px;
  right: 50px;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  background-color: #eee;
  border: 1px solid #ddd;
  background-repeat: no-repeat;
  background-size: 16px auto;
  background-position: center;
}

/* Sensor et al. list navigation. */

nav.list {
  margin: 0 0 30px 0;
}

nav.list ol {
  margin: 0 0 10px 0;
}

nav.list li.title,
nav.list li:after {
  color: #777;
}

nav.list li:after {
  content: "\0000a0/\0000a0";
}

nav.list li.title:after {
  content: ":\0000a0";
}

nav.list li:last-child:after {
  content : "";
}

/* Highchart. */

#chart {
  min-height: 400px;
  margin: 20px 0 10px 0;
}

/* Chart options. */

#chart + section {
  width: 100%;
  border-top: 1px dotted #e1e1e1;
}

#chart + section > ol.tools {
  float: left;
  margin: 10px 0 0 0;
}

#chart + section > div {
  float: right;
}

/* Date selector. */

nav.date-selector {
  margin: 20px 0 20px 0;
}

ol.selector,
ol.prev-next {
  float: left;
}

ol.inputs {
  float: right;
}

ol.selector li {
  background-color: #eee;
  width: 26px;
  height: 26px;
  line-height: 26px;
  text-align: center;
  margin: 0 10px 0 0;
  border-radius: 3px;
  font-size: 12px;
}

ol.selector li a {
  display: inline-block;
  width: 100%;
}

ol.selector li.selected {
  background-color: #f05a23;
}

ol.selector li.selected a {
  color: white;
}

ol.selector li a,
ol.prev-next li a {
  text-decoration: none;
}

ol.prev-next {
  margin: 0 0 0 20px;
}

nav.date-selector input,
a.button {
  font-size: 12px;
  margin: 0 0 0 10px;
}

nav.date-selector input[type=submit],
a.button {
  padding-left: 20px;
}

nav.date-selector input[type=datetime-local] {
  text-align: center;
}

/* Paginator. */

ol.paginator {
  position: absolute;
  right: 20px;
}

ol.paginator li:first-child {
  width: auto;
  background-color: transparent;
  color: #999;
}

ol.paginator li:last-child {
  margin: 0;
}

/* Impersonating footer warning. */

#impersonating {
  position: fixed;
  bottom: 0;
  width: 100%;
  max-width: none;
  background-color: #fcf8e3;
  border-top: 1px solid #fbeed5;
  text-align: center;
  opacity: 0.9;
}

#impersonating p,
#impersonating p a {
  color: #c09853;
}

/* Badge. */

a:visited span.badge {
  outline: 0;
}

span.badge {
  display: inline-block;
  background-color: #d9edf7;
  border: 1px solid #bce8f1;
  border-radius: 4px;
  margin: 0 0 0 10px;
  padding: 1px 6px;
  color: #3a87ad;
  font-size: 10px;
  line-height: 18px;
  text-transform: uppercase;
}

span.badge.left {
  margin-left: 0;
}

span.badge.green {
  background-color: #dff0d8;
  border-color: #d6e9c6;
  color: #468847;
}

span.badge.yellow {
  background-color: #fcf8e3;
  border-color: #fbeed5;
  color: #c09853;
}

span.badge.red {
  background-color: #f2dede;
  border-color: #eed3d7;
  color: #b94a48;
}

span.badge.subtle {
  background-color: #f5f5f5;
  border-color: #e1e1e1;
  color: #888;
}

/* Logs. */

.log.notify,
.log.time {
  color: #468847;
}

.log.net {
  color: #f05a23;
}

.log.cfg {
  color: #b94a48;
}

.log.cmd {
  color: #3a87ad;
}

.log.file {
  color: #c09853;
}

.log.auth {
  color: #888;
}

/* Notes table. */

.notes {
  padding: 0 1em;
}

.notes td {
  vertical-align: top;
  width: 50%;
}

.notes td:last-child > div {
  height: 180px;
  overflow-y: scroll;
}

.notes td:last-child div {
  border-bottom: 1px solid #ddd;
}

.notes td:last-child div:last-child {
  border-bottom: none;
}

.notes div div:first-child p:first-child {
  margin-top: 0;
}

/* Stepper. */

.stepper > section {
  display: flex;
  flex-direction: column;
}

.stepper > section > div {
  display: flex;
  gap: 20px;
}

.stepper > section > div > .indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 30px;
}

.stepper > section > div > .indicator > .symbol {
  align-self: stretch;
  height: 30px;
  clip-path: circle();
}

.stepper > section > div > .indicator > .line {
  flex: 1;
  width: 1px;
}

.stepper > section:not(.pending) > .status {
  cursor: pointer;
}

.stepper > section > .status > .summary {
  align-self: center;
}

.stepper > section:not(.selected) > .main {
  display: none;
}

.stepper > section > .main > .content {
  flex: 1;
  margin-top: -1.3em;
}

.stepper > section.completed > div > .indicator > .symbol {
  background: url("../graphics/icons/stepper-check-mark.svg") no-repeat center / 40%;
}

.stepper > section.completed > div > .indicator > .symbol,
.stepper > section.completed div > .indicator > .line {
  background-color: #468847;
}

.stepper > section.in-progress > div > .indicator > .symbol,
.stepper > section.in-progress div > .indicator > .line {
  background-color: #3a87ad;
}

.stepper > section.pending > div > .indicator > .symbol,
.stepper > section.pending div > .indicator > .line {
  background-color: #ccc;
}