/* Shared editing surfaces. Keep Django's widget markup, actions and keyboard behavior. */
body.ops-admin {
  --rec-ink: #18322c;
  --rec-muted: #526960;
  --rec-accent: #11654b;
  --rec-line: #d9e2dd;
  --rec-wash: #f3f7f5;
  --rec-pale: #e6f4ec;
  --rec-radius: 12px;
  --body-fg: var(--rec-ink);
  --body-quiet-color: var(--rec-muted);
  --body-loud-color: #112d23;
  --body-bg: #fff;
  --primary: #275c48;
  --secondary: #214e40;
  --accent: #e4f4e7;
  --darkened-bg: var(--rec-wash);
  --selected-bg: var(--rec-pale);
  --selected-row: #edf7f1;
  --hairline-color: #e4ebe7;
  --border-color: var(--rec-line);
  --link-fg: var(--rec-accent);
  --link-hover-color: #073d2b;
  --link-selected-fg: #0c5940;
  --button-bg: #e8f1eb;
  --button-fg: #184d38;
  --button-hover-bg: #daebe2;
  --default-button-bg: #176448;
  --default-button-hover-bg: #0e5139;
  --error-fg: #9a3028;
  color-scheme: light;
}

.ops-admin #content-main { min-width: 0; }
.ops-admin #content-main .object-tools {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  float: none;
  margin: 0 0 1rem;
  padding: 0;
}
.ops-admin #content-main .object-tools:empty { display: none; }
.ops-admin #content-main .object-tools li { float: none; height: auto; margin: 0; padding: 0; }
.ops-admin #content-main .object-tools a,
.ops-admin #content .button,
.ops-admin #content input[type="submit"],
.ops-admin #content .submit-row a.closelink,
.ops-admin #changelist .actions button,
.ops-admin #toolbar form input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 36px;
  padding: .5rem .95rem;
  border: 1px solid var(--rec-line);
  border-radius: 8px;
  background: white;
  color: #234c38;
  box-shadow: none;
  font: inherit;
  font-size: .875rem;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
  line-height: 1.4;
  white-space: normal;
  cursor: pointer;
}
.ops-admin #content-main .object-tools a.addlink,
.ops-admin #content input[type="submit"].default,
.ops-admin.login #content input[type="submit"] {
  background: var(--default-button-bg);
  border-color: var(--default-button-bg);
  color: #fff;
}
.ops-admin #content-main .object-tools a.addlink::before {
  content: "+";
  margin-right: .4rem;
  font: 1.1rem/1 system-ui, sans-serif;
}
.ops-admin #content :is(input[type="submit"], .button):hover,
.ops-admin #content-main .object-tools a:hover,
.ops-admin #changelist .actions button:hover {
  background: var(--rec-wash);
  border-color: #adc3b6;
  color: #173b28;
}
.ops-admin #content input[type="submit"].default:hover,
.ops-admin.login #content input[type="submit"]:hover,
.ops-admin #content-main .object-tools a.addlink:hover { background: #0c5038; color: white; }

.ops-admin #changelist.module { margin: 0; background: transparent; gap: 18px; }
.ops-admin #changelist .changelist-form-container,
.ops-admin #changelist-filter,
.ops-admin #content-main fieldset.module,
.ops-admin #change-history,
.ops-admin #content form[enctype="multipart/form-data"]:not([id]) {
  box-sizing: border-box;
  border: 1px solid var(--rec-line);
  border-radius: var(--rec-radius);
  background: #fff;
}
.ops-admin #changelist .changelist-form-container { overflow: hidden; min-width: 0; }
.ops-admin #changelist-filter {
  flex: 0 0 clamp(172px, 15vw, 220px);
  margin: 0;
  padding: 0 0 8px;
  overflow: hidden;
}
.ops-admin #changelist-filter h2 {
  margin: 0;
  padding: 15px 17px;
  background: var(--rec-wash);
  color: var(--rec-ink);
  border-bottom: 1px solid var(--rec-line);
  font-size: .95rem;
  font-weight: 650;
  letter-spacing: normal;
}
.ops-admin #changelist-filter :is(details, #changelist-filter-extra-actions) {
  margin: 0; padding: 12px 15px; border-bottom: 1px solid #e7ede9;
}
.ops-admin #changelist-filter details:last-child { border-bottom: 0; }
.ops-admin #changelist-filter :is(summary, h3) {
  margin: 0; color: var(--rec-ink); font-size: .83rem; font-weight: 650;
}
.ops-admin #changelist-filter ul { margin: 8px 0 0; padding: 0; }
.ops-admin #changelist-filter li { padding: 0; margin: 1px 0; border: 0; }
.ops-admin #changelist-filter li a {
  display: block; padding: 6px 9px; color: var(--rec-muted); border-radius: 6px; overflow-wrap: anywhere;
}
.ops-admin #changelist-filter li.selected a { font-weight: 650; color: #165236; background: var(--rec-pale); }
.ops-admin #changelist-filter li a:hover { background: var(--rec-wash); color: var(--rec-ink); }

