:root {
  --portal-bg: #f2f4ef;
  --portal-border: #dbe0da;
  --portal-blue: #295f8e;
}

.alert {
  margin: 18px 0;
  padding: 14px 17px;
  border: 1px solid;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.5;
}
.alert p { margin: 5px 0 0; }
.alert-error { color: #8a312e; border-color: #e7c2bd; background: #fff2ef; }
.alert-success { color: #1e624a; border-color: #badbc9; background: #edf8f1; }
.back-link, .admin-back {
  display: inline-flex;
  margin-bottom: 24px;
  color: rgba(255,255,255,.58);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

/* Public application */
.application-page { background: var(--portal-bg); }
.application-header {
  height: 76px;
  color: white;
  background: var(--dark-2);
}
.application-header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.application-header .brand img { width: 154px; }
.application-header-actions { display: flex; align-items: center; gap: 32px; }
.application-header-actions > a {
  color: rgba(255,255,255,.74);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.application-header-actions > a:last-child { color: white; font-size: 14px; }
.application-header-actions a span {
  display: block;
  color: rgba(255,255,255,.42);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.application-intro {
  position: relative;
  overflow: hidden;
  padding: 70px 0 78px;
  color: white;
  background:
    radial-gradient(circle at 82% 10%, rgba(65,143,107,.25), transparent 30%),
    linear-gradient(118deg, #0c1d18, #15352a);
}
.application-intro::after {
  content: "";
  position: absolute;
  right: -160px;
  top: -300px;
  width: 600px;
  height: 600px;
  border: 1px solid rgba(216,232,98,.14);
  border-radius: 50%;
  box-shadow: 0 0 0 80px rgba(216,232,98,.022), 0 0 0 160px rgba(216,232,98,.016);
}
.application-intro-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 100px;
  align-items: end;
}
.application-intro .eyebrow { margin-bottom: 17px; }
.application-intro h1, .status-copy h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(48px, 5.3vw, 74px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -.045em;
}
.application-intro-grid > div:first-child > p:last-child {
  max-width: 650px;
  margin: 25px 0 0;
  color: rgba(255,255,255,.62);
  font-size: 16px;
}
.intro-side { display: grid; gap: 14px; padding-bottom: 5px; }
.intro-side > div {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 13px;
  align-items: center;
  padding-bottom: 13px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.intro-side b { color: var(--lime); font-family: Georgia, serif; font-size: 17px; font-weight: 400; }
.intro-side span { color: rgba(255,255,255,.65); font-size: 12px; }
.application-form-section { padding: 72px 0 100px; }
.application-shell {
  display: grid;
  grid-template-columns: 265px minmax(0, 1fr);
  gap: 52px;
  align-items: start;
}
.application-progress {
  position: sticky;
  top: 28px;
  display: grid;
  gap: 0;
  padding: 3px 0;
}
.application-progress button {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 13px;
  align-items: start;
  min-height: 88px;
  padding: 0;
  border: 0;
  text-align: left;
  background: transparent;
  cursor: pointer;
}
.application-progress button > b {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: #7d8983;
  border: 1px solid #c7cec8;
  border-radius: 50%;
  background: var(--portal-bg);
  font-size: 11px;
  transition: background-color .2s, color .2s, border-color .2s;
}
.application-progress button > span { color: #87908c; font-size: 13px; font-weight: 750; line-height: 1.25; }
.application-progress button small { display: block; margin-top: 5px; color: #a0a7a3; font-size: 10px; font-weight: 500; }
.application-progress button.is-active > b { color: var(--dark); border-color: var(--lime); background: var(--lime); }
.application-progress button.is-active > span { color: var(--ink); }
.application-progress button.is-complete > b { color: white; border-color: var(--green); background: var(--green); }
.progress-line {
  position: absolute;
  top: 34px;
  bottom: 89px;
  left: 15px;
  width: 2px;
  background: #d8ddd8;
}
.progress-line span { display: block; width: 100%; height: 0; background: var(--green); transition: height .25s; }
.application-form {
  min-height: 600px;
  padding: 45px 52px 39px;
  background: white;
  box-shadow: 0 18px 60px rgba(25, 48, 40, .08);
}
.application-form.is-enhanced .form-step { display: none; }
.application-form.is-enhanced .form-step.is-active { display: block; }
.form-step + .form-step {
  margin-top: 55px;
  padding-top: 50px;
  border-top: 1px solid var(--portal-border);
}
.form-step-head { margin-bottom: 35px; }
.form-step-head > span {
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.form-step-head h2 {
  margin: 4px 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 35px;
  font-weight: 400;
  line-height: 1.15;
}
.form-step-head p { max-width: 650px; margin: 0; color: var(--muted); font-size: 13px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 26px; }
.field { min-width: 0; margin: 0; padding: 0; border: 0; }
.field-wide { grid-column: 1 / -1; }
.field > span:first-child, .field > legend {
  display: block;
  margin-bottom: 7px;
  color: #49564f;
  font-size: 11px;
  font-weight: 750;
}
.field input, .field select, .field textarea, .portal-form input, .portal-form select, .processing-form input, .processing-form select, .processing-form textarea, .admin-filters input, .admin-filters select {
  width: 100%;
  min-height: 45px;
  padding: 10px 12px;
  border: 1px solid #ccd4ce;
  border-radius: 4px;
  color: var(--ink);
  background: white;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.field textarea, .processing-form textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .portal-form input:focus, .portal-form select:focus, .processing-form input:focus, .processing-form select:focus, .processing-form textarea:focus, .admin-filters input:focus, .admin-filters select:focus {
  border-color: var(--green-2);
  box-shadow: 0 0 0 3px rgba(46,139,104,.11);
}
.field small { display: block; margin-top: 6px; color: #8b9590; font-size: 10px; }
.choice-field { display: flex; flex-wrap: wrap; gap: 10px; }
.choice-field legend { width: 100%; }
.choice-field label { cursor: pointer; }
.choice-field input { position: absolute; opacity: 0; pointer-events: none; }
.choice-field label span {
  display: block;
  padding: 9px 15px;
  border: 1px solid #d2d8d3;
  border-radius: 99px;
  color: #67736d;
  font-size: 12px;
}
.choice-field input:checked + span { color: white; border-color: var(--green); background: var(--green); }
.upload-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 235px;
  padding: 30px;
  border: 1px dashed #aebbb3;
  text-align: center;
  background: #fafbf8;
  cursor: pointer;
}
.upload-box > input { position: absolute; opacity: 0; pointer-events: none; }
.upload-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin-bottom: 15px;
  color: var(--green);
  border-radius: 50%;
  background: #eaf3ed;
}
.upload-icon svg { width: 27px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.upload-box > b { font-family: Georgia, serif; font-size: 20px; font-weight: 400; }
.upload-box > small { max-width: 520px; margin-top: 6px; color: var(--muted); font-size: 10px; }
.file-list { margin-top: 12px; color: var(--green); font-size: 11px; font-weight: 700; }
.application-consent {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 11px;
  align-items: start;
  margin-top: 25px;
  color: #68736e;
  font-size: 11px;
  cursor: pointer;
}
.application-consent input { margin-top: 4px; accent-color: var(--green); }
.application-consent a { color: var(--green); }
.submission-note {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  align-items: center;
  margin-top: 22px;
  padding: 14px 16px;
  background: #eef5f0;
}
.submission-note svg { width: 30px; fill: none; stroke: var(--green); stroke-width: 1.7; }
.submission-note p { margin: 0; color: #6b7771; font-size: 10px; }
.submission-note b { display: block; color: var(--ink); font-size: 11px; }
.form-navigation {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 38px;
  padding-top: 28px;
  border-top: 1px solid #e2e5e1;
}
.form-navigation .button { width: auto; }
.button-ghost-light { color: #56625c; border-color: #c8d0ca; background: transparent; }
.form-validation-message { min-height: 20px; margin: 9px 0 0; color: #a23832; font-size: 11px; text-align: right; }
.application-footer { padding: 24px 0; color: rgba(255,255,255,.52); background: var(--dark-2); }
.application-footer .container { display: flex; flex-wrap: wrap; gap: 15px 28px; justify-content: center; font-size: 10px; }
.application-footer p { margin: 0; }
.application-footer a { color: inherit; }

/* Application success and status */
.portal-body {
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 70% 15%, rgba(56,137,100,.2), transparent 25%),
    var(--dark-2);
}
.portal-auth, .success-page { min-height: 100vh; display: grid; place-items: center; padding: 35px 18px; }
.portal-auth-card, .success-card {
  width: 100%;
  max-width: 465px;
  padding: 42px 46px;
  background: white;
  box-shadow: 0 30px 90px rgba(0,0,0,.25);
}
.success-card > a img { width: 165px; margin-bottom: 30px; }
.portal-logo-band {
  display: flex;
  align-items: center;
  min-height: 78px;
  margin: -42px -46px 30px;
  padding: 18px 46px;
  background: var(--dark-2);
}
.portal-logo-band img { display: block; width: 165px; }
.portal-kicker {
  margin: 0 0 5px;
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.portal-auth-card h1, .success-card h1 {
  margin: 0 0 15px;
  font-family: Georgia, serif;
  font-size: 37px;
  font-weight: 400;
  line-height: 1.1;
}
.portal-auth-card > p:not(.portal-kicker) { color: var(--muted); font-size: 13px; }
.portal-form { display: grid; gap: 16px; margin-top: 24px; }
.portal-form label > span, .processing-form label > span, .admin-filters label > span {
  display: block;
  margin-bottom: 6px;
  color: #5a6660;
  font-size: 10px;
  font-weight: 750;
}
.portal-form .button { width: 100%; margin-top: 7px; }
.portal-home-link { display: block; margin-top: 22px; color: var(--muted); font-size: 11px; text-align: center; }
.success-card { color: white; text-align: center; background: #123027; }
.success-card > a img { margin-inline: auto; }
.success-icon { width: 82px; margin: 6px auto 24px; color: var(--lime); }
.success-icon svg { fill: none; stroke: currentColor; stroke-width: 2; }
.success-card .portal-kicker { color: var(--lime); }
.success-card > p:not(.portal-kicker) { color: rgba(255,255,255,.62); }
.application-number { display: inline-block; margin: 8px 0; padding: 10px 17px; color: var(--lime); border: 1px solid rgba(216,232,98,.35); font-size: 19px; letter-spacing: .05em; }
.success-hint { font-size: 11px; }
.success-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 28px; }

.status-page { color: white; background: var(--dark-2); }
.status-main {
  min-height: calc(100vh - 76px);
  padding: 78px 0 100px;
  background:
    radial-gradient(circle at 15% 25%, rgba(54,133,97,.22), transparent 26%),
    linear-gradient(110deg, #0c1d18 48%, #f2f4ef 48%);
}
.status-grid { display: grid; grid-template-columns: .83fr 1.17fr; gap: 100px; align-items: start; }
.status-copy { padding-top: 22px; }
.status-copy .eyebrow { margin-bottom: 17px; }
.status-copy > p:not(.eyebrow) { max-width: 420px; color: rgba(255,255,255,.6); }
.status-contact { display: grid; gap: 3px; margin-top: 35px; }
.status-contact span { color: rgba(255,255,255,.4); font-size: 9px; text-transform: uppercase; letter-spacing: .1em; }
.status-contact a { color: white; font-size: 15px; font-weight: 700; text-decoration: none; }
.status-panel { padding: 38px 42px; color: var(--ink); background: white; box-shadow: var(--shadow); }
.status-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 14px; align-items: end; }
.status-form .button { min-height: 45px; }
.status-result { margin-top: 32px; padding-top: 28px; border-top: 1px solid var(--portal-border); }
.status-result-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.status-result-head > b { color: #7a8580; font-size: 12px; }
.status-result h2 { margin: 18px 0 6px; font-family: Georgia, serif; font-size: 28px; font-weight: 400; }
.status-result > p { margin: 0; color: var(--muted); font-size: 13px; }
.status-result dl { display: grid; grid-template-columns: 1.5fr .7fr .9fr; gap: 15px; margin: 25px 0 0; padding-top: 20px; border-top: 1px solid #edf0ec; }
.status-result dl div { min-width: 0; }
.status-result dt { color: #929b97; font-size: 9px; text-transform: uppercase; }
.status-result dd { margin: 4px 0 0; font-size: 12px; font-weight: 700; }
.client-updates { margin-top: 27px; }
.client-updates h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; }
.client-updates > div { padding: 13px 0; border-top: 1px solid #e5e9e5; }
.client-updates time { color: #919994; font-size: 9px; }
.client-updates p { margin: 4px 0 0; color: #56635d; font-size: 12px; }

/* Shared status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 4px 9px;
  border-radius: 99px;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}
.status-new { color: #255f8a; background: #e9f3fb; }
.status-in_review { color: #775d15; background: #fbf4d9; }
.status-needs_info { color: #a24f23; background: #fff0e5; }
.status-proposal { color: #5f4790; background: #f0eafb; }
.status-in_work { color: #17664b; background: #e4f4eb; }
.status-assessment { color: #246b75; background: #e3f3f5; }
.status-completed { color: #28623b; background: #e1f4e6; }
.status-rejected { color: #8c3935; background: #f9e8e6; }
.status-archived { color: #5f6763; background: #e9ecea; }

/* Admin */
.admin-body { min-height: 100vh; color: var(--ink); background: #f1f3ef; }
.admin-sidebar {
  position: fixed;
  z-index: 20;
  inset: 0 auto 0 0;
  width: 235px;
  display: flex;
  flex-direction: column;
  padding: 29px 20px 20px;
  color: white;
  background: #0c211a;
}
.admin-logo { display: block; padding: 0 11px 27px; border-bottom: 1px solid rgba(255,255,255,.1); }
.admin-logo img { width: 145px; }
.admin-sidebar nav { display: grid; gap: 5px; margin-top: 24px; }
.admin-sidebar nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 43px;
  padding: 8px 11px;
  color: rgba(255,255,255,.61);
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.admin-sidebar nav a:hover, .admin-sidebar nav a.is-active { color: white; background: rgba(255,255,255,.08); }
.admin-sidebar nav a.is-active { box-shadow: inset 2px 0 var(--lime); }
.admin-sidebar nav svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.admin-user { margin-top: auto; padding: 17px 10px 0; border-top: 1px solid rgba(255,255,255,.1); }
.admin-user > span { display: block; font-size: 11px; font-weight: 750; }
.admin-user small { display: block; overflow: hidden; color: rgba(255,255,255,.43); font-size: 9px; text-overflow: ellipsis; }
.admin-user form { margin-top: 8px; }
.admin-user button { padding: 0; color: var(--lime); border: 0; background: none; font-size: 10px; cursor: pointer; }
.admin-main { min-height: 100vh; margin-left: 235px; padding: 38px 44px 70px; }
.admin-topbar { display: flex; justify-content: space-between; align-items: end; gap: 25px; margin-bottom: 30px; }
.admin-topbar .portal-kicker { margin-bottom: 2px; }
.admin-topbar h1 { margin: 0; font-family: Georgia, serif; font-size: 38px; font-weight: 400; line-height: 1.1; }
.admin-topbar-actions { display: flex; gap: 9px; }
.admin-topbar .button { min-height: 43px; }
.button-admin-secondary { color: #55615c; border-color: #c9d0cb; background: white; }
.admin-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 18px; }
.admin-stats a {
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid #e0e4df;
  color: inherit;
  background: white;
  text-decoration: none;
  transition: box-shadow .2s, transform .2s;
}
.admin-stats a:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(16,45,35,.08); }
.admin-stats span { display: block; color: #7b8580; font-size: 9px; text-transform: uppercase; letter-spacing: .05em; }
.admin-stats b { display: block; margin-top: 2px; font-family: Georgia, serif; font-size: 28px; font-weight: 400; }
.admin-card { border: 1px solid #dfe4df; background: white; box-shadow: 0 8px 30px rgba(20,45,36,.035); }
.admin-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(150px, .8fr) minmax(150px, .8fr) auto auto;
  gap: 12px;
  align-items: end;
  padding: 18px 20px;
  border-bottom: 1px solid #e2e6e2;
}
.admin-filters .button { min-height: 42px; }
.admin-filters > a { align-self: center; color: var(--green); font-size: 10px; }
.application-table-wrap { overflow-x: auto; }
.application-table { width: 100%; min-width: 950px; border-collapse: collapse; }
.application-table th {
  padding: 11px 14px;
  color: #89928e;
  border-bottom: 1px solid #e5e9e5;
  text-align: left;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.application-table td { padding: 14px; border-bottom: 1px solid #eef0ed; font-size: 11px; vertical-align: middle; }
.application-table tr:last-child td { border-bottom: 0; }
.application-table tbody tr:hover { background: #fafbf9; }
.application-table td b, .application-table td span, .application-table td small, .application-table time { display: block; }
.application-table td b { font-size: 11px; }
.application-table td > span:not(.status-badge):not(.priority-mark), .application-table td small, .application-table time small { color: #8b9490; font-size: 9px; }
.application-id { color: var(--green); font-weight: 800; text-decoration: none; white-space: nowrap; }
.priority-mark { width: fit-content; margin-top: 3px; color: #a04b29; font-size: 8px; font-weight: 800; text-transform: uppercase; }
.empty-cell { padding: 50px !important; color: var(--muted); text-align: center !important; }

.application-detail-topbar { align-items: center; }
.application-detail-topbar > div:first-child > p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.detail-title-line { display: flex; align-items: center; gap: 13px; }
.admin-back { margin-bottom: 8px; color: var(--green); }
.detail-created { text-align: right; }
.detail-created span { display: block; color: #8a938f; font-size: 8px; text-transform: uppercase; }
.detail-created b { font-size: 11px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 335px; gap: 18px; align-items: start; }
.detail-content { display: grid; gap: 16px; }
.detail-section { padding: 24px 27px; }
.detail-section-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 22px; }
.detail-section-head h2, .processing-form h2, .users-grid .admin-card > h2 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 22px;
  font-weight: 400;
}
.detail-section-head > span { color: #939b97; font-size: 9px; }
.detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 19px 30px; margin: 0; }
.detail-list .detail-wide { grid-column: 1 / -1; }
.detail-list dt { color: #8b9490; font-size: 8px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.detail-list dd { margin: 4px 0 0; overflow-wrap: anywhere; font-size: 12px; line-height: 1.5; }
.detail-list dd small { display: block; color: var(--muted); font-size: 9px; }
.detail-list a { color: var(--green); }
.muted { color: var(--muted); font-size: 11px; }
.attachment-list { display: grid; gap: 8px; }
.attachment-list a { display: flex; align-items: center; gap: 12px; padding: 11px 13px; color: inherit; border: 1px solid #e1e6e2; text-decoration: none; }
.attachment-list a:hover { border-color: #b9c7bd; background: #f8faf7; }
.attachment-icon { width: 31px; height: 31px; display: grid; place-items: center; color: var(--green); border-radius: 50%; background: #eaf3ed; }
.attachment-list b, .attachment-list small { display: block; }
.attachment-list b { font-size: 10px; }
.attachment-list small { color: #8e9793; font-size: 8px; }
.notes-list { display: grid; gap: 11px; }
.notes-list article { padding: 14px 16px; border-left: 2px solid #cbd2cd; background: #f7f8f5; }
.notes-list article.is-visible-to-client { border-color: var(--green); background: #eef6f1; }
.notes-list header { display: flex; flex-wrap: wrap; gap: 7px 12px; align-items: center; }
.notes-list header b { font-size: 10px; }
.notes-list header time { color: #8b9490; font-size: 8px; }
.notes-list header span { padding: 2px 6px; color: var(--green); border: 1px solid #b8d5c5; border-radius: 99px; font-size: 7px; text-transform: uppercase; }
.notes-list p { margin: 7px 0 0; color: #55625c; font-size: 11px; }
.detail-sidebar { position: sticky; top: 20px; }
.processing-form { display: grid; gap: 14px; padding: 24px; }
.processing-form h2 { margin-bottom: 5px; }
.processing-form .button { width: 100%; margin-top: 4px; }
.admin-check { display: grid; grid-template-columns: 16px 1fr; gap: 8px; color: #69756e; font-size: 9px; cursor: pointer; }
.admin-check input { margin: 2px 0 0; accent-color: var(--green); }
.admin-check span { margin: 0 !important; }
.event-history { padding: 0; }
.event-history summary { padding: 18px 25px; cursor: pointer; font-size: 11px; font-weight: 750; }
.event-history summary span { color: #919a96; font-size: 9px; }
.event-history > div { padding: 0 25px 20px; }
.event-history p { display: grid; grid-template-columns: 105px 120px 1fr; gap: 12px; margin: 0; padding: 8px 0; border-top: 1px solid #edf0ed; font-size: 9px; }
.event-history time { color: #8d9692; }

.users-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(300px, .7fr); gap: 18px; align-items: start; }
.users-grid > .admin-card { padding: 25px; }
.users-list { display: grid; margin-top: 19px; }
.users-list article { display: grid; grid-template-columns: minmax(190px, 1fr) 100px 80px auto; gap: 14px; align-items: center; padding: 13px 0; border-top: 1px solid #e8ebe8; }
.users-list b, .users-list span { display: block; }
.users-list b { font-size: 11px; }
.users-list div span { color: #8a9490; font-size: 9px; }
.role-badge { color: #5f4c86; font-size: 9px; }
.user-active { color: var(--green); font-size: 9px; }
.user-disabled { color: #9a4b46; font-size: 9px; }
.users-list button { padding: 0; color: var(--green); border: 0; background: none; font-size: 9px; cursor: pointer; }
.add-user-card .portal-form { margin-top: 19px; }

/* Reference books and site contacts */
.content-section-tabs {
  display: flex;
  gap: 5px;
  margin-bottom: 18px;
  padding: 5px;
  border: 1px solid #dfe4df;
  background: white;
}
.content-section-tabs a {
  padding: 9px 15px;
  color: #6d7873;
  font-size: 11px;
  font-weight: 750;
  text-decoration: none;
}
.content-section-tabs a.is-active { color: white; background: var(--green); }
.reference-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px; align-items: start; }
.reference-books { display: grid; padding: 8px; }
.reference-books a {
  display: block;
  padding: 14px 13px;
  color: inherit;
  border-left: 2px solid transparent;
  text-decoration: none;
}
.reference-books a + a { border-top: 1px solid #edf0ed; }
.reference-books a.is-active { border-left-color: var(--lime); background: #f2f7f3; }
.reference-books b, .reference-books span { display: block; }
.reference-books b { font-size: 11px; }
.reference-books span { margin-top: 3px; color: #8b9490; font-size: 9px; line-height: 1.4; }
.reference-content { display: grid; gap: 18px; }
.reference-list-card, .reference-add-card { padding: 24px; }
.reference-card-head { display: flex; justify-content: space-between; gap: 20px; align-items: start; margin-bottom: 19px; }
.reference-card-head h2, .reference-add-card h2 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 24px;
  font-weight: 400;
}
.reference-card-head p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.reference-card-head > span { color: #8d9692; font-size: 9px; }
.reference-items { display: grid; }
.reference-items article {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 13px 0;
  border-top: 1px solid #e8ece8;
}
.reference-items article.is-disabled, .contact-admin-card.is-disabled { opacity: .55; }
.reference-item-form { display: grid; grid-template-columns: minmax(180px, 1fr) 90px auto; gap: 10px; align-items: end; }
.reference-item-form label > span, .contact-admin-form label > span {
  display: block;
  margin-bottom: 5px;
  color: #7d8782;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.reference-item-form input, .contact-admin-form input, .contact-admin-form select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #d2d8d3;
  background: white;
}
.reference-item-form .button { min-height: 40px; }
.reference-toggle-form button {
  padding: 8px 0;
  color: var(--green);
  border: 0;
  background: none;
  font-size: 9px;
  font-weight: 750;
  cursor: pointer;
}
.reference-add-card .portal-form { grid-template-columns: minmax(180px, 1fr) 100px auto; align-items: end; margin-top: 16px; }
.reference-add-card .portal-form .button { width: auto; }
.contacts-admin-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.contact-admin-card { position: relative; padding: 23px; }
.contact-admin-head { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.contact-admin-head b { font-family: Georgia, serif; font-size: 20px; font-weight: 400; }
.contact-admin-head span { color: #89928e; font-size: 9px; }
.contact-admin-grid { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 12px; }
.contact-admin-grid label:nth-child(3), .contact-admin-grid label:nth-child(4) { grid-column: 1 / -1; }
.contact-admin-grid .reference-order { width: 100px; }
.contact-placement {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  margin: 16px 0;
  padding: 12px 0 0;
  border: 0;
  border-top: 1px solid #e8ece8;
}
.contact-placement legend { padding: 0 8px 0 0; color: #7d8782; font-size: 8px; font-weight: 800; text-transform: uppercase; }
.contact-placement label { display: flex; gap: 6px; align-items: center; color: #68736e; font-size: 9px; cursor: pointer; }
.contact-placement input { width: auto; min-height: 0; accent-color: var(--green); }
.contact-placement label > span { margin: 0; color: inherit; font-size: inherit; letter-spacing: 0; text-transform: none; }
.contact-admin-card > .reference-toggle-form { position: absolute; right: 23px; bottom: 19px; }
.contact-add-card { border-style: dashed; }

@media (max-width: 1100px) {
  .application-shell { grid-template-columns: 220px minmax(0, 1fr); gap: 32px; }
  .application-form { padding-inline: 38px; }
  .admin-sidebar { width: 205px; }
  .admin-main { margin-left: 205px; padding-inline: 28px; }
  .admin-stats { grid-template-columns: repeat(3, 1fr); }
  .admin-stats a:nth-child(n+4) { display: none; }
  .detail-grid { grid-template-columns: minmax(0, 1fr) 300px; }
  .admin-filters { grid-template-columns: 1.2fr .8fr .8fr auto; }
  .admin-filters > a { display: none; }
  .contacts-admin-list { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .application-intro-grid, .status-grid { grid-template-columns: 1fr; gap: 45px; }
  .intro-side { grid-template-columns: repeat(3, 1fr); }
  .intro-side > div { display: block; }
  .intro-side b { display: block; margin-bottom: 4px; }
  .application-shell { grid-template-columns: 1fr; }
  .application-progress {
    position: static;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }
  .application-progress button { min-height: auto; display: block; text-align: center; }
  .application-progress button > b { margin-inline: auto; }
  .application-progress button > span { display: none; }
  .progress-line { display: none; }
  .status-main { background: linear-gradient(#0c1d18 42%, #f2f4ef 42%); }
  .status-panel { margin-top: 15px; }
  .admin-sidebar { position: static; width: 100%; height: 64px; flex-direction: row; align-items: center; padding: 0 18px; }
  .admin-logo { padding: 0; border: 0; }
  .admin-logo img { width: 125px; }
  .admin-sidebar nav { display: flex; margin: 0 0 0 auto; }
  .admin-sidebar nav a { min-height: 38px; }
  .admin-sidebar nav a:not(.is-active) { display: none; }
  .admin-user { display: none; }
  .admin-main { margin-left: 0; padding: 27px 18px 55px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-sidebar { position: static; }
  .users-grid { grid-template-columns: 1fr; }
  .reference-layout { grid-template-columns: 1fr; }
  .reference-books { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 570px) {
  .portal-auth-card, .success-card { width: calc(100vw - 36px); max-width: none; }
  .application-header { height: 65px; }
  .application-header .brand img { width: 130px; }
  .application-header-actions > a:first-child { display: none; }
  .application-header-actions > a:last-child { font-size: 11px; }
  .application-header-actions a span { display: none; }
  .application-intro { padding: 45px 0 54px; }
  .application-intro h1, .status-copy h1 { font-size: 44px; }
  .intro-side { grid-template-columns: 1fr; gap: 9px; }
  .intro-side > div { display: grid; grid-template-columns: 30px 1fr; padding-bottom: 9px; }
  .application-form-section { padding: 40px 0 65px; }
  .application-form { min-height: 0; padding: 29px 22px; }
  .form-step-head { margin-bottom: 25px; }
  .form-step-head h2 { font-size: 29px; }
  .field-grid { grid-template-columns: 1fr; gap: 18px; }
  .field-wide { grid-column: auto; }
  .choice-field { display: grid; grid-template-columns: 1fr; }
  .choice-field label span { text-align: center; }
  .form-navigation { display: grid; grid-template-columns: 1fr; }
  .form-navigation .button { width: 100%; }
  .form-navigation [data-prev] { order: 2; }
  .upload-box { min-height: 210px; padding: 23px 15px; }
  .application-footer .container { flex-direction: column; align-items: center; }
  .portal-auth-card, .success-card { padding: 35px 25px; }
  .portal-logo-band { margin: -35px -25px 28px; padding: 16px 25px; }
  .success-actions { grid-template-columns: 1fr; }
  .status-main { min-height: calc(100vh - 65px); padding-top: 52px; background: linear-gradient(#0c1d18 39%, #f2f4ef 39%); }
  .status-grid { gap: 38px; }
  .status-panel { padding: 27px 21px; }
  .status-form { grid-template-columns: 1fr; }
  .status-result dl { grid-template-columns: 1fr; }
  .admin-sidebar nav a { padding-inline: 8px; font-size: 10px; }
  .admin-topbar { align-items: flex-start; flex-direction: column; }
  .admin-topbar-actions { width: 100%; }
  .admin-topbar-actions .button { width: 50%; padding-inline: 10px; }
  .admin-stats { grid-template-columns: repeat(3, 1fr); }
  .admin-stats a { padding: 13px 11px; }
  .admin-stats b { font-size: 24px; }
  .admin-filters { grid-template-columns: 1fr; }
  .admin-filters .button { width: 100%; }
  .detail-title-line { align-items: flex-start; flex-direction: column; }
  .detail-created { display: none; }
  .detail-list { grid-template-columns: 1fr; }
  .detail-list .detail-wide { grid-column: auto; }
  .detail-section { padding: 21px 19px; }
  .event-history p { grid-template-columns: 1fr; gap: 2px; }
  .users-list article { grid-template-columns: 1fr auto; }
  .users-list article > span { display: none; }
  .content-section-tabs a { flex: 1; text-align: center; }
  .reference-books { grid-template-columns: 1fr; }
  .reference-item-form, .reference-add-card .portal-form { grid-template-columns: 1fr; }
  .reference-items article { grid-template-columns: 1fr; }
  .reference-toggle-form { justify-self: start; }
  .contact-admin-grid { grid-template-columns: 1fr; }
  .contact-admin-grid label:nth-child(3), .contact-admin-grid label:nth-child(4) { grid-column: auto; }
  .contact-admin-card > .reference-toggle-form { position: static; margin-top: 12px; }
}
