/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  --ink: #172033;
  --muted: #5d687a;
  --border: #dfe5ec;
  --surface: #ffffff;
  --background: #f5f7fa;
  --primary: #173f2c;
  --primary-hover: #0e2f20;
  --danger: #a52a2a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--background);
}

a {
  color: #175c3b;
}

.site-header {
  color: #ffffff;
  background: var(--primary);
  border-bottom: 4px solid #d8a72f;
}

.header-inner {
  display: flex;
  width: min(100% - 2rem, 72rem);
  min-height: 4.5rem;
  margin-inline: auto;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand,
.site-header nav a,
.link-button {
  color: #ffffff;
  text-decoration: none;
}

.brand {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-header nav form {
  display: inline;
}

.link-button {
  padding: 0;
  font: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.page-container {
  width: min(100% - 2rem, 72rem);
  margin: 0 auto;
  padding: 2.5rem 0 5rem;
}

.site-shell {
  display: grid;
  min-height: calc(100vh - 12rem);
  place-items: center;
}

.welcome-card,
.content-card {
  width: min(100%, 42rem);
  padding: clamp(1.5rem, 5vw, 3rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: 0 1rem 3rem rgb(23 32 51 / 8%);
}

.welcome-card {
  text-align: center;
}

.welcome-card h1 {
  margin: 0;
  font-size: clamp(2rem, 8vw, 4rem);
  letter-spacing: -0.04em;
}

.welcome-card p {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 1.125rem;
}

h1,
h2,
h3 {
  line-height: 1.15;
}

h1 {
  margin-top: 0;
  font-size: clamp(2rem, 5vw, 3.25rem);
  letter-spacing: -0.035em;
}

h2 {
  margin-top: 0;
}

.narrow {
  margin-inline: auto;
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: #397052;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.page-heading,
.section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.page-heading {
  margin-bottom: 1.5rem;
}

.page-heading h1,
.section-heading h2 {
  margin-bottom: 0;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.card-grid .content-card {
  width: auto;
  margin: 0;
}

.form-grid {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.75rem;
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field label {
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 2.8rem;
  padding: 0.65rem 0.75rem;
  color: var(--ink);
  font: inherit;
  background: #ffffff;
  border: 1px solid #aeb8c5;
  border-radius: 0.45rem;
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid #d8a72f;
  outline-offset: 2px;
}

.field-hint,
.small-text,
.muted {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.button-row,
.support-links,
.subnav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.button-row {
  justify-content: center;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  width: auto;
  min-height: 2.75rem;
  padding: 0.65rem 1rem;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  background: #ffffff;
  border: 1px solid #aeb8c5;
  border-radius: 0.5rem;
  cursor: pointer;
}

.button.primary {
  color: #ffffff;
  background: var(--primary);
  border-color: var(--primary);
}

.button.primary:hover {
  background: var(--primary-hover);
}

.button.secondary {
  color: var(--primary);
  border-color: var(--primary);
}

.button.danger {
  margin-top: 1rem;
  color: var(--danger);
  border-color: #d6aaaa;
}

.support-links {
  margin-top: 1.5rem;
  justify-content: space-between;
}

.flash,
.error-summary,
.locked-note {
  margin: 0 0 1.5rem;
  padding: 1rem;
  border: 1px solid;
  border-radius: 0.5rem;
}

.flash.notice {
  color: #1d5739;
  background: #edf9f2;
  border-color: #9bceb0;
}

.flash.alert,
.error-summary {
  color: #812323;
  background: #fff1f1;
  border-color: #e0aaaa;
}

.error-summary h2 {
  font-size: 1rem;
}

.error-summary ul {
  margin-bottom: 0;
}

.locked-note {
  color: #614d17;
  background: #fff9e8;
  border-color: #e0ce91;
}

.status-badge {
  display: inline-flex;
  width: max-content;
  padding: 0.25rem 0.65rem;
  align-items: center;
  color: #3f4b5e;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  background: #eef1f5;
  border-radius: 999px;
}

.status-badge.active {
  color: #1d5739;
  background: #ddf3e6;
}

.status-badge.pending {
  color: #6c5417;
  background: #fff3cd;
}

.status-badge.inactive,
.status-badge.closed {
  color: #812323;
  background: #f8dddd;
}

.details-list {
  display: grid;
  gap: 0;
  margin-bottom: 1.5rem;
}

.details-list div {
  display: grid;
  grid-template-columns: minmax(8rem, 1fr) 2fr;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
}

.details-list dt {
  color: var(--muted);
  font-weight: 700;
}

.details-list dd {
  margin: 0;
}

.entry-list {
  padding-left: 1.25rem;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  align-items: end;
  gap: 1rem;
}

.subnav {
  margin-bottom: 1.25rem;
}

.pagination {
  display: flex;
  margin-top: 1.25rem;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.subnav a {
  padding: 0.45rem 0.7rem;
  text-decoration: none;
  border-radius: 0.35rem;
}

.subnav a[aria-current="page"] {
  color: #ffffff;
  background: var(--primary);
}

.table-card {
  width: auto;
  padding: 0;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

code {
  overflow-wrap: anywhere;
  white-space: normal;
}

@media (max-width: 38rem) {
  .header-inner,
  .page-heading,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .site-header nav {
    padding-bottom: 1rem;
  }

  .details-list div {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}