.ops-admin #toolbar,
.ops-admin #changelist .actions,
.ops-admin #changelist .paginator {
  box-sizing: border-box; margin: 0; padding: 13px 17px; border: 0;
  color: var(--rec-muted); font-size: .82rem; line-height: 1.5;
}
.ops-admin #toolbar { background: #fff; border-bottom: 1px solid var(--rec-line); }
.ops-admin #toolbar form > div,
.ops-admin #changelist .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ops-admin #toolbar form label img { width: 18px; height: 18px; display: block; }
.ops-admin #toolbar #searchbar { width: min(290px, 60%); min-width: 0; margin: 0; }
.ops-admin #changelist .actions { background: #fafcfb; border-bottom: 1px solid var(--rec-line); }
.ops-admin #changelist .actions label { display: inline-flex; max-width: 100%; align-items: center; gap: 6px; }
.ops-admin #changelist .actions button { margin: 0; }
.ops-admin #changelist .actions span.action-counter { padding: 0; margin: 0; color: var(--rec-muted); font-size: .8rem; }
.ops-admin #changelist .paginator { display: block; border-top: 1px solid var(--rec-line); background: #fff; }
.ops-admin #changelist .paginator :is(a, .this-page) { padding: 5px 8px; border-radius: 5px; }
.ops-admin #changelist .paginator a { color: var(--rec-accent); background: var(--rec-pale); }
.ops-admin #changelist .paginator .this-page { color: #fff; background: #245641; }

