:root {
  --blue: #003388;
  --blue-ink: #112e63;
  --gold: #e0af26;
  --red: #b42318;
  --green: #027a48;
  --text: #1d2939;
  --muted: #667085;
  --line: #d0d5dd;
  --soft-line: #eaecf0;
  --bg: #f9fafb;
  --panel: #ffffff;
  --header-bg: #172033;
  --header-text: #f8fafc;
  --header-muted: #cbd5e1;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: var(--blue);
}

code {
  background: #eef2f7;
  border-radius: 4px;
  padding: 2px 5px;
}

.desktop-blocker {
  display: none;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 32px;
  text-align: center;
  background: var(--bg);
}

.desktop-blocker strong {
  display: block;
  color: var(--blue-ink);
  font-size: 24px;
}

.desktop-blocker p {
  color: var(--muted);
}

.app-header {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 72px;
  padding: 0 28px;
  background: var(--header-bg);
  border-bottom: 4px solid var(--gold);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--header-text);
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
}

.brand img {
  width: 150px;
  height: auto;
  display: block;
}

.top-nav {
  display: flex;
  gap: 4px;
}

.top-nav a,
.user-bar a,
.button,
.row-action {
  border-radius: 6px;
  font-weight: 700;
  text-decoration: none;
}

.top-nav a {
  color: var(--header-text);
  padding: 8px 10px;
}

.top-nav a:hover {
  background: rgb(255 255 255 / 12%);
}

.top-nav a.active {
  background: var(--gold);
  color: #101828;
}

.user-bar {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--header-muted);
}

.user-bar a {
  color: var(--header-text);
}

main {
  padding: 24px 28px 48px;
}

.messages {
  padding: 16px 28px 0;
}

.message {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  padding: 12px 14px;
}

.message.error {
  border-left: 5px solid var(--red);
}

.login-layout {
  min-height: calc(100vh - 96px);
  display: grid;
  place-items: center;
}

.login-panel {
  width: 420px;
  max-width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.stacked-form {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--blue-ink);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--text);
  font: inherit;
  background: white;
}

input:focus,
select:focus,
textarea:focus,
.button:focus,
.row-action:focus {
  outline: 3px solid rgba(224, 175, 38, 0.35);
  outline-offset: 2px;
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  padding: 8px 14px;
  color: var(--blue-ink);
  background: var(--panel);
  cursor: pointer;
  font: inherit;
}

.button.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: white;
}

.button.danger {
  border-color: var(--red);
  color: var(--red);
}

.button:disabled,
.button[disabled] {
  cursor: not-allowed;
  opacity: 0.55;
}

.compact-button {
  min-height: 32px;
  padding: 5px 9px;
  font-size: 12px;
}

.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.page-heading-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-heading h1 {
  margin-bottom: 0;
  font-size: 28px;
  letter-spacing: 0;
}

.eyebrow {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.count-strip,
.metric-grid {
  display: flex;
  gap: 12px;
}

.count-strip span,
.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
}

.today-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(126px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  margin-bottom: 22px;
}

.metric {
  color: var(--text);
  text-decoration: none;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 7px;
  font-size: 28px;
}

.quick-filter-strip,
.active-filter-row,
.status-count-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.filter-chip,
.active-filter-chip,
.status-count-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--blue-ink);
  background: var(--panel);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.filter-chip.active,
.status-count-chip.active {
  border-color: var(--blue);
  background: #eef4ff;
}

.active-filter-row {
  align-items: center;
  min-height: 42px;
}

