/* Globals */
* {
  box-sizing: border-box;
}

html,
body {
  background-color: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  margin: 0;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

table pre {
  background-color: inherit;
  border: 0;
  margin: 0;
  overflow: inherit;
  padding: 0;
}

tbody tr:nth-child(2n) {
  background-color: var(--color-sidebar-background);
}

tbody td {
  border: 1px solid var(--color-table-border);
}

td,
th {
  padding: 2px 6px;
  white-space: nowrap;
}

td.num,
th.num {
  color: var(--color-text);
  font-family: var(--font-family-monospaced);
  text-align: right;
  width: 7em;
}

thead th,
tfoot td {
  background-color: var(--color-table-header-background);
  border: 1px solid var(--color-table-header-background);
  color: var(--color-table-header-text);
  font-weight: 400;
}

p,
ol,
ul,
dl,
table,
pre,
hr {
  list-style-type: none;
  margin: 0 0 1rem;
  padding: 0;
}

h2,
h3,
h4,
h5 {
  color: var(--color-headings);
  font-weight: 500;
  margin: 0 .5rem 1rem 0;
  padding: 0;
}

h2 { font-size: 1.2857em; }

h3 {
  font-size: 1.1429em;
}

h3 button {
  font-size: 1rem;
  font-weight: normal;
  padding: 4px 8px;
}

h4,
h5 {
  font-size: 1em;
}

hr {
  border: 1px solid var(--color-background-darker);
}

b,
strong {
  font-weight: 500;
}

a {
  text-decoration: none;
}

a:hover,
a:focus {
  color: var(--color-links-hover);
}

a:link,
a:visited {
  color: var(--color-links);
}

a:active,
a:focus,
a img {
  border: 0;
  outline: none;
}

dl {
  margin: 0;
}

code,
pre {
  background-color: var(--color-code-background);
  border: 1px solid var(--color-background-darker);
  border-radius: 3px;
  font-family: var(--font-family-monospaced);
  white-space: pre;
}

code {
  line-height: 1;
  padding: 0 4px;
}

pre {
  overflow: auto;
  padding: 6px 10px;
}

pre code {
  border: 0;
  line-height: inherit;
  margin: 0;
  padding: 0;
}

/* fake fieldsets to work around browser bugs with <fieldset> */
.fieldset {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
}

button,
input,
textarea {
  font: inherit;
  margin: 0 .5em .5em 0;
}

input,
textarea {
  border: 1px solid var(--color-background-darkest);
  padding: 6px 10px;
}

label {
  margin: 0 .5em .5em 0;
}

select {
  font-size: inherit;
  margin: 0 .5em 0 0;
}

input:invalid {
  border: 1px solid var(--color-error);
}

input[type='text']::-webkit-calendar-picker-indicator {
  display: none;
}

input[type='date']::-webkit-inner-spin-button,
input[type='date']::-webkit-clear-button {
  -webkit-appearance: none;
  display: none;
}

button,
.button {
  background-color: var(--color-header);
  border: 0;
  border-radius: 0;
  color: var(--color-background);
  cursor: pointer;
  outline: 0;
  padding: 6px 10px;
}

button:focus,
button:active,
button:hover,
.button:focus,
.button:active,
.button:hover {
  background-color: var(--color-header-darker);
  box-shadow: 0 0 5px var(--color-header);
}

button:disabled,
button.inactive,
button.muted,
.button:disabled,
.button.inactive,
.button.muted {
  background-color: var(--color-background-darker);
  color: var(--color-text);
}

button:disabled:focus,
button:disabled:active,
button:disabled:hover,
button.inactive:focus,
button.inactive:active,
button.inactive:hover,
button.muted:focus,
button.muted:active,
button.muted:hover,
.button:disabled:focus,
.button:disabled:active,
.button:disabled:hover,
.button.inactive:focus,
.button.inactive:active,
.button.inactive:hover,
.button.muted:focus,
.button.muted:active,
.button.muted:hover {
  box-shadow: 0 0 5px var(--color-background-darker);
  filter: brightness(90%);
}

button.link,
.button.link {
  background: none;
  color: var(--color-links);
  margin: 0;
  padding: 0;
}

button.link:focus,
button.link:active,
button.link:hover,
.button.link:focus,
.button.link:active,
.button.link:hover {
  box-shadow: none;
  filter: brightness(90%);
}

button.round,
.button.round {
  border-radius: 15px;
  height: 1.5em;
  padding: 0 .5em;
}

.button:link,
.button:visited {
  color: var(--color-background);
  height: 100%;
}

.hidden.hidden {
  display: none;
}

/* Structural and generic elements */
:root {
  --header-height: 50px;
  --aside-width: 160px;
  --transitions: all .2s ease-out;
}

body {
  padding: var(--header-height) 0 0 var(--aside-width);
  transition: var(--transitions);
}

header {
  align-items: center;
  background-color: var(--color-header);
  color: var(--color-header-text);
  display: flex;
  height: var(--header-height);
  left: 0;
  padding: 0 7px 0 10px;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: var(--z-index-header);
}

.aside-button {
  background-color: var(--color-sidebar-background);
  display: none;
  transition: var(--transitions);
  z-index: var(--z-index-floating-ui);
}

.aside-button:hover {
  background-color: var(--color-sidebar-background);
}

aside {
  background-color: var(--color-sidebar-background);
  border-right: 1px solid var(--color-sidebar-border);
  bottom: 0;
  color: var(--color-sidebar-text);
  left: 0;
  margin: 0;
  overflow-y: auto;
  padding-top: .5rem;
  position: fixed;
  top: var(--header-height);
  transition: var(--transitions);
  width: var(--aside-width);
  z-index: var(--z-index-aside);
}

aside h3 {
  font-size: .9em;
  margin: 1em 0 1em 20px;
  opacity: .6;
  text-transform: uppercase;
}

.navigation {
  border-bottom: 1px solid var(--color-sidebar-border);
  margin-bottom: .5rem;
  padding-bottom: .5rem;
}

.navigation:last-child {
  border: none;
  margin-bottom: 0;
}

.navigation a {
  color: inherit;
  display: block;
  padding: 4px 5px 4px 20px;
}

.navigation a.selected,
.navigation a:hover {
  background-color: var(--color-sidebar-border);
  color: var(--color-sidebar-text-hover);
}

.navigation .secondary {
  background-color: var(--color-sidebar-background);
  color: inherit;
  line-height: 23px;
  padding: 4px 9px 2px 9px;
  transition: var(--transitions);
}

.navigation .add-transaction-button {
  font-size: 23px;
}

.navigation li {
  display: flex;
  flex-wrap: wrap;
  position: relative;
}

.navigation li a:first-child {
  flex: 1;
}

.navigation .error {
  background-color: var(--color-error);
}

.navigation .error a {
  color: var(--color-sidebar-background);
}

.navigation .error a.selected,
.navigation .error a:hover {
  background-color: var(--color-error);
  filter: brightness(80%);
}

.navigation .error .bubble {
  background-color: var(--color-transparent-white);
}

.navigation .bubble {
  background-color: var(--color-sidebar-border);
  border-radius: 12px;
  color: var(--color-sidebar-text);
  float: right;
  font-size: .9em;
  padding: 0 8px;
}

.submenu {
  width: 100%;
}

.submenu li {
  font-size: .95em;
  line-height: .95em;
}

.submenu a {
  padding-left: 35px;
}

.submenu a.selected,
.submenu a:hover {
  filter: brightness(85%);
}

article {
  height: 100%;
  padding: 1.5em;
  position: relative;
  width: 100%;
}

.wide-form {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  margin-bottom: .5em;
  width: 100%;
}

.wide-form .small {
  margin-left: -6px;
}

.wide-form > span {
  margin-right: .5em;
}

.dragover { background-color: var(--color-links-transparent); }

.headerline {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  margin: 0 0 1em;
}

.headerline h3 {
  display: inline-block;
  margin: 0 1.5em 0 0;
}

.headerline a {
  color: var(--color-text-lighter);
}

.headerline a:hover {
  color: var(--color-text);
}

kbd {
  background-color: var(--color-background);
  border: solid 1px var(--color-background-darker);
  border-bottom-color: var(--color-background-darkest);
  border-radius: 3px;
  box-shadow: inset 0 -1px 0 var(--color-background-darkest);
  color: var(--color-text-lighter);
  display: inline-block;
  font: .8em var(--font-family-monospaced);
  margin: 0 1px;
  padding: 3px 6px;
}

.keyboard-tooltip {
  background-color: var(--color-text);
  color: var(--color-background);
  display: inline-block;
  font-size: .9em;
  opacity: .9;
  padding: .3em .5em;
  position: absolute;
  text-align: center;
  z-index: var(--z-index-keyboard-overlays);
}

/*
 * Components
 */

.spacer {
  flex-grow: 1;
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin: -10px -20px;
  padding: 5px;
}

.column {
  flex: 1;
  margin: 5px;
}

.column h3 {
  text-align: center;
}

.left {
  float: left;
  margin-right: 20px;
}

.right {
  float: right;
}

.status-indicator {
  border-radius: 6px;
  display: inline-block;
  height: 6px;
  margin: 5px;
  width: 6px;
}

.status-indicator:hover {
  cursor: pointer;
}

.status-indicator.status-red {
  background-color: var(--color-status-red);
}

.status-indicator.status-yellow {
  background-color: var(--color-status-yellow);
}

.status-indicator.status-green {
  background-color: var(--color-status-green);
}

.status-indicator.status-gray {
  background-color: var(--color-status-gray);
}

[data-sort] {
  cursor: pointer;
  padding-right: 18px;
  position: relative;
}

[data-order='desc']::after {
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--color-text-lightest);
  content: '';
  display: block;
  position: absolute;
  right: 4px;
  top: 12px;
}