.ops-admin #changelist-form .results { margin: 0; overflow-x: auto; overscroll-behavior-x: contain; }
.ops-admin :is(#result_list, #change-history) { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.ops-admin #changelist #result_list thead th,
.ops-admin #change-history thead th {
  color: #4c6458; background: var(--rec-wash); font-size: .79rem; font-weight: 650;
  border-top: 0; border-bottom: 1px solid var(--rec-line); text-transform: none;
}
.ops-admin #changelist #result_list thead th .text :is(a, span) { padding: 13px 12px; color: inherit; }
.ops-admin #changelist #result_list .action-checkbox-column { padding-inline: 7px; }
.ops-admin #changelist #result_list tbody :is(td, th),
.ops-admin #change-history :is(td, th) {
  padding: 13px 12px; border-bottom: 1px solid #e7ece9; line-height: 1.5; vertical-align: middle;
  font-size: .875rem;
}
.ops-admin #changelist #result_list tbody tr { background: #fff; }
.ops-admin #changelist #result_list tbody tr:hover { background: #f5f9f6; }
.ops-admin #changelist #result_list tbody tr.selected { background: #e6f4eb; }
.ops-admin #changelist #result_list tbody tr:last-child :is(th,td) { border-bottom: 0; }
.ops-admin #changelist #result_list .action-checkbox { width: 1.75rem; padding-inline: 8px; }
.ops-admin #changelist #result_list th a { color: var(--rec-accent); font-weight: 650; }
.ops-admin :is(#result_list, #change-history) img { vertical-align: middle; }

/* Explicit field type list keeps calendar, related-object and dual-selector controls intact. */
.ops-admin #content :is(input[type="text"],input[type="url"],input[type="email"],input[type="number"],input[type="password"],input[type="search"],textarea,select),
.ops-admin #toolbar #searchbar, .ops-admin #changelist .actions select {
  box-sizing: border-box;
  max-width: 100%;
  min-height: 36px;
  margin-block: 0;
  padding: 7px 10px;
  border: 1px solid #bfcec5;
  border-radius: 7px;
  background-color: white;
  color: var(--rec-ink);
  font: inherit;
  font-size: .89rem;
  line-height: 1.45;
}
.ops-admin #content :is(input[type="checkbox"],input[type="radio"]) { accent-color: #196544; }
.ops-admin #content :is(input[type="text"],input[type="url"],input[type="email"],input[type="password"],input[type="search"],textarea,select):focus-visible {
  outline: 2px solid #348761; outline-offset: 2px;
}
.ops-admin #content-main fieldset.module { padding: 0; margin: 0 0 16px; }
.ops-admin #content-main fieldset.module > :is(h2, .fieldset-heading),
.ops-admin #content-main fieldset.module > details > summary {
  padding: 13px 18px; margin: 0; background: var(--rec-wash); color: var(--rec-ink);
  border-radius: var(--rec-radius) var(--rec-radius) 0 0; font-weight: 650; letter-spacing: 0;
}
.ops-admin #content-main .form-row { padding: 15px 18px; border-bottom: 1px solid #e5ebe7; overflow: visible; }
.ops-admin #content-main .form-row:last-child { border-bottom: 0; }
.ops-admin #content-main .form-row label { color: #2b4638; line-height: 1.55; }
.ops-admin #content-main .form-row label.required { font-weight: 650; }
.ops-admin #content-main .help, .ops-admin #content-main .helptext { color: var(--rec-muted); font-size: .8rem; line-height: 1.55; overflow-wrap: anywhere; }
.ops-admin #content-main .readonly { line-height: 1.55; overflow-wrap: anywhere; }
.ops-admin #content .submit-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px; border: 1px solid var(--rec-line);
  border-radius: var(--rec-radius); padding: 12px 15px; background: #fff;
}
.ops-admin #content .submit-row > * { margin: 0; }
.ops-admin #content .submit-row :is(.deletelink, .deletelink-box a) {
  background: #f9edeb; color: #8a342b; border-radius: 7px; height: auto; padding: 8px 12px;
}
.ops-admin #content .errornote, .ops-admin #content .errorlist {
  color: #8a3029; background: #fff3f1; border-radius: 7px;
}
.ops-admin #content form[enctype="multipart/form-data"]:not([id]) { padding: 18px; }
.ops-admin #content form[enctype="multipart/form-data"]:not([id]) > p { margin: 0 0 16px; }
.ops-admin #content form[enctype="multipart/form-data"]:not([id]) > p label { display: block; margin-bottom: 5px; font-weight: 600; }