.active-filter-row p {
  margin: 0 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.active-filter-chip span,
.status-count-chip span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.filter-panel {
  margin-bottom: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.database-workbar {
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px 14px;
}

.database-filter-form {
  display: grid;
  gap: 12px;
}

.database-primary-row {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(140px, 180px) auto;
  gap: 12px;
  align-items: end;
}

.database-search input {
  min-height: 44px;
}

.database-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
  position: relative;
}

.compact-filter-row {
  min-height: 40px;
  align-items: center;
}

.filter-menu {
  position: relative;
  min-width: 190px;
}

.filter-menu summary {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 10px;
  color: var(--blue-ink);
  background: var(--panel);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  list-style: none;
}

.filter-menu summary::-webkit-details-marker {
  display: none;
}

.filter-menu summary::after {
  content: "v";
  color: var(--muted);
  font-size: 11px;
}

.filter-menu[open] summary {
  border-color: var(--blue);
  outline: 3px solid rgba(0, 51, 136, 0.12);
}

.filter-menu[open] summary::after {
  content: "^";
}

.filter-menu summary strong {
  max-width: 210px;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-menu-panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  width: min(440px, calc(100vw - 56px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 16px 32px rgb(16 24 40 / 16%);
  padding: 12px;
}

.type-filter-menu .filter-menu-panel {
  width: min(280px, calc(100vw - 56px));
}

.filter-menu-panel p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.checkbox-filter-group,
.advanced-filter-panel {
  min-width: 0;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  padding: 10px 12px;
}

.checkbox-filter-group legend {
  padding: 0 6px;
  color: var(--blue-ink);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.compact-checkbox-grid {
  gap: 6px;
}

.compact-checkbox-grid .checkbox-pill {
  min-height: 30px;
  padding: 4px 8px;
  font-size: 12px;
}

.compact-quick-filter-strip {
  margin-bottom: 0;
}

.advanced-filter-panel .compact-quick-filter-strip {
  border-top: 1px solid var(--soft-line);
  padding: 10px 12px 12px;
}

.advanced-filter-panel {
  padding: 0;
}

.advanced-filter-panel summary {
  padding: 10px 12px;
  color: var(--blue-ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.advanced-filter-grid {
  border-top: 1px solid var(--soft-line);
  padding: 12px;
}

.database-result-row {
  justify-content: space-between;
}

.active-filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-bar,
.filter-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 220px 180px auto;
  gap: 12px;
  align-items: end;
}

.filter-bar {
  margin-bottom: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.filter-grid {
  grid-template-columns: minmax(240px, 1.4fr) repeat(4, minmax(120px, 0.7fr));
}

.wide-filter {
  grid-column: span 2;
}

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

.inline-filter-actions {
  margin-top: 0;
}

.table-frame {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.tracker-table-frame {
  margin-bottom: 14px;
}

.records-table,
.detail-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
}

.tracker-list-table {
  --freeze-divider-width: 6px;
  --freeze-divider-shadow-width: 18px;
  min-width: 3300px;
  table-layout: fixed;
}

.report-table {
  min-width: 980px;
}

th,
td {
  border-bottom: 1px solid var(--soft-line);
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f2f4f7;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

.tracker-list-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  box-shadow: inset -1px 0 0 var(--line);
}

.records-table tbody tr:hover {
  background: #fbfcff;
}

.sort-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 6px;
  color: var(--muted);
  line-height: 1.15;
  text-decoration: none;
}

.sort-link.active {
  color: var(--blue-ink);
}

.sort-label {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}

.sort-marker {
  color: var(--blue);
  font-size: 11px;
  line-height: 1;
}

.sticky-col,
.sticky-1,
.sticky-2,
.sticky-3,
.sticky-4 {
  position: sticky;
  z-index: 1;
  background: var(--panel);
  box-shadow: 1px 0 0 var(--soft-line);
}

.tracker-list-table thead .sticky-1,
.tracker-list-table thead .sticky-2,
.tracker-list-table thead .sticky-3,
.tracker-list-table thead .sticky-4 {
  z-index: 5;
  background-color: #f2f4f7;
}

.sticky-1 {
  left: 0;
}

.sticky-2 {
  left: 84px;
}

.sticky-3 {
  left: 154px;
}

.sticky-4 {
  left: 314px;
  padding-right: calc(10px + var(--freeze-divider-width));
  background-image: linear-gradient(
    to right,
    transparent calc(100% - var(--freeze-divider-width)),
    var(--gold) calc(100% - var(--freeze-divider-width))
  );
  box-shadow: none;
}

.sticky-4::after {
  content: "";
  position: absolute;
  top: 0;
  right: calc(-1 * var(--freeze-divider-shadow-width));
  bottom: 0;
  width: var(--freeze-divider-shadow-width);
  background: linear-gradient(90deg, rgb(16 24 40 / 24%), rgb(16 24 40 / 0%));
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}

.tracker-table-frame.is-horizontally-scrolled .sticky-4::after {
  opacity: 1;
}

.col-loc {
  width: 84px;
  font-weight: 800;
}

.col-state {
  width: 70px;
}

.col-city {
  width: 160px;
}

.col-procedure {
  width: 330px;
}

.col-amdt,
.col-chart {
  width: 82px;
}

.col-type {
  width: 100px;
}

.col-proponent,
.col-status,
.col-pep {
  width: 140px;
}

.col-date {
  width: 136px;
}

.col-date-wide {
  width: 176px;
}

.col-remarks {
  width: 330px;
}

.col-notam {
  width: 180px;
}

.col-action {
  width: 90px;
}

.tracker-list-table td {
  overflow-wrap: anywhere;
}

.tracker-list-table td.col-loc,
.tracker-list-table td.col-state,
.tracker-list-table td.col-city,
.tracker-list-table td.col-procedure,
.tracker-list-table td.col-amdt,
.tracker-list-table td.col-type,
.tracker-list-table td.col-proponent,
.tracker-list-table td.col-status,
.tracker-list-table td.col-chart,
.tracker-list-table td.col-date,
.tracker-list-table td.col-date-wide,
.tracker-list-table td.col-pep,
.tracker-list-table td.col-action {
  overflow-wrap: normal;
}

.status-chip,
.type-chip {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-active {
  border-color: #a6f4c5;
  background: #ecfdf3;
  color: var(--green);
}

.status-pending {
  border-color: #fedf89;
  background: #fffaeb;
  color: #93370d;
}

.status-flight-validation {
  border-color: #b2ddff;
  background: #eff8ff;
  color: #175cd3;
}

.status-empty,
.type-empty {
  color: var(--muted);
}

.row-action {
  display: inline-flex;
  padding: 6px 9px;
  color: var(--blue);
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
  margin-bottom: 34px;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
}

.rows-per-page-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-left: auto;
}

.rows-per-page-form label {
  display: grid;
  gap: 4px;
  color: var(--blue-ink);
  font-size: 12px;
  font-weight: 800;
}

.rows-per-page-form select {
  min-width: 112px;
}

.content-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 18px;
}

.content-section h2 {
  font-size: 18px;
}

.report-builder {
  display: grid;
  gap: 18px;
}

.section-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.report-fieldset {
  min-width: 0;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  padding: 14px;
}

.report-fieldset legend {
  padding: 0 6px;
  color: var(--blue-ink);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.compact-fieldset {
  max-width: 560px;
}

.report-option-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
}

.report-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 9px;
  align-items: flex-start;
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  color: var(--text);
  background: var(--panel);
}

.report-option.selected {
  border-color: var(--blue);
  background: #eef4ff;
}

.report-option input,
.checkbox-pill input {
  width: auto;
  min-height: 0;
  margin-top: 3px;
}

.report-option strong,
.report-option small {
  display: block;
}

.report-option small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.report-control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
}

.checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.checkbox-pill {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.report-result-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.report-result-summary p {
  margin-bottom: 6px;
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(360px, 1fr));
  gap: 16px;
}

.help-topic {
  margin-bottom: 0;
}

.help-topic ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

.help-definition-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.help-definition-list dt {
  color: var(--blue-ink);
  font-size: 13px;
  font-weight: 800;
}

.help-definition-list dd {
  margin: 4px 0 0;
  color: var(--muted);
}

.column-preferences-panel {
  padding: 0;
}

.column-preferences-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  color: var(--blue-ink);
  cursor: pointer;
  font-weight: 800;
}

.column-preferences-panel summary strong {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.column-preferences-form {
  border-top: 1px solid var(--soft-line);
  padding: 14px 16px 16px;
}

.column-preference-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 10px;
}

.column-preference-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  padding: 8px 10px;
}

