/* Small color accents from https://oa-scouting.org/branding */
* {
  box-sizing: border-box;
}

body {
  margin: 8px;
  font: 14px Arial, sans-serif;
  color: #030006;
  background: #E6E7E8;
}

[hidden] {
  display: none !important;
}

/* Header and brand */

.site-header {
  padding: 12px;
  border: 1px solid #888;
  background: #ddd;
  border-top: 4px solid #E31837;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}

.brand {
  color: #030006;
  text-decoration: none;
}

.brand strong, .brand span {
  display: block;
}

.brand strong {
  color: #640813;
  font-size: 18px;
  margin-bottom: 4px;
}

.system-name {
  text-align: right;
}

nav {
  margin: 14px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 15px;
}

nav a {
  color: #005596;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

#user-role {
  margin-left: 8px;
}

/* Typography */

main {
  margin: 20px 12px;
}

h1 {
  color: #36454F;
  font-size: 24px;
  margin: 0 0 12px;
}

h2 {
  font-size: 18px;
}

p {
  line-height: 1.4;
}

.fiscal-period {
  margin: 18px 0;
}

/* Shared form controls */

label {
  display: block;
  margin-bottom: 5px;
}

input {
  width: 100%;
  min-width: 0;
}

.field {
  margin-bottom: 12px;
}

.field input, .field select {
  width: 100%;
}

.error {
  color: #640813;
}

/* Login page */

.login-layout {
  margin: 25px 15px;
  max-width: 700px;
}

.sign-in {
  width: 340px;
  max-width: 100%;
  margin-top: 25px;
  padding: 15px;
  border: 1px solid #888;
  background: white;
}

.sign-in h2 {
  margin: 0;
  font-size: 20px;
}

.sign-in .field {
  margin-bottom: 15px;
}

.form-heading {
  margin-bottom: 18px;
}

.password-input {
  display: flex;
}

.forgot-password {
  display: block;
  margin: 0 0 8px;
}

.submit-button {
  margin-top: 5px;
}

.field-error, .login-status, .password-help {
  color: #640813;
  font-size: 13px;
  line-height: 1.4;
}

.field-error {
  margin: 5px 0 0;
}

/* Accounts and budgets pages */

.page-heading button {
  margin: 5px 0 15px;
}

.heading-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

td input[type="checkbox"] {
  width: auto;
}

.summary {
  border-top: 1px solid #aaa;
  border-bottom: 1px solid #aaa;
  padding: 8px 0;
  margin-bottom: 20px;
}

.summary article {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin: 8px 0;
}

.summary h2 {
  width: 165px;
  margin: 0;
  font-size: 14px;
  font-weight: normal;
}

.summary strong {
  min-width: 100px;
}

.summary p {
  margin: 0;
  font-size: 12px;
}

.panel-heading h2 {
  margin-bottom: 5px;
}

.panel-heading p {
  margin: 0 0 15px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 15px;
}

.filters label {
  margin: 0;
  font-weight: normal;
}

.filters input {
  width: 210px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  background: white;
}

th, td {
  padding: 7px;
  border: 1px solid #888;
}

th {
  background: #ddd;
  white-space: nowrap;
}

.numeric {
  text-align: right;
  white-space: nowrap;
}

td small {
  display: block;
  margin-top: 4px;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  white-space: nowrap;
}

.table-footer {
  margin-top: 10px;
  font-size: 12px;
}

#sort-caption {
  display: block;
  margin-top: 5px;
}

.empty {
  padding: 15px 0;
}

dialog {
  width: 420px;
  max-width: calc(100% - 24px);
  max-height: calc(100% - 24px);
  padding: 16px;
  border: 2px solid #777;
  background: #E6E7E8;
}

dialog::backdrop {
  background: rgb(0 0 0 / 30%);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

#cashflow-dialog {
  width: 950px;
}

.detail-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

/* Dashboard page: only the chart panels are boxed */

.eyebrow {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
}

.chart-panel {
  padding: 12px 15px;
  margin-bottom: 15px;
  border: 1px solid #888;
  background: white;
}

.chart-panel h2 {
  margin: 0;
  font-size: 16px;
}

.chart-panel .detail-heading strong {
  font-size: 16px;
}

.chart-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 12px;
}

.chart-row .chart-panel {
  margin-bottom: 0;
}

.chart {
  width: 100%;
  height: 300px;
}

.chart.small {
  height: 260px;
}

.chart-values {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  padding-top: 8px;
  border-top: 1px solid #aaa;
  font-size: 12px;
}

.chart-footer {
  font-size: 12px;
}

/* Members page */

nav a[aria-current="page"] {
  font-weight: bold;
  color: #030006;
}

.breadcrumb {
  margin: 0 0 12px;
  font-size: 13px;
}

.split-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.split-heading h1 {
  font-size: 30px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 15px;
}

.cards article {
  padding: 4px 0;
}

.cards h2 {
  margin: 0 0 8px;
  font-size: 14px;
}

.cards strong {
  font-size: 24px;
}

.cards p, .caption {
  margin: 6px 0 0;
  font-size: 12px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

td.strong {
  font-weight: bold;
}

.badge {
  font-size: 12px;
  font-weight: bold;
  white-space: nowrap;
}

fieldset {
  margin: 4px 0 12px;
  border: 1px solid #aaa;
}
