:root {
  --color-primary: #2f6b3f;
  --color-primary-dark: #24552f;
  --error-soft: #fdecea;
  --error-text: #9b1c14;
  --error-solid: #b42318;
  --warning-soft: #fef3c7;
  --warning-text: #854d0e;
  --warning-solid: #b45309;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  padding: 2rem 0;
}

.site-header {
  border-bottom: 1px solid var(--color-lightGrey);
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.page-header h1 {
  margin: 0;
}
.card-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.card-header h3 {
  margin: 0;
}
.card-header .row-actions {
  flex-wrap: wrap;
}
.row-actions .button + .button {
  margin-left: 0;
}
.button.small {
  padding: 0.3rem 0.8rem;
  font-size: 0.85em;
}
/* chota fades buttons on hover; variants set explicit hover fills instead. */
.button:hover, button:hover {
  opacity: 1;
}
.button:focus-visible, button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
.button.primary:hover {
  background-color: var(--color-primary-dark);
}
.button.secondary {
  background-color: #e3e7eb;
  color: #1f2328;
}
.button.secondary:hover {
  background-color: #d3d9df;
}
.button.error {
  background-color: var(--error-soft);
  color: var(--error-text);
}
.button.error:hover {
  background-color: var(--error-solid);
  color: #fff;
}
.button.error:focus-visible {
  outline-color: var(--error-solid);
}
.button.warning {
  background-color: var(--warning-soft);
  color: var(--warning-text);
}
.button.warning:hover {
  background-color: var(--warning-solid);
  color: #fff;
}
.button.warning:focus-visible {
  outline-color: var(--warning-solid);
}
.button.tint {
  background-color: color-mix(in srgb, var(--color-primary) 12%, white);
  border-color: var(--color-primary);
  color: var(--color-primary);
  font-weight: 600;
}
.button.tint:hover {
  background-color: var(--color-primary);
  color: #fff;
}
.tag {
  background: #e2eae4;
  color: var(--color-primary-dark);
  border: 0;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.75em;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: none;
  vertical-align: middle;
}
.tag.warning {
  background: var(--warning-soft);
  color: var(--warning-text);
}
.tag.error {
  background: var(--error-soft);
  color: var(--error-text);
}
.tag.muted {
  background: #eef0f2;
  color: #4b5157;
}

/* chota cards have no margin, so stacked ones touch. */
main > .card + .card {
  margin-top: 1rem;
}

.site-footer {
  padding: 1rem 0;
  color: var(--color-grey);
  font-size: 0.9em;
}

.error-page {
  max-width: 32rem;
  margin: 6rem auto;
  text-align: center;
}

.error-code {
  font-size: 4rem;
  font-weight: 700;
  margin: 0;
  color: var(--color-primary);
}

#env-banner {
  text-align: center;
  font-size: 0.8em;
  padding: 0.2rem;
  background: #f4e04d;
}

.auth-form {
  max-width: 28rem;
  margin: 0 auto;
}

.switcher {
  position: relative;
  align-self: center;
  margin-left: 1rem;
}
.switcher summary {
  cursor: pointer;
}
.lang-menu summary {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0 1rem;
  color: var(--color-darkGrey);
  list-style: none;
}
.lang-menu summary::-webkit-details-marker {
  display: none;
}
.lang-menu .card {
  right: 0;
  min-width: 10rem;
}
.switcher .card {
  position: absolute;
  z-index: 10;
  min-width: 18rem;
}
.switcher .card a {
  display: block;
  padding: 0.25rem 0;
}
.project-tabs {
  margin-bottom: 1rem;
}
/* chota only spaces fields inside .col; give stacked fields, fieldsets and
   the actions row the same rhythm. Rows already carry the col's bottom margin. */
form:not(.inline-form) label:not(.inline) {
  display: block;
}
form:not(.inline-form) :not(.row, legend) + :is(label:not(.inline), fieldset, p:has(> button)) {
  margin-top: 1rem;
}
label.inline {
  display: inline-block;
  margin-right: 1rem;
}

.summary-cards {
  margin-bottom: 2rem;
}
.summary-cards .card {
  display: flex;
  flex-direction: column;
  min-width: 10rem;
}
.summary-cards strong {
  font-size: 1.5rem;
}
.unit-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-end;
}
.unit-filter > * {
  width: auto;
  flex: 1 1 10rem;
}

.schedule td, .schedule th {
  padding: 0.3rem 0.6rem;
}
.inline-form {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
}
/* form. prefix outranks chota's input:not(...) width: 100%. */
form.inline-form > * {
  width: auto;
}
.report-dates {
  flex-wrap: wrap;
  column-gap: 1.5rem;
  margin-bottom: 0.5rem;
}
.report-dates > span {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  white-space: nowrap;
}
.report-dates input {
  width: auto;
}
/* chota pins the select arrow to the content edge, which overlaps the text at
   auto width. */
.inline-form select {
  padding-right: 3rem;
  background-origin: border-box;
  background-position: right 1rem center;
}

img.receipt {
  max-width: 100%;
  max-height: 32rem;
  border: 1px solid var(--color-lightGrey);
}

@media print {
  header, .tabs, .no-print, footer {
    display: none !important;
  }
}

table.week td, table.week th {
  text-align: center;
  padding: 0.3rem;
  font-size: 0.9em;
}
table.week td.busy {
  background: #f3e3e3;
}
table.week td.busy.mine {
  background: #e3eef8;
}
table.week td.busy.pending {
  background: #faf1dc;
}
table.week td.past {
  background: #f4f4f4;
}

table.bars td.bar-cell {
  width: 60%;
}
table.bars .bar {
  display: inline-block;
  height: 0.8rem;
  background: var(--color-primary, #14854f);
}

.plan-cards .card ul {
  margin: 0 0 1rem 1.2rem;
}

.row-actions {
  display: flex;
  gap: 0.5rem;
}