.ops-admin #content .related-widget-wrapper { max-width: 100%; min-width: 0; flex-wrap: wrap; }
.ops-admin #content :is(.selector, .selector-available, .selector-chosen) { min-width: 0; max-width: 100%; }
.ops-admin #content .selector { width: min(100%, 760px); }
.ops-admin #content .selector:not(.stacked) :is(.selector-available, .selector-chosen) { flex: 1 1 0; }
.ops-admin #content .selector select { width: 100%; padding: 6px; border-radius: 0 0 7px 7px; }
.ops-admin #content .selector-filter input { width: 100%; min-width: 0; }
.ops-admin #content :is(.selector-available-title, .selector-chosen-title) { border-radius: 7px 7px 0 0; }
.ops-admin #content .selector-chosen-title label { color: #fff; }
.ops-admin #content .select2-container { max-width: 100%; }
.ops-admin .select2-container--admin-autocomplete .select2-selection {
  border: 1px solid #bfcec5; border-radius: 7px; min-height: 36px; background: #fff; color: var(--rec-ink);
}
.ops-admin .select2-container--admin-autocomplete .select2-selection--single .select2-selection__rendered { color: var(--rec-ink); line-height: 34px; }
.ops-admin .select2-container--admin-autocomplete .select2-selection--single .select2-selection__arrow { height: 34px; }
.ops-admin .select2-container--admin-autocomplete .select2-dropdown { border-color: #bfcec5; background: white; color: var(--rec-ink); }
.ops-admin .select2-container--admin-autocomplete .select2-results__option--highlighted[aria-selected] { background: var(--rec-accent); color: white; }

.ops-admin.popup #content { box-sizing: border-box; padding: clamp(16px, 3vw, 34px); }
.ops-admin.popup #content-main { width: 100%; }
.ops-admin.login #container {
  display: grid; place-items: center; box-sizing: border-box; width: 100%; max-width: none;
  min-width: 0; min-height: 100svh; height: auto; margin: 0; padding: 24px;
  border: 0; background: #edf3ef; border-radius: 0;
}
.ops-admin.login :is(#header, #footer, #nav-sidebar, #toggle-nav-sidebar, .breadcrumbs) { display: none; }
.ops-admin.login #main, .ops-admin.login #content-start, .ops-admin.login #content {
  display: block; box-sizing: border-box; width: 100%; max-width: none; min-width: 0; margin: 0; padding: 0;
}
.ops-admin.login #main { width: min(100%, 408px); flex: initial; }
.ops-admin.login .ops-login-card {
  box-sizing: border-box; width: 100%; margin: 0 auto; padding: clamp(26px, 5vw, 40px);
  background: #fff; border: 1px solid #d4dfd7; border-radius: 18px; box-shadow: 0 12px 42px rgb(26 60 37 / 7%);
}
.ops-admin.login .ops-login-brand { display: flex; align-items: center; gap: 10px; margin: 0 0 30px; color: #244f3b; font-weight: 650; font-size: 1rem; }
.ops-admin.login .ops-login-brand img { width: 32px; height: 32px; }
.ops-admin.login #ops-login-title { margin: 0 0 22px; color: var(--rec-ink); font-size: clamp(1.6rem, 4.5vw, 2rem); line-height: 1.23; font-weight: 680; letter-spacing: -.035em; }
.ops-admin.login #content-main { float: none; width: 100%; }
.ops-admin.login #content-main .form-row { padding: 0 0 16px; display: block; border: 0; }
.ops-admin.login #content-main .form-row label { display: block; margin-bottom: 5px; font-weight: 550; font-size: .87rem; }
.ops-admin.login #content-main .form-row input { width: 100%; min-height: 43px; }
.ops-admin.login #content-main .submit-row { border: 0; padding: 8px 0 0; background: transparent; }
.ops-admin.login #content-main .submit-row input { width: 100%; min-height: 42px; }

@media (max-width: 1050px) {
  .ops-admin #changelist.module { gap: 12px; }
  .ops-admin #changelist-filter { flex-basis: 160px; }
}
@media (max-width: 800px) {
  .ops-admin #changelist.module { flex-direction: column; align-items: stretch; min-height: 0; }
  .ops-admin #changelist-filter {
    display: grid; position: static; box-sizing: border-box; width: 100%; min-width: 0; flex: none;
    grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); align-items: start;
  }
  .ops-admin #changelist-filter h2, .ops-admin #changelist-filter-extra-actions { grid-column: 1/-1; }
  .ops-admin #changelist-filter details { margin: 0; }
  .ops-admin #changelist .changelist-form-container { width: 100%; flex: initial; }
  .ops-admin #content .submit-row { justify-content: flex-start; }
}
@media (max-width: 640px) {
  .ops-admin #content-main .object-tools { justify-content: flex-start; margin: 0 0 12px; }
  .ops-admin #content .aligned .form-row .flex-container { flex-wrap: wrap; }
  .ops-admin #content-main .form-row { padding: 12px; }
  .ops-admin #content-main .form-row .related-widget-wrapper { width: 100%; }
  .ops-admin #content .selector:not(.stacked) { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .ops-admin #content .selector:not(.stacked) :is(.selector-available,.selector-chosen) { width: 100%; margin: 0; }
  .ops-admin #content .selector:not(.stacked) ul.selector-chooser { display: flex; justify-self: center; width: auto; transform: none; }
  .ops-admin #content .selector:not(.stacked) ul.selector-chooser button { transform: rotate(90deg); }
  .ops-admin #content .selector select { height: 9rem; }
  .ops-admin #content .submit-row > :is(input, a) { width: auto; min-width: 0; }
  .ops-admin #content .submit-row .deletelink-box { margin-inline-start: 0; }
  .ops-admin #toolbar, .ops-admin #changelist .actions, .ops-admin #changelist .paginator { padding: 11px 12px; }
  .ops-admin #toolbar #searchbar { flex: 1; min-width: 6em; }
  .ops-admin.login #content-main .submit-row input { width: 100%; }
}
