/*---- COMMON ----*/

html, body { margin: 0; padding: 0; }

body { 
  height: 100vh;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  font: normal 1rem sans-serif;
  background-color: var(--back-primary);
  color: var(--color-primary);
  overscroll-behavior: none;
}

hr { width: 100%; border: none; border-top: 1px solid var(--border-secondary); }
li.right { text-align: right; }
  
a { color: var(--link-normal); text-decoration: none; }

a.button{
  height: 50px;
  padding: 10px 20px;
  text-align: center;
  font-size: 0.8rem;
  border: none;
  background-color: transparent;
  color: var(--button-color);
  cursor: pointer;
  vertical-align: middle;
}

button {
  height: 50px;
  padding: 10px 20px;
  font-size: 0.8rem;
  border: none;
  border-radius: 8px;
  background-color: transparent;
  color: var(--button-color);
  cursor: pointer;
}


/*
button[type="submit"]{
  min-width: 180px;
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid var(--button-border);
  background-color: var(--button-back);
  color: var(--button-color);
  cursor: pointer;
}

button.delete{
  min-width: 180px;
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid var(--button-border-delete);
  background-color: var(--button-back-delete);
  color: var(--button-color-delete);
  cursor: pointer;
}
*/
button:disabled{
/*  border: 1px solid var(--button-border-disabled);*/
/*  background-color: var(--button-back-disabled);*/
  color: var(--button-color-disabled);
  cursor: auto;
}

button.icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid var(--border-primary);
}

button.search {
  width: 45px;
  min-width: 45px;
  margin-right: -45px;
  /*border-radius: 8px;*/
  /*border: 1px solid #ccc;*/
  /*border-left: none;*/
}

button.outline {
  height: auto;
/*  margin: 10px;*/
  padding: 12px 20px;
  border: 1px solid var(--border-primary);
}

button.outline:hover {
  background-color: var(--button-back);
}


