* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-size: 14px;
  color: #333;
}

body {
  display: flex;
  flex-direction: column;
  padding: 0 10px;
  align-items: center;
  font-family: Arial, Helvetica, sans-serif;
  background: url("./bg.jpg");
}

body > *:not(#backdrop) {
  width: 100%;
  min-width: 320px;
  max-width: 960px;
}

header {
  margin-top: 15px;
  text-align: center;
  font-size: 25px;
  font-weight: bold;
}

nav {
  display: flex;
  margin-top: 10px;
}

nav > a {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 13px;
  line-height: 24px;
  color: #fff;
  font-size: 16px;
  text-transform: uppercase;
  text-decoration: none;
  background-color: #600;
  border-radius: 5px;
  margin: 0 5px;
}

nav > a > * {
  color: #fff;
}

nav > a.logout {
  flex: unset;
}

nav > a > span.label {
  display: block;
  margin-left: 5px;
}
nav > a > span.mobile {
  display: none;
}

nav > a:hover {
  background-color: #000;
}
nav > a.active {
  background-color: #4caf50;
}

@media screen and (max-width: 600px) {
  nav > a {
    flex-direction: column;
    text-align: center;
  }

  nav > a > i {
    font-size: 30px;
  }

  nav > a > span {
    font-size: 12px;
  }

  nav > a.logout {
    display: none;
  }

  nav > a > span.label {
    display: none;
  }
  nav > a > span.mobile {
    display: block;
    line-height: 16px;
    margin-top: 8px;
  }
}

ul.messages li {
  margin-top: 10px;
  padding: 10px 20px;
  border: 2px solid #666;
  border-radius: 6px;
  background-color: #f8f8f4;
}

ul.messages li.success {
  background-color: #dfd;
}

ul.messages li.error {
  background-color: #fdd;
}

section {
  margin-top: 10px;
  padding: 20px;
  border: 2px solid #666;
  border-radius: 6px;
  background-color: #f8f8f4;
}

section > h1 {
  border-radius: 3px;
  padding: 10px;
  background-color: #333;
  color: #fff;
  font-size: 18px;
  text-transform: uppercase;
}
section > h1 * {
  color: #fff;
  font-size: 18px;
  text-transform: uppercase;
}

li {
  list-style: none;
}

form > ul > li {
  margin-top: 10px;
  display: flex;
  flex-direction: row;
  align-items: center;
}


form > ul > li > label {
  width: 100px;
}

form > ul > li:has(input[type="checkbox"]) {
  flex-direction: row-reverse;
}

form > ul > li:has(input[type="checkbox"]) > label {
  flex: 1;
  padding-left: 10px;
}

form > ul > li > input[type="checkbox"] {
  margin-left: 100px;
  width: inherit;
}

form > ul > li > input:not([type="checkbox"]),
form > ul > li > textarea,
form > ul > li > select {
  flex: 1;
  max-width: 400px;
}

input,
select,
textarea {
  padding: 5px 10px;
  border-radius: 2px;
  border: 1px solid #ccc;
  width: 100%;
  font-family: Arial, Helvetica, sans-serif;
}

.errorlist * {
  color: #f00;
  font-weight: bold;
}
ul.errorlist ~ label,
ul.errorlist ~ input,
ul.errorlist ~ select {
  color: #f00;
  border-color: #f00;
}

.helptext {
  font-size: 12px;
  color: #666;
}

ul.buttons {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  margin-top: 10px;
}

ul.buttons > li {
  padding: 0 5px;
}

ul.buttons a.button,
ul.buttons button {
  margin: 0;
}

a.button,
button {
  margin: 20px 0;
  width: 100%;
  background: #4caf50;
  padding: 10px 30px;
  border-radius: 2px;
  border: none;
  color: #fff;
  font-weight: bold;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.button.cancel {
  background-color: #600;
}

a.logout-button {
  display: inline-block;
  background-color: #600;
  color: #fff;
  font-weight: bold;
  border-radius: 4px;
  padding: 4px;
  border-radius: 4px;
}

/* fancy table */

table.fancyTable a:link:not(.button) {
  color: #666;
  text-decoration: none;
}
table.fancyTable a:visited:not(.button) {
  color: #666;
  text-decoration: none;
}
table.fancyTable a:active,
table.fancyTable a:hover {
  color: #666;
}
table.fancyTable {
  margin-top: 10px;
  font-size: 16px;
  background: #eaebec;
  border: #ccc 1px solid;
  border-radius: 3px;
  box-shadow: 0 1px 2px #d1d1d1;
}
table.fancyTable th {
  padding: 10px;
  border-top: 1px solid #fafafa;
  border-bottom: 1px solid #e0e0e0;
  background: linear-gradient(#ededed, #ebebeb);
}
table.fancyTable tr:first-child th:first-child {
  border-top-left-radius: 3px;
}
table.fancyTable tr:first-child th:last-child {
  border-top-right-radius: 3px;
}
table.fancyTable tr {
  padding-left: 20px;
}
table td:first-child {
  text-align: left;
  padding-left: 20px;
  border-left: 0;
}
table.fancyTable td {
  padding: 10px;
  border-top: 1px solid #ffffff;
  border-bottom: 1px solid #e0e0e0;
  border-left: 1px solid #e0e0e0;
  background: linear-gradient(#fbfbfb, #fafafa);
}
table.fancyTable tr.even td {
  background: linear-gradient(#f8f8f8, #f6f6f6);
}
table.fancyTable tr:last-child td {
  border-bottom: 0;
}
table.fancyTable tr:last-child td:first-child {
  border-bottom-left-radius: 3px;
}
table.fancyTable tr:last-child td:last-child {
  border-bottom-right-radius: 3px;
}
table.fancyTable tr:hover td {
  background: #d0dafd;
}

.scroll-container {
  overflow-x: auto;
}

#backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 100;
}

#backdrop.in {
  display: block;
}

#backdrop > #modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #fff;
  border-radius: 4px;
  padding: 20px;
  z-index: 101;
}

@media screen and (max-width: 600px) {
  body {
    padding: 0;
  }

  section {
    padding: 10px;
    border-left: none;
    border-right: none;
    border-radius: 0;
  }

  table.fancyTable td,
  table.fancyTable th {
    padding: 2px;
  }

  table.month td {
    font-size: 10px;
    height: 50px;
  }

  #backdrop > #modal {
    left: 5px;
    right: 5px;
    transform: translate(0, -50%);
  }
}

@media screen and (min-width: 601px) {
  a.button,
  button {
    width: inherit;
  }

  ul.buttons {
    flex-direction: row;
    justify-content: flex-start;
  }
}


/* printable media */
@media print {
  body {
    padding: 0;
    background: none;
  }

  header {
    margin-top: 0;
  }

  body > section {
    border: none;
    background: none;
  }

  body > header,
  nav,
  section#resident {
    display: none;
  }

  section > h1 {
    color: #000;
  }

  #backdrop {
    display: none;
  }
}