.column-preference-row.locked {
  grid-template-columns: 1fr auto;
  background: #f8f9fc;
}

.access-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(620px, 1fr);
  gap: 18px;
  align-items: start;
}

.access-filter-form,
.access-editor {
  display: grid;
  gap: 12px;
}

.access-filter-form {
  grid-template-columns: minmax(0, 1fr) minmax(110px, 0.8fr);
  align-items: end;
}

#reloadUsers {
  grid-column: 1 / -1;
  justify-self: stretch;
}

.access-user-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.access-user-row {
  display: grid;
  gap: 4px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  background: var(--panel);
  cursor: pointer;
  font: inherit;
  text-align: left;
  text-decoration: none;
}

.access-user-row:hover,
.access-user-row.selected {
  border-color: var(--blue);
  background: #eef4ff;
}

.access-user-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.access-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px 18px;
  margin: 0 0 18px;
}

.access-detail-grid dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.access-detail-grid dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.access-action-row {
  display: grid;
  grid-template-columns: auto minmax(180px, 260px) auto auto minmax(80px, auto);
  gap: 8px;
  align-items: center;
}

.access-save-status {
  min-height: 20px;
  min-width: 80px;
  font-weight: 800;
  white-space: nowrap;
}

.access-all-toggle {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  justify-self: start;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--blue-ink);
}

.access-all-toggle input,
.access-proponent input {
  width: auto;
  min-height: 0;
}

.access-proponent-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 8px;
}

.access-proponent {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.status.error {
  color: var(--red);
}

.status.ok {
  color: var(--green);
}

.column-preference-name {
  min-width: 0;
  font-size: 13px;
  font-weight: 800;
}

.compact-check,
.order-control {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 12px;
}

.compact-check input {
  width: auto;
  min-height: 0;
}

.order-control input {
  width: 58px;
  min-height: 32px;
  padding: 4px 6px;
}

.record-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 16px;
}