[data-order='asc']::after {
  border-bottom: 5px solid var(--color-text-lightest);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  content: '';
  display: block;
  position: absolute;
  right: 4px;
  top: 10px;
}

/*
 * View-specific and tables
 */

.options td {
  text-align: left;
}

.options td:nth-child(1) {
  font-weight: 500;
}

.options td:nth-child(2) {
  white-space: normal;
}

.statistics-update-activity .indicator-header {
  padding-left: 0;
}

.statistics-update-activity .uptodate-indicator {
  text-align: center;
}

.statistics-update-activity .status-indicator {
  margin: 0 auto;
}

td .status-indicator {
  float: right;
  margin-left: 3px;
  margin-top: 3px;
}

.autocomplete {
  background-color: var(--color-background);
  border: 1px solid var(--color-background-darkest);
  box-shadow: 0 3px 3px var(--color-background-darker);
  overflow-x: hidden;
  overflow-y: auto;
  z-index: var(--z-index-autocomplete);
}

.autocomplete li {
  cursor: pointer;
  min-width: 8rem;
  padding: 0 .5em;
  white-space: nowrap;
}

.autocomplete li.selected,
.autocomplete li:hover {
  background-color: var(--color-links);
  color: var(--color-background);
}

.autocomplete li span::before {
  background-color: var(--color-autocomplete-match);
  border-radius: 2px;
  content: "";
  height: 1.2em;
  margin-left: -.1em;
  margin-top: .12em;
  position: absolute;
  width: .65em;
  z-index: -1;
}

.autocomplete:empty {
  display: none;
}
