/* generic */

*,
*:after,
*:before {
  /* border and padding inside specified width/height, content box shrinks */
  box-sizing: border-box;
  font-family: GTAmerica, Helvetica, sans-serif;
  font-weight: normal;
  line-height: 1.2em;
  text-decoration-skip-ink: none;
}

b {
  font-weight: bold;
}

body,input,textarea,button,select {
  font-size: clamp(9px, 2vw, 18px);
}


#page {
  max-width: 800px;
  margin: auto;
}

#backnav {
  margin-bottom: 1em;
}

h1,h2,h3 {
  font-weight: bold;
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

h1 {
  font-size: clamp(9px, 3vw, 27px);
}

h2 {
  font-size: clamp(9px, 2.5vw, 22px);
}


button {
  background-color: #97cdfc;
  border: solid gray 1pt;
  border-radius: 5px;
}
button:active {
  background-color: #25b;
  color: white;
}

button.delete {
  background-color: rgb(252, 87, 87);
}
button.hilite {
  background-color: rgb(66, 207, 123);
}

input {
  border: solid gray 1pt;
  padding-left: 0.5em;
}

pre {
  font-family: Menlo, Courier, monospace;
  font-size: 12px;
}


/* plan44/dbedit: classes used in standard templates
 * =================================================
 */

/* listview */

.listview .header {
  display: flex;
  flex-wrap: wrap;
  gap: 1em;
  padding: 0.5em 0;
  font-weight: bold;
  border-top: solid black 1px;
  border-bottom: solid black 2px;
}
.listview .listheadercontainer {
  flex: 3 2;
  font-weight: bold;
}

.listview .listrowcontainer {
  display: flex;
  flex-wrap: wrap;
  gap: 1em;
  padding: 0.5em 0;
  border-bottom: solid black 1px;
}
.listview .listfieldcontainer {
  flex: 3 2;
  //background-color: #d7d7d7
}

@media (max-width: 600px) {
  .listview .header {
    flex-direction: column; /* Stack labels and inputs */
  }
  .listview .listheadercontainer {
    flex: 1 0 auto; /* Take full width */
  }
  .listview .listrowcontainer {
    flex-direction: column; /* Stack labels and inputs */
  }
  .listview .listfieldcontainer {
    flex: 1 0 auto; /* Take full width */
  }
}


/* detailview */

.detailview .header {
  /* no header by default in detailviews */
  display: none;
}

.fieldcontainer {
  display: flex;
  flex-wrap: wrap;
  margin-top: 0.5em;
  margin-bottom: 0.5em;
  padding-top: 0.5em;
}

.detailview .fieldcontainer {
  border-top: solid black 1px;
}

.fieldcontainer .fielddesc {
  flex: 0 0 40%; /* Labels take 40% of the row width */
  margin-bottom: 0.5em; /* Space for when it wraps */
  padding-right: 1em;
}

.fieldcontainer .fieldcontent {
  flex: 1 0 60%; /* Fields take the rest */
  display: flex;
  flex-direction: column; /* Stack labels and inputs */
}

.fieldcontent input,textarea {
  flex: 1 0 auto; /* Take full width */
}

@media (max-width: 600px) {
  .fieldcontainer {
    flex-direction: column; /* Stack labels and inputs */
  }
  .fieldcontainer .fielddesc {
    flex: 1 0 auto; /* Take full width */
  }
  .fieldcontainer .fieldcontent {
    flex: 1 0 auto; /* Take full width */
  }
}



/* g70user specifics
 * =================
 */

.detailview .fieldcontainer.continuation {
  border-top: none !important;
}


.detailview .fieldcontainer > label,.label {
  flex: 0 0 40%; /* Labels take 40% of the row width */
  margin-bottom: 0.5em; /* Space for when it wraps */
  padding-right: 1em;
}

/* container for multiple value fields in one row */
.detailview .fieldcontainer > .multival {
  flex: 1 0 60%; /* Fields take the rest */
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  align-content: flex-start;
}

.detailview .fieldcontent.budgetitem {
  flex: 1 0 60%; /* Fields take the rest */
  display: flex;
  flex-wrap: nowrap;
  gap: 1em;
  flex-direction: row !important;
  /* align-items: flex-start;
  align-content: flex-start; */
}

.budgetdesc {
  flex: 1 1 70% !important;
}

.budgetval {
  flex: 1 0 30% !important;
  text-align: right;
}
.budgetval.total {
  font-weight: bold;
}



.detailview .fieldcontainer input,textarea,button,.displayvalue {
  flex: 1 0 60%; /* Fields take the rest */
}

.detailview .fieldcontainer input[readonly], textarea[readonly] {
  /* background-color: lightgray; */
  border-color: lightgray;
}

.detailview .fieldcontainer input {
  max-height: 1.7em;
}

.detailview .fieldcontainer textarea {
  resize: vertical;
}

.detailview .fieldcontainer fieldset {
  border: solid gray 1px;
  flex: 1 0 100%; /* Center the fieldset */
}

.detailview .fieldcontainer fieldset label {
  flex: 0 0 100%; /* Labels take 40% of the row width */
  display: block;
  margin: 5px 0;
}

.fieldname {
  font-size: larger;
}

.fieldcond {
  font-size: smaller;
}

.fieldhelp {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
  font-style: italic;
  font-size: smaller;
}

.fieldinput {
  color: black;
  width: 100%;
  border: 2px solid #0084c9;
}

.multival > .fieldinput:not(:first-child) {
  margin-top: 1em;
}

.fieldinput:invalid {
  color: red;
  border: 3px solid red;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  margin-top: 1em;
  margin-bottom: 1em;
  padding-top: 1em;
  border-top: solid black 1px;
  gap: 0.5em;
}

.controls button {
  flex: 1 0 100%;
}



@media (max-width: 600px) {
  body,input,textarea,button,select {
    font-size: 5vw;
  }

  .page {
    max-width: 100%;
  }

  .listview .header {
    display: none; // the listview header does not make sense in narrow layouts
  }

  h1 {
    font-size: 6vw;
  }

  h2 {
    font-size: 5vw;
  }

  .form-row {
    flex-direction: column; /* Stack labels and inputs */
  }

  .form-row label {
    flex: 1 0 auto; /* Take full width */
  }

  .form-row input,textarea,button,.displayvalue {
    flex: 1 0 auto; /* Take full width */
  }
}

/* specific */

.error {
  color: red;
  font-weight: inherit;
}

.hint {
  font-size: smaller;
  color: gray;
  margin-top: 2vw;
}

.dbginfo {
  font-family: menlo, courier, monospace;
  font-size: 12px;
  margin: 0.2em 0;
  padding: 0.5em;
  border: solid red 1px;
  display: block; /* override legacy dbginfo on span */
}
.dbginfo + br {
  display: none; /* eliminate <br/>s in legacy dbginfo */
}
.dbginfo b {
  font-weight: bold;
  color: red;
}



#footercontent {
  font-size: smaller;
  color: gray;
  margin-top: 4vw;
}