hbar {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.hflex {
  display: inline-flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

hbar.right {
  justify-content: flex-end;
  align-items: center;
}

hbar.start {
  justify-content: flex-start;
}

hbar.foot {
  align-items: flex-start;
}

hbar.doctop {
  justify-content: space-between;
  align-items: flex-start;
}

vbar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

vbar.center {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

vbar.left {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
}

vbar.full {
  width: 100%;
}

toolbar {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  height: 80px;
  margin: 0;
  padding: 20px 40px 0;
/*  border-bottom: 1px solid #ccc;*/
/*  background-color: #eee;*/
}

toolbar h1 {
/*  margin-left: 20px;*/
  font-weight: 400;
}

toolbar a {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  height: 50px;
  padding: 10px 20px;
  text-align: center;
  font-size: 0.9rem;
  border: none;
  background-color: transparent;
  color: var(--button-color);
  vertical-align: middle;
  cursor: pointer;
}

toolbar a span {
  display: inline-block;
  margin-left: 10px;
  font-size: 0.9rem;
}

toolbar button {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  height: 50px;
  padding: 10px 20px;
  text-align: center;
  font-size: 0.9rem;
  border: none;
  background-color: transparent;
  color: var(--button-color);
  vertical-align: middle;
  cursor: pointer;
}

toolbar button:disabled {
  color: var(--button-color-disabled);
  cursor: auto;
}

toolbar button span {
  display: inline-block;
  margin-left: 10px;
  font-size: 0.9rem;
}

actions {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
/*  margin-bottom: 20px;*/
}

action {
  display: inline-block;
/*  height: 50px;*/
  margin: 0 10px;
  padding: 5px;
  border: 1px solid #666;
  border-radius: 6px;
}

main {
  display: flex;
  min-height: 100vh;
  height: 100vh;
  width: 100%;
  flex-direction: column;
  justify-content: space-between;
  background-color: var(--back-primary);
}

main.dark {
  background-color: var(--back-secondary);
}

content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  width: 100%;
  max-height: 100vh;
  padding: 20px 40px 40px;
  overflow-y: scroll;
}

panelTop { display: flex; flex-direction: row; justify-content: space-between; align-items: flex-end; }
panelMed { display: flex; flex-direction: row; justify-content: space-between; align-items: flex-end; margin-top: 100px; }
panelBot { display: flex; flex-direction: row; justify-content: space-between; align-items: flex-end; }

sheet { display:block; margin-bottom: 30px; padding: 40px; /*border: 1px solid #444; border-radius: 8px; background-color: var(--back-secondary); color: var(--color-primary);*/ }

calendar {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  width: 300px;
  height: auto;
  margin-right: 10px;
  border: 1px solid #666;
  border-radius: 6px;
}

calendar .prev, calendar .next {
  min-width: auto;
  width: 50px;
  height: auto;
  margin: 0px;
  padding: 0;
}

calendar .month {
  width: 100%;
  height: auto;
  margin: 0x;
  padding: 10px;
  text-align: center;
  border-left: 1px solid #666;
  border-right: 1px solid #666;
  font-size: 1rem;
}

.iconClick { cursor: pointer; }
.itemLink { display: block; }

warn { display: block; visibility: hidden; padding: 5px 20px; color: var(--color-note); background-color: var(--back-note); text-align: center; }
warn.warn { color: var(--color-warn); background-color: var(--back-warn); }

.bold { font-weight: bold; }

/*
main {
  container-type: scroll-state;
  container-name: scroller;
}

@container scroller scroll-state(scrollable: top) {
  toolbar {
    position: fixed;
    background-color: #fff;
    border-bottom: 1px solid #ccc;
    box-shadow: 0 0 10px #0004;
  }
}
*/

/*
content {
  container-type: scroll-state;
  container-name: sticky-heading;
}

@container sticky-heading scroll-state(stuck: top) {
  toolbar {
    position: fixed;
    border-bottom: 1px solid #ccc;
    box-shadow: 0 5px 2px #0007;
  }
}
*/

.options { }
.options input[type="radio"] {
  display: none;
}
.options input[type="radio"]:checked + label {
  background-color: var(--back-selected);
  color: var(--color-primary);
}
.options label {
  display: inline-block;
  padding: 10px;
  border: 1px solid var(--border-secondary);
  border-radius: 3px;
  color: var(--color-primary);
  cursor: pointer;
}

.statusNone { color: #379; }
.statusPend { color: orange; }
.statusOver { color: red; }
.statusPaid { color: blue; }
.statusSent { color: green; }
.statusVoid { color: black; }


.settings {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-start;
}

.settings options {
  display: block;
  width: 200px;
  margin: 10px;
}

.settings options li {
  width: 200px;
  list-style: none;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}

.settings options li:hover {
  background-color: #00000011;
  border: 1px solid var(--border-secondary);
  border-radius: 8px;
}

.settings options li.selected {
  background-color: var(--back-selected);
  border: 1px solid var(--border-secondary);
  border-radius: 8px;
}

.settings options li.empty, .settings options li.empty:hover {
  background-color: transparent;
  border: none;
  cursor: auto;
}

.settings options li a {
  display: inline-block;
  width: 100%;
}

.settings form { margin: 0; }

.pie { width: 200px; }
.chart { width: 350px; }
.chart canvas { width: 100%; }


/* POPUP */
poparea {
  position: relative;
  cursor: pointer;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

popup {
  position: absolute;
  display: block;
  visibility: hidden;
  min-width: 220px;
  padding: 10px 15px;
  color: #333;
  background-color: #fff;
  box-shadow: 0 0 10px #00000022;
  border-radius: 6px;
  text-align: left;
  z-index: 1;
  top: -220px;
  left: -220px;
}

popup li {
  list-style: none;
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
  padding: 4px;
  cursor: pointer;
}

popup li img {
  margin-right: 10px;
}

popup li label {
  font-size: 0.9rem;
  cursor: pointer;
}

/* Popup arrow */
/*
popup::after {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: transparent transparent #fff transparent;
}
*/

popup.show {
  visibility: visible;
  -webkit-animation: fadeIn 1s;
  animation: fadeIn 1s;
}

.inputLookup {
  padding-right: 2rem;
}

.lookupForm {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  height: 100vh;
  background-color: var(--back-primary);
  z-index: 20;
}

.lookupForm.desktop {
  border-radius: 8px;
  border: 2px solid var(--border-primary);
  box-shadow: 0 0 20px #44444444;
}

.lookupBar {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
}

.lookupBar button {
  height: auto;
  padding: 0;
}

.lookupInput {
  width: 100%;
  padding: 4px 10px;
  font-size: 1rem;
}

.lookupSearch {
  width: 24px;
  text-align: center;
}

.lookupList {
  overflow-y: scroll;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  flex-grow: 1;
  border-top: 1px solid #ccc;
  border-bottom: 1px solid #ccc;
}

.lookupList table {
  font-size: 0.8rem;
}

.lookupFoot {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  padding: 10px;
}

.lookupList table tr.active {
  background-color: var(--color-accented);
  color: white;
}

.noshow { display: none; }

@-webkit-keyframes fadeIn {
  from {opacity: 0;} 
  to {opacity: 1;}
}

@keyframes fadeIn {
  from {opacity: 0;}
  to {opacity:1 ;}
}

