/* Styles for the custom pages, layered on the admin's base.css. */

.app-table {
  width: 100%;
}

.app-table td,
.app-table th {
  vertical-align: top;
}

.app-year,
.app-actions form {
  display: inline-flex;
  gap: 0.5em;
  align-items: center;
}

.app-actions {
  display: flex;
  gap: 1em;
  align-items: center;
}

.app-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3em;
}

.app-help {
  max-width: 50em;
}

.app-help .screenshot img {
  max-width: 100%;
  border: 1px solid var(--hairline-color, #ccc);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.app-help-pages {
  font-size: 1.05em;
  padding-bottom: 0.5em;
  border-bottom: 1px solid var(--hairline-color, #ccc);
}

.app-help-pages p {
  margin: 0.25em 0;
}

.app-help-group {
  color: var(--body-quiet-color, #666);
}

.app-help blockquote {
  border-left: 3px solid var(--hairline-color, #ccc);
  margin-left: 0;
  padding-left: 1em;
}

/* The home page's alert when the last import imported nothing. */
.app-alert {
  max-width: 60em;
  margin: 0 0 20px;
  padding: 14px 18px;
  border: 1px solid var(--error-fg, #ba2121);
  border-left-width: 6px;
  border-radius: 4px;
  background: var(--message-error-bg, #ffefef);
  background: color-mix(in srgb, var(--error-fg, #ba2121) 10%, var(--body-bg, #fff));
  color: var(--body-fg, #333);
  font-size: 0.95rem;
  line-height: 1.5;
}

.app-alert p,
.app-alert ul {
  margin: 0 0 8px;
  padding: 0;
}

.app-alert ul {
  padding-left: 1.4em;
}

.app-alert li {
  list-style: disc;
  font-size: inherit;
}

.app-alert-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--error-fg, #ba2121);
}

.app-alert-title::before {
  content: "\26A0\FE0E  ";
}

.app-alert-meta {
  opacity: 0.85;
}

.app-alert-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  margin: 12px 0 0;
}

.app-alert-actions .button {
  padding: 6px 14px;
  border-radius: 4px;
}

.app-alert-note {
  opacity: 0.75;
  font-size: 0.85rem;
}

@media (max-width: 767px) {
  .app-alert {
    padding: 12px 14px;
  }
}

.app-status td,
.app-status th {
  padding: 6px 10px;
}

/* A change-page section that is just a table: no field label beside it. */
fieldset.app-table-only .form-row label {
  display: none;
}

fieldset.app-table-only .form-row .readonly {
  margin-left: 0;
  width: 100%;
}

/* Import rows: keep names and numbers on one line, and give the detail room. */
#result_list .field-file,
#result_list .field-call {
  white-space: nowrap;
}

#result_list .field-detail {
  min-width: 18em;
}

/* The sections under a permit's form: what it owes, its alarms, its renewals. */
.app-panel {
  margin-top: 20px;
}

.app-panel > p,
.app-panel > table {
  margin: 10px 12px;
}

.app-panel > table {
  width: calc(100% - 24px);
}

.app-account tfoot th,
.app-account tfoot td {
  border-top: 2px solid var(--hairline-color, #ccc);
}

/* The current permit year's dates, after the home page's heading. */
.app-year-dates {
  margin-left: 0.6em;
  font-size: 0.9rem;
  font-weight: normal;
  color: var(--body-quiet-color, #666);
  white-space: nowrap;
}

/* The home page's headings, one above each of its parts. */
.app-home-title {
  margin: 26px 0 10px;
  padding: 0;
  background: none;
  color: var(--body-loud-color, #000);
  font-size: 1.15rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
}

.app-home-title:first-child {
  margin-top: 0;
}

/* The home page's quick actions: one button each, saying what it's for. */
.app-quick {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15em, 1fr));
  gap: 12px;
  margin: 0 0 8px;
}

a.app-quick-link {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--hairline-color, #ccc);
  border-left: 6px solid var(--link-fg, #417690);
  border-radius: 4px;
  background: var(--darkened-bg, #f8f8f8);
  color: var(--body-fg, #333);
  text-decoration: none;
}

a.app-quick-link:hover,
a.app-quick-link:focus {
  border-color: var(--link-fg, #417690);
  background: var(--selected-bg, #e4e4e4);
}

.app-quick-link strong {
  display: block;
  margin-bottom: 2px;
  font-size: 1.05rem;
  color: var(--link-fg, #417690);
}

.app-quick-link span {
  color: var(--body-quiet-color, #666);
}

/* The home page's counts: active permits, renewed, to be renewed, owed, paid. */
.app-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 20px;
}

.app-count {
  flex: 1 1 9em;
  max-width: 14em;
  padding: 12px 14px;
  border: 1px solid var(--hairline-color, #ccc);
  border-radius: 4px;
  background: var(--darkened-bg, #f8f8f8);
  color: var(--body-fg, #333);
  text-decoration: none;
}

a.app-count:hover,
a.app-count:focus {
  border-color: var(--link-fg, #417690);
}

.app-count strong {
  display: block;
  font-size: 1.6rem;
  line-height: 1.2;
  color: var(--body-loud-color, #000);
}

.app-count span {
  color: var(--body-quiet-color, #666);
}

/* The Renewal run page's row of print buttons. */
.app-print {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  align-items: center;
}

/* The totals line of an account table reads like the lines above it. */
.app-account tfoot th,
.app-account tfoot td {
  font-size: inherit;
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  color: inherit;
  padding: 8px;
}

/* A permit's two keyholders fit the form's width. */
#keyholders-group .tabular table {
  width: 100%;
}

#keyholders-group .tabular td input[type="text"] {
  width: 100%;
  box-sizing: border-box;
}

#keyholders-group .tabular td.field-position {
  width: 7em;
}

/* The Renewal run page's note for a year nobody has drafted yet. */
.app-start {
  max-width: 60em;
  padding: 12px 16px;
  border: 1px solid var(--hairline-color, #ccc);
  border-left: 6px solid var(--link-fg, #417690);
  border-radius: 4px;
  background: var(--darkened-bg, #f8f8f8);
}

/* A button for something done rarely, kept apart from the ones used every time. */
.app-actions .app-quiet {
  margin-left: 1.5em;
  background: transparent;
  color: var(--body-quiet-color, #666);
  border: 1px solid var(--hairline-color, #ccc);
}

/* The Renewal run page's buttons and its confirmation pages' are one size. */
.app-actions button.button,
.submit-row button.button {
  padding: 8px 14px;
}

/* The review queue's note on what each reason in the Needs column means. */
.app-queue-help {
  margin: 0 0 12px;
}

.app-queue-help ul {
  margin: 6px 0 6px 1.4em;
  padding: 0;
}

.app-queue-help li {
  list-style: disc;
}

/* The Needs column wraps instead of pushing the list off the page. */
#result_list .field-needs {
  min-width: 14em;
  max-width: 24em;
  white-space: normal;
}

/* Permit numbers in the Locations list stay on one line. */
#result_list .field-permit,
#result_list .field-permit_or_add {
  white-space: nowrap;
}

/* The Load a list page: what a check found, and the rows that can't load. */
.app-load-counts {
  width: auto;
  min-width: 22em;
}

.app-load-counts td {
  text-align: right;
  font-weight: 600;
}

.app-load-lines {
  max-height: 22em;
  overflow: auto;
  margin: 10px 12px;
  padding: 10px 12px;
  border: 1px solid var(--hairline-color, #ccc);
  border-radius: 4px;
  background: var(--darkened-bg, #f8f8f8);
  white-space: pre-wrap;
}

/* The Load a list page: each kind of list stays on one line. */
#id_kind label {
  width: auto;
  white-space: nowrap;
}

/* The Load a list page's template buttons sit inside a table row. */
.app-table .app-template {
  display: inline-block;
  padding: 4px 10px;
  white-space: nowrap;
}

/* The home page's note that the short-password test setting is on. */
.app-test-setting {
  margin: 0 0 20px;
  border-left-color: #b7791f;
}