/* subpage list */

.subpage-list {
  border-top: 1px solid #ccc; /* Optional divider for list items */
  padding-top: 1rem;
  display: flex;
  flex-direction: column; /* Stacks items vertically */
  gap: 1rem; /* Space between items */
}

.subpage-item {
  display: flex;
  align-items: top;
  gap: 1rem; /* Space between the image and text */
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #ccc; /* Optional divider for list items */
}

.subpage-icon {
  width: 100px; /* Square size for the div */
  height: 100px;
  background-size: cover; /* Ensures the background image fills the div */
  background-position: center; /* Centers the background image */
  background-color: #ddd; /* Fallback color if no image is set */
  /* border-radius: 8px; /* Optional: rounded corners */ */
}

.subpage-details {
  flex: 1; /* Allows text to take up remaining space */
}

.subpage-title {
  font-weight: bold;
  margin: 0; /* Removes default margin */
}

.subpage-description {
  color: #666; /* Optional: lighter color for the description */
  margin: 0; /* Removes default margin */
}


/* ebike page specifics */
/* -------------------- */


.listrowcontainer {
  background-color: rgb(231, 231, 231);
}
.listrowcontainer * {
  color: gray;
}


.listrowcontainer.mine {
  background-color: white;
}
.listrowcontainer.mine * {
  color: black;
}

.listrowcontainer.mine.active {
  background-color: #80ff80;
}

.listrowcontainer.inuse {
  background-color: #fbc670;
}

.listrowcontainer.mine.inuse {
  background-color: #fca71b;
}

.listrowcontainer.expired {
  background-color: #ff6363 !important;
}


.listrowcontainer.buttons {
  display: none;
  padding: 1em;
}
.listrowcontainer.buttons.mine.active,
.listrowcontainer.buttons.mine.inuse,
.listrowcontainer.buttons.mine.inuse.expired {
  display: flex;
}

.listrowcontainer.buttons .lockcontrols {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
}

.listrowcontainer.buttons .lockcontrols button {
  flex: 1 0 auto; /* Take full width */
}

.listrowcontainer .lockcontrols.start {
  display: flex
}
.listrowcontainer .lockcontrols.start.inuse {
  display: none;
}

.listrowcontainer .lockcontrols.stop {
  display: none;
}
.listrowcontainer .lockcontrols.stop.inuse {
  display: flex;
}

.listrowcontainer .lockcontrols.stop .admonition {
  display: none;
  font-weight: bold;
}
.listrowcontainer .lockcontrols.stop .admonition.expired {
  display: block;
}

.listheadercontainer.fn_editbutton,
.listfieldcontainer.fn_editbutton {
  flex: none;
  width: 2em;
}
.listfieldcontainer.fn_editbutton button {
  margin-right: 0.5em;
  display: none;
}

.listrowcontainer.mine .fn_editbutton button {
  display: flex;
}
/* .listrowcontainer.mine.inuse .fn_editbutton button {
  display: none;
} */

.controls button.delete {
  margin-top: 1.2em;
}