.record-edit-form {
  display: grid;
  gap: 18px;
}

.helper-section {
  display: grid;
  gap: 14px;
}

.helper-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) auto minmax(260px, 1fr);
  gap: 12px;
  align-items: end;
}

.helper-note {
  margin: 0;
  align-self: center;
  color: var(--muted);
  font-size: 13px;
}

.inline-helper-form {
  border-top: 1px solid var(--soft-line);
  padding-top: 14px;
}

.location-update-grid {
  grid-template-columns: minmax(140px, 0.7fr) minmax(120px, 0.6fr) minmax(220px, 1fr) auto;
}

.record-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(360px, 1fr));
  gap: 16px;
}

.edit-section {
  margin-bottom: 0;
}

.section-help,
.field-help,
.field-warning,
.field-error {
  margin: 6px 0 0;
  font-size: 12px;
}

.section-help,
.field-help {
  color: var(--muted);
}

.field-warning {
  color: #93370d;
}

.field-error {
  color: var(--red);
  font-weight: 800;
}

.edit-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 14px 16px;
}

.edit-field {
  min-width: 0;
}

.edit-field:has(textarea),
.edit-field[data-field-name="procedure_name"],
.edit-field[data-field-name="remarks"],
.edit-field[data-field-name="notam"],
.edit-field[data-field-name="notam2"] {
  grid-column: 1 / -1;
}

.edit-field.has-error input,
.edit-field.has-error select,
.edit-field.has-error textarea {
  border-color: var(--red);
}

.required-marker {
  display: inline-flex;
  margin-left: 6px;
  border-radius: 999px;
  padding: 1px 6px;
  color: var(--red);
  background: #fff1f3;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.form-errors,
.change-summary-panel {
  border: 1px solid var(--line);
  border-left: 5px solid var(--red);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
}

.change-summary-panel {
  border-left-color: var(--gold);
}

.change-summary-panel h2 {
  font-size: 18px;
}

.edit-action-bar {
  position: sticky;
  bottom: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--panel);
  box-shadow: 0 -6px 18px rgba(16, 24, 40, 0.12);
}

.edit-action-bar p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.field-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px 18px;
  margin: 0;
}

.field-list div {
  min-width: 0;
}

.field-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.field-list dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.file-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 12px;
}

.file-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  padding: 14px;
}

.file-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.file-panel-heading h3,
.file-status,
.form-progress {
  margin: 0;
}

.file-meta {
  display: grid;
  gap: 8px;
  margin: 0;
}

.file-meta div {
  min-width: 0;
}

.file-meta dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.file-meta dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
}

.attachment-form,
.attachment-delete-form {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--soft-line);
  padding-top: 12px;
}

.file-input-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.confirm-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text);
  font-weight: 600;
}

.confirm-row input {
  width: auto;
  min-height: 0;
  margin-top: 3px;
}

.form-progress {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.meta-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.ok-pill {
  border-color: #abefc6;
  background: #ecfdf3;
  color: var(--green);
}

.warn-pill {
  border-color: #fecdca;
  background: #fef3f2;
  color: var(--red);
}

.neutral-pill {
  border-color: var(--soft-line);
  background: #f8f9fc;
  color: var(--muted);
}

.compact th,
.compact td {
  font-size: 13px;
}

.ok {
  color: var(--green);
}

.warn {
  color: var(--red);
}

.muted,
.empty-state {
  color: var(--muted);
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

.zk-layout {
  display: grid;
  grid-template-columns: minmax(320px, 400px) minmax(640px, 1fr);
  gap: 18px;
  align-items: start;
}

.zk-sidebar,
.zk-editor-section {
  display: grid;
  gap: 14px;
}

.zk-control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.zk-control-grid .wide-filter {
  grid-column: 1 / -1;
}

.zk-actions {
  justify-content: stretch;
}

.zk-actions .button {
  flex: 1;
}

.zk-auth-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 32px;
  align-items: center;
}

.zk-records-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--soft-line);
  padding-top: 14px;
}

.zk-records-heading h3,
.zk-records-heading .status,
.zk-save-bar .status {
  margin: 0;
}

.zk-record-list {
  display: grid;
  gap: 8px;
  max-height: 540px;
  overflow: auto;
}

.zk-route-item {
  display: grid;
  gap: 4px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  background: var(--panel);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.zk-route-item:hover,
.zk-route-item.selected {
  border-color: var(--blue);
  background: #eef4ff;
}

.zk-route-item span {
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 800;
}

.zk-json-editor {
  min-height: 560px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.zk-json-fallback {
  display: none;
  min-height: 560px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

.zk-save-bar {
  position: static;
}

.zk-save-bar .filter-actions {
  margin: 0;
}
