:root {
  color-scheme: light;
  --bg: #f6f2ea;
  --surface: #fffdf8;
  --surface-strong: #ffffff;
  --text: #111827;
  --muted: #667085;
  --line: #ded6c8;
  --line-soft: #eee7dc;
  --gold: #d29b1f;
  --gold-dark: #8a640e;
  --gold-soft: #fff4d6;
  --green: #157f3b;
  --red: #b42318;
  --red-soft: #fff1f0;
  --shadow: 0 18px 45px rgba(17, 24, 39, 0.1);
  --sidebar: 272px;
}

.media-fieldset {
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 16px;
}

.media-fieldset img {
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  object-fit: cover;
  width: 100%;
}

.check-label {
  align-items: center;
  display: flex !important;
  flex-direction: row !important;
  gap: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  font-weight: 700;
  justify-content: center;
  min-height: 40px;
  padding: 9px 14px;
}

button:hover {
  filter: brightness(0.98);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  margin-top: 6px;
  padding: 10px 11px;
}

textarea {
  resize: vertical;
}

[hidden] {
  display: none !important;
}

.eyebrow {
  color: var(--gold-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 4px;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
  margin: 0;
}

.status {
  color: var(--muted);
  min-height: 22px;
}

.status.error {
  color: var(--red);
}

.form-summary {
  background: var(--red-soft);
  border: 1px solid color-mix(in srgb, var(--red) 28%, var(--line));
  border-radius: 10px;
  color: var(--red);
  font-size: 13px;
  padding: 10px 12px;
}

.form-field-error {
  color: var(--red);
  font-size: 13px;
  margin: -6px 0 0;
}

.auth-form a.secondary-button {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  text-decoration: none;
}

.login-screen {
  align-items: center;
  display: grid;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 400px);
  margin: 0 auto;
  max-width: 980px;
  padding: 32px;
  width: 100%;
}

.login-card h1 {
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1;
  margin: 0 0 16px;
}

.auth-form,
.drawer-form {
  display: grid;
  gap: 14px;
}

.auth-form label,
.drawer-form label {
  color: var(--muted);
  display: block;
  font-size: 13px;
  font-weight: 800;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: #15130f;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100vh;
  overflow-y: auto;
  padding: 18px;
  position: sticky;
  top: 0;
}

.brand-block {
  align-items: center;
  display: flex;
  gap: 12px;
  margin-bottom: 22px;
}

.brand-block h1 {
  font-size: 22px;
  line-height: 1;
  margin: 0;
}

.brand-mark {
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  box-shadow: 0 0 0 2px rgba(210, 155, 31, 0.2);
  display: block;
  flex: 0 0 auto;
  height: 42px;
  object-fit: contain;
  padding: 2px;
  width: 42px;
}

.nav {
  display: grid;
  gap: 6px;
  align-content: start;
}

.nav button,
.ghost-button,
.secondary-button {
  background: transparent;
  color: inherit;
}

.nav button {
  border: 0;
  color: rgba(255, 255, 255, 0.76);
  justify-content: flex-start;
  padding: 11px 12px;
  text-align: left;
}

.nav button.active,
.nav button:hover {
  background: rgba(210, 155, 31, 0.18);
  color: #fff;
}

.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  gap: 6px;
  padding-top: 16px;
}

.sidebar-footer strong,
.sidebar-footer span {
  overflow-wrap: anywhere;
}

.ghost-button {
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  margin-top: 8px;
}

.workspace {
  min-width: 0;
  padding: 22px;
}

.topbar {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.topbar h2 {
  font-size: 30px;
  line-height: 1.1;
  margin: 0;
}

.topbar-actions,
.section-toolbar,
.toolbar-actions,
.drawer-actions,
.table-actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.environment-badge,
.status-badge {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  padding: 7px 10px;
  text-transform: capitalize;
  white-space: nowrap;
}

.environment-badge {
  background: var(--gold-soft);
  border: 1px solid #f0cf7a;
  color: var(--gold-dark);
}

.global-status {
  margin-bottom: 10px;
}

.section {
  display: none;
}

.active-section {
  display: block;
}

.metric-grid,
.dashboard-grid {
  display: grid;
  gap: 14px;
}

.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric,
.content-panel,
.record-list,
.empty-state {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric {
  padding: 18px;
}

.metric span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  font-weight: 800;
}

.metric strong {
  display: block;
  font-size: 34px;
  line-height: 1;
  margin: 12px 0 8px;
}

.metric small {
  color: var(--muted);
}

.dashboard-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}

.content-panel,
.empty-state {
  padding: 18px;
}

.content-panel h3,
.empty-state h3,
.section-toolbar h3 {
  margin: 0 0 6px;
}

.section-toolbar {
  justify-content: space-between;
  margin-bottom: 14px;
}

.service-search input {
  min-width: min(320px, 42vw);
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.drawer-content {
  min-width: 0;
}

.pagination {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
}

.pagination p {
  margin: 0;
}

.pagination-actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.sr-only {
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.record-list {
  overflow-x: auto;
  overflow-y: visible;
}

/* Semantic responsive record tables ------------------------------------ */
.record-list {
  container-name: record-list;
  container-type: inline-size;
  overflow-x: auto;
}

.record-list-tools {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.card-select-all,
.card-sort-bar {
  align-items: center;
  gap: 8px;
}

.card-select-all {
  color: var(--muted);
  display: none;
  font-size: 12px;
  font-weight: 800;
}

.card-select-all input {
  margin: 0;
  width: auto;
}

.card-sort-bar {
  display: none;
  flex-wrap: wrap;
  margin-left: auto;
}

.card-sort-bar label {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  gap: 7px;
}

.card-sort-bar select {
  margin: 0;
  min-height: 38px;
  width: auto;
}

.records-table {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 760px;
  table-layout: fixed;
  width: 100%;
}

.records-table.table-layout-standard-five col:nth-child(1) { width: 30%; }
.records-table.table-layout-standard-five col:nth-child(2) { width: 14%; }
.records-table.table-layout-standard-five col:nth-child(3) { width: 18%; }
.records-table.table-layout-standard-five col:nth-child(4) { width: 14%; }
.records-table.table-layout-standard-five col:nth-child(5) { width: 24%; }

.records-table.table-layout-places-six {
  min-width: 840px;
}

.records-table.table-layout-places-six col:nth-child(1) { width: 27%; }
.records-table.table-layout-places-six col:nth-child(2) { width: 12%; }
.records-table.table-layout-places-six col:nth-child(3) { width: 12%; }
.records-table.table-layout-places-six col:nth-child(4) { width: 15%; }
.records-table.table-layout-places-six col:nth-child(5) { width: 15%; }
.records-table.table-layout-places-six col:nth-child(6) { width: 19%; }

.records-table.table-layout-reports-seven {
  min-width: 1000px;
}

.records-table.table-layout-reports-seven col:nth-child(1) { width: 22%; }
.records-table.table-layout-reports-seven col:nth-child(2) { width: 10%; }
.records-table.table-layout-reports-seven col:nth-child(3) { width: 15%; }
.records-table.table-layout-reports-seven col:nth-child(4) { width: 14%; }
.records-table.table-layout-reports-seven col:nth-child(5) { width: 11%; }
.records-table.table-layout-reports-seven col:nth-child(6) { width: 16%; }
.records-table.table-layout-reports-seven col:nth-child(7) { width: 12%; }

.records-table.table-layout-audit-four,
.records-table.table-layout-offices-four {
  min-width: 680px;
}

.records-table.table-layout-audit-four col:nth-child(1) { width: 34%; }
.records-table.table-layout-audit-four col:nth-child(2) { width: 22%; }
.records-table.table-layout-audit-four col:nth-child(3) { width: 22%; }
.records-table.table-layout-audit-four col:nth-child(4) { width: 22%; }

.records-table.table-layout-offices-four col:nth-child(1) { width: 34%; }
.records-table.table-layout-offices-four col:nth-child(2) { width: 28%; }
.records-table.table-layout-offices-four col:nth-child(3) { width: 14%; }
.records-table.table-layout-offices-four col:nth-child(4) { width: 24%; }

.records-table.table-layout-requests-five {
  min-width: 840px;
}

.records-table.table-layout-requests-five col:nth-child(1) { width: 26%; }
.records-table.table-layout-requests-five col:nth-child(2) { width: 20%; }
.records-table.table-layout-requests-five col:nth-child(3) { width: 22%; }
.records-table.table-layout-requests-five col:nth-child(4) { width: 14%; }
.records-table.table-layout-requests-five col:nth-child(5) { width: 18%; }

.records-table th,
.records-table td {
  min-width: 0;
  overflow-wrap: anywhere;
}

.records-table th[data-text-behavior="compact"],
.records-table td[data-text-behavior="compact"] {
  white-space: nowrap;
}

.records-table th[data-text-behavior="wrap"],
.records-table td[data-text-behavior="wrap"] {
  white-space: normal;
}

.records-table th {
  background: var(--surface-muted);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  padding: 13px 15px;
  text-align: left;
  text-transform: uppercase;
  vertical-align: middle;
}

.records-table th:first-child {
  border-top-left-radius: 14px;
}

.records-table th:last-child {
  border-top-right-radius: 14px;
}

.records-table td {
  border-top: 1px solid var(--line-soft);
  padding: 15px 16px;
  vertical-align: middle;
}

.records-table tbody tr:last-child td:first-child {
  border-bottom-left-radius: 14px;
}

.records-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 14px;
}

.table-sort-button {
  align-items: center;
  background: transparent;
  border: 0;
  color: inherit;
  display: inline-flex;
  font-size: inherit;
  font-weight: inherit;
  gap: 6px;
  justify-content: space-between;
  letter-spacing: inherit;
  min-height: 26px;
  padding: 0;
  text-align: left;
  text-transform: inherit;
  width: 100%;
}

.table-sort-button:hover:not(:disabled) {
  color: var(--gold-strong);
  transform: none;
}

.table-sort-indicator {
  color: var(--gold-strong);
  flex: 0 0 auto;
  font-size: 14px;
}

.records-table th > .selection-cell {
  display: inline-flex;
  margin-right: 7px;
  vertical-align: middle;
}

.records-table th > .selection-cell input {
  margin: 0;
}

.records-table th > .selection-cell + .table-sort-button {
  width: calc(100% - 28px);
}

.records-table .title-cell strong,
.records-table .title-cell span,
.records-table .table-text {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.records-table .table-text-compact {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.records-table .table-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.records-table .selection-cell {
  align-items: flex-start;
  min-width: 0;
}

/* The report queue now opens its existing workflow in a compact dialog. */
.report-quick-dialog {
  border: 0;
  border-radius: 18px;
  box-shadow: var(--shadow-md);
  margin: auto;
  max-height: calc(100vh - 24px);
  max-width: 540px;
  padding: 0;
  width: min(540px, calc(100vw - 24px));
}

.report-quick-dialog::backdrop {
  background: rgba(17, 24, 39, 0.58);
}

.report-quick-card {
  background: var(--surface-raised);
  display: grid;
  gap: 18px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  padding: 24px;
}

.report-quick-header {
  align-items: start;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding-bottom: 16px;
}

.report-quick-header h2,
.report-quick-section h3 {
  margin: 0;
}

.report-quick-section {
  border-bottom: 1px solid var(--line-soft);
  display: grid;
  gap: 12px;
  padding-bottom: 18px;
}

.report-quick-form {
  display: grid;
  gap: 10px;
}

.report-quick-form button {
  justify-self: start;
}

.report-quick-actions {
  margin-top: 0;
}

@container record-list (max-width: 799px) {
  .record-list[data-table-layout="standard-five"] .card-select-all,
  .record-list[data-table-layout="standard-five"] .card-sort-bar {
    display: flex;
  }

  .record-list[data-table-layout="standard-five"] .records-table {
    display: block;
  }

  .record-list[data-table-layout="standard-five"] .records-table {
    min-width: 0;
  }

  .record-list[data-table-layout="standard-five"] .records-table colgroup,
  .record-list[data-table-layout="standard-five"] .records-table thead {
    display: none;
  }

  .record-list[data-table-layout="standard-five"] .records-table tbody {
    display: grid;
    gap: 10px;
  }

  .record-list[data-table-layout="standard-five"] .records-table tbody tr {
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    display: grid;
    gap: 0;
    padding: 12px 14px;
  }

  .record-list[data-table-layout="standard-five"] .records-table tbody td {
    border: 0;
    border-bottom: 1px solid var(--line-soft);
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(92px, 0.36fr) minmax(0, 1fr);
    padding: 9px 0;
  }

  .record-list[data-table-layout="standard-five"] .records-table tbody td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .record-list[data-table-layout="standard-five"] .records-table tbody td:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .record-list[data-table-layout="standard-five"] .records-table .table-actions {
    justify-content: flex-start;
  }
}

@container record-list (max-width: 879px) {
  .record-list[data-table-layout="places-six"] .card-select-all,
  .record-list[data-table-layout="places-six"] .card-sort-bar,
  .record-list[data-table-layout="requests-five"] .card-select-all,
  .record-list[data-table-layout="requests-five"] .card-sort-bar {
    display: flex;
  }

  .record-list[data-table-layout="places-six"] .records-table,
  .record-list[data-table-layout="requests-five"] .records-table {
    display: block;
  }

  .record-list[data-table-layout="places-six"] .records-table,
  .record-list[data-table-layout="requests-five"] .records-table {
    min-width: 0;
  }

  .record-list[data-table-layout="places-six"] .records-table colgroup,
  .record-list[data-table-layout="places-six"] .records-table thead,
  .record-list[data-table-layout="requests-five"] .records-table colgroup,
  .record-list[data-table-layout="requests-five"] .records-table thead {
    display: none;
  }

  .record-list[data-table-layout="places-six"] .records-table tbody,
  .record-list[data-table-layout="requests-five"] .records-table tbody {
    display: grid;
    gap: 10px;
  }

  .record-list[data-table-layout="places-six"] .records-table tbody tr,
  .record-list[data-table-layout="requests-five"] .records-table tbody tr {
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    display: grid;
    gap: 0;
    padding: 12px 14px;
  }

  .record-list[data-table-layout="places-six"] .records-table tbody td,
  .record-list[data-table-layout="requests-five"] .records-table tbody td {
    border: 0;
    border-bottom: 1px solid var(--line-soft);
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(92px, 0.36fr) minmax(0, 1fr);
    padding: 9px 0;
  }

  .record-list[data-table-layout="places-six"] .records-table tbody td::before,
  .record-list[data-table-layout="requests-five"] .records-table tbody td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .record-list[data-table-layout="places-six"] .records-table tbody td:last-child,
  .record-list[data-table-layout="requests-five"] .records-table tbody td:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .record-list[data-table-layout="places-six"] .records-table .table-actions,
  .record-list[data-table-layout="requests-five"] .records-table .table-actions {
    justify-content: flex-start;
  }
}

@container record-list (max-width: 1039px) {
  .record-list[data-table-layout="reports-seven"] .card-select-all,
  .record-list[data-table-layout="reports-seven"] .card-sort-bar {
    display: flex;
  }

  .record-list[data-table-layout="reports-seven"] .records-table {
    display: block;
  }

  .record-list[data-table-layout="reports-seven"] .records-table {
    min-width: 0;
  }

  .record-list[data-table-layout="reports-seven"] .records-table colgroup,
  .record-list[data-table-layout="reports-seven"] .records-table thead {
    display: none;
  }

  .record-list[data-table-layout="reports-seven"] .records-table tbody {
    display: grid;
    gap: 10px;
  }

  .record-list[data-table-layout="reports-seven"] .records-table tbody tr {
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    display: grid;
    gap: 0;
    padding: 12px 14px;
  }

  .record-list[data-table-layout="reports-seven"] .records-table tbody td {
    border: 0;
    border-bottom: 1px solid var(--line-soft);
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(92px, 0.36fr) minmax(0, 1fr);
    padding: 9px 0;
  }

  .record-list[data-table-layout="reports-seven"] .records-table tbody td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .record-list[data-table-layout="reports-seven"] .records-table tbody td:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .record-list[data-table-layout="reports-seven"] .records-table .table-actions {
    justify-content: flex-start;
  }
}

@container record-list (max-width: 719px) {
  .record-list[data-table-layout="audit-four"] .card-sort-bar,
  .record-list[data-table-layout="audit-four"] .records-table,
  .record-list[data-table-layout="offices-four"] .card-sort-bar,
  .record-list[data-table-layout="offices-four"] .records-table {
    display: block;
  }

  .record-list[data-table-layout="audit-four"] .card-sort-bar,
  .record-list[data-table-layout="offices-four"] .card-sort-bar {
    display: flex;
  }

  .record-list[data-table-layout="audit-four"] .records-table,
  .record-list[data-table-layout="offices-four"] .records-table {
    min-width: 0;
  }

  .record-list[data-table-layout="audit-four"] .records-table colgroup,
  .record-list[data-table-layout="audit-four"] .records-table thead,
  .record-list[data-table-layout="offices-four"] .records-table colgroup,
  .record-list[data-table-layout="offices-four"] .records-table thead {
    display: none;
  }

  .record-list[data-table-layout="audit-four"] .records-table tbody,
  .record-list[data-table-layout="offices-four"] .records-table tbody {
    display: grid;
    gap: 10px;
  }

  .record-list[data-table-layout="audit-four"] .records-table tbody tr,
  .record-list[data-table-layout="offices-four"] .records-table tbody tr {
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    display: grid;
    gap: 0;
    padding: 12px 14px;
  }

  .record-list[data-table-layout="audit-four"] .records-table tbody td,
  .record-list[data-table-layout="offices-four"] .records-table tbody td {
    border: 0;
    border-bottom: 1px solid var(--line-soft);
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(92px, 0.36fr) minmax(0, 1fr);
    padding: 9px 0;
  }

  .record-list[data-table-layout="audit-four"] .records-table tbody td::before,
  .record-list[data-table-layout="offices-four"] .records-table tbody td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .record-list[data-table-layout="audit-four"] .records-table tbody td:last-child,
  .record-list[data-table-layout="offices-four"] .records-table tbody td:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .record-list[data-table-layout="offices-four"] .records-table .table-actions {
    justify-content: flex-start;
  }
}

.record-list:focus-visible {
  outline: 3px solid rgba(212, 166, 42, 0.6);
  outline-offset: 2px;
}

.drawer-content > * { min-width: 0; }
.drawer-local-status { min-height: 1.25rem; margin: 0; }
.category-manager-list { display: grid; gap: 8px; min-width: 0; }
.category-manager-row {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-width: 0;
  padding: 12px;
}
.category-manager-name { font-weight: 800; min-width: 0; overflow-wrap: anywhere; }
.category-manager-meta,
.category-manager-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.category-manager-actions { justify-content: flex-end; }
@media (max-width: 420px) {
  .category-manager-row { align-items: start; grid-template-columns: minmax(0, 1fr); }
  .category-manager-actions { justify-content: flex-start; }
}

.title-cell {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.title-cell strong,
.title-cell span,
.table-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.title-cell strong {
  overflow-wrap: anywhere;
}

.title-cell span {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.title-details {
  margin-top: 4px;
  min-width: 0;
}

.title-details summary {
  color: var(--gold-dark);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.title-details p {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.table-text {
  color: var(--muted);
  white-space: nowrap;
}

.status-badge {
  background: #eef2f7;
  color: #364152;
}

.status-published,
.status-active,
.status-resolved,
.status-closed {
  background: #eaf8ef;
  color: var(--green);
}

.status-draft,
.status-submitted,
.status-under_review {
  background: var(--gold-soft);
  color: var(--gold-dark);
}

.status-archived,
.status-rejected,
.status-inactive {
  background: var(--red-soft);
  color: var(--red);
}

.secondary-button {
  border: 1px solid var(--line);
  color: var(--text);
}

.service-category-panel {
  border-top: 1px solid var(--line);
  margin-top: 28px;
  padding-top: 24px;
}

.form-note {
  background: var(--gold-soft);
  border: 1px solid #f0cf7a;
  border-radius: 6px;
  color: var(--gold-dark);
  font-size: 13px;
  font-weight: 700;
  margin: 0;
  padding: 10px 11px;
}

.form-note.error,
.place-location-section .form-note.error {
  background: #fff0ef;
  border-color: #e8aaa5;
  color: var(--red);
}

.place-location-section {
  display: grid;
  gap: 12px;
}

.place-location-heading {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.place-location-heading h3 {
  margin: 0 0 6px;
}

.place-location-heading button {
  flex: 0 0 auto;
}

.coordinate-fields {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}

input[aria-invalid="true"] {
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(185, 28, 28, 0.12);
}

.map-picker-dialog {
  border: 0;
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(17, 24, 39, 0.28);
  margin: auto;
  max-height: calc(100vh - 24px);
  max-width: 900px;
  padding: 0;
  width: min(900px, calc(100vw - 24px));
}

.map-picker-dialog::backdrop {
  background: rgba(17, 24, 39, 0.66);
}

.map-picker-shell {
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 24px);
  overflow: auto;
  padding: 20px;
}

.map-picker-header {
  align-items: start;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding-bottom: 14px;
}

.map-picker-header h2 {
  margin: 0;
}

.map-picker-canvas {
  background: #e9e4da;
  border: 1px solid var(--line);
  border-radius: 10px;
  height: min(58vh, 520px);
  min-height: 280px;
  outline: none;
  overflow: hidden;
}

.map-picker-canvas:focus-visible {
  box-shadow: 0 0 0 3px rgba(196, 142, 22, 0.35);
}

.map-picker-draft {
  background: #f7f3ec;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  margin: 0;
  padding: 10px 12px;
}

.map-picker-actions {
  margin-top: 2px;
}

.danger-button {
  background: var(--red);
  color: #fff;
}

.report-status-form,
.report-assignment-form {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 1fr) auto;
  width: 100%;
}

.report-status-form input,
.report-status-form select,
.report-assignment-form select {
  margin: 0;
}

.report-assignment-form {
  grid-template-columns: minmax(160px, 1fr) auto;
  margin-bottom: 8px;
}

.drawer-overlay {
  background: rgba(17, 24, 39, 0.32);
  inset: 0;
  position: fixed;
  z-index: 20;
}

body.drawer-open {
  overflow: hidden;
}

.drawer {
  background: var(--surface-strong);
  box-shadow: -24px 0 60px rgba(17, 24, 39, 0.2);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  max-width: min(520px, 100vw);
  overflow: hidden;
  padding: 20px;
  position: fixed;
  right: 0;
  top: 0;
  width: 520px;
  z-index: 30;
}

.drawer > .drawer-form,
.drawer > .drawer-content,
.drawer > .account-drawer-content {
  align-content: start;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.drawer-header {
  align-items: start;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
}

.drawer-header h2 {
  margin: 0;
}

.icon-button {
  background: #f2eee7;
  flex: 0 0 44px;
  height: 44px;
  min-height: 44px;
  min-width: 44px;
  padding: 0;
  width: 44px;
}

.drawer-header > div,
.report-quick-header > div,
.map-picker-header > div {
  min-width: 0;
  overflow-wrap: anywhere;
}

.drawer-form[hidden] {
  display: none !important;
}

.drawer-form [data-user-create-fields] {
  display: grid;
  gap: 14px;
}

.drawer-form [data-user-create-fields][hidden] {
  display: none;
}

.account-drawer-content {
  display: grid;
  gap: 20px;
}

.account-password-form {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.account-password-form h3 {
  margin: 0;
}

.drawer-actions {
  border-top: 1px solid var(--line);
  justify-content: flex-end;
  padding-top: 14px;
}

@media (max-width: 1100px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-status-form,
  .report-assignment-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .section-toolbar,
  .pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .service-search input {
    min-width: 0;
    width: 100%;
  }

  .pagination-actions {
    justify-content: space-between;
  }

  .login-card,
  .app-shell,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    height: auto;
    min-height: auto;
    overflow-y: visible;
    position: static;
  }

  .workspace {
    padding: 16px;
  }

  .topbar,
  .section-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions,
  .toolbar-actions {
    justify-content: space-between;
  }

  .table-actions,
  .drawer-actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 520px) {
  .login-screen {
    padding: 14px;
  }

  .login-card,
  .drawer {
    padding: 18px;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .topbar-actions,
  .toolbar-actions,
  .drawer-actions,
  .table-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .place-location-heading,
  .coordinate-fields {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .place-location-heading button {
    width: 100%;
  }

  .map-picker-shell {
    padding: 14px;
  }

  .map-picker-canvas {
    height: 52vh;
  }

  .topbar-actions > *,
  .toolbar-actions > *,
  .drawer-actions > *,
  .table-actions > * {
    width: 100%;
  }
}

/* Modern CMS shell ------------------------------------------------------ */
:root {
  color-scheme: light dark;
  --bg: #f5f6f4;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-muted: #f0f2ef;
  --surface-tint: #fafbf9;
  --text: #17201b;
  --muted: #68736d;
  --line: #dfe5df;
  --line-soft: #edf0ed;
  --gold: #c89218;
  --gold-strong: #9a6c0b;
  --gold-soft: #fff4d5;
  --green: #1b7a49;
  --green-soft: #eaf7ef;
  --red: #b42318;
  --red-soft: #fff0ef;
  --shadow-sm: 0 1px 2px rgba(21, 32, 24, 0.04), 0 8px 24px rgba(21, 32, 24, 0.04);
  --shadow-md: 0 14px 38px rgba(21, 32, 24, 0.1);
  --sidebar: 264px;
  --focus: 0 0 0 3px rgba(200, 146, 24, 0.24);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111613;
    --surface: #18201b;
    --surface-raised: #202a24;
    --surface-muted: #253029;
    --surface-tint: #1b241f;
    --text: #edf3ee;
    --muted: #a5b2a9;
    --line: #344139;
    --line-soft: #2a352e;
    --gold: #e0ae36;
    --gold-strong: #f2c35e;
    --gold-soft: #3b3019;
    --green: #7bd19f;
    --green-soft: #1e3c2b;
    --red: #ff9386;
    --red-soft: #3c211f;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.22), 0 8px 24px rgba(0, 0, 0, 0.18);
    --shadow-md: 0 16px 42px rgba(0, 0, 0, 0.38);
  }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: -0.005em;
}

body,
button,
input,
select,
textarea {
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

button,
input,
select,
textarea {
  border-radius: 10px;
}

button {
  min-height: 44px;
  padding: 10px 16px;
  gap: 8px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

button:hover:not(:disabled) {
  filter: none;
  transform: translateY(-1px);
}

button:active:not(:disabled) {
  transform: translateY(0);
}

input,
select,
textarea {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
  min-height: 44px;
  padding: 10px 12px;
}

input::placeholder,
textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 72%, transparent);
}

.primary-action {
  background: var(--gold);
  border-color: transparent;
  color: #17130b;
  box-shadow: 0 2px 5px rgba(157, 111, 13, 0.16);
}

.secondary-button {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
}

.danger-button {
  background: var(--red);
  border-color: transparent;
  color: #fff;
}

.eyebrow {
  color: var(--gold-strong);
  font-size: 11px;
  letter-spacing: 0.08em;
  line-height: 1.2;
}

.muted {
  color: var(--muted);
}

.login-screen {
  background: radial-gradient(circle at 20% 15%, rgba(216, 173, 72, 0.15), transparent 34%), var(--bg);
  padding: 32px;
}

.login-card {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-md);
  gap: 56px;
  max-width: 1040px;
  padding: clamp(28px, 6vw, 64px);
}

.login-intro {
  display: grid;
  align-content: center;
  gap: 12px;
}

.login-intro h1 {
  font-size: clamp(42px, 7vw, 72px);
  letter-spacing: -0.06em;
  line-height: 0.92;
  margin: 4px 0 8px;
}

.login-intro h1 span {
  color: var(--gold-strong);
}

.login-brand-mark {
  align-items: center;
  background: var(--gold);
  border-radius: 14px;
  color: #201908;
  display: inline-flex;
  font-size: 24px;
  font-weight: 900;
  height: 48px;
  justify-content: center;
  letter-spacing: -0.08em;
  width: 48px;
}

.login-trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.login-trust-row span {
  background: var(--surface-muted);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 7px 10px;
}

.auth-form {
  align-self: center;
  background: var(--surface-tint);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  gap: 12px;
  padding: 22px;
}

.auth-form label,
.drawer-form label {
  color: var(--text);
  font-size: 12px;
  letter-spacing: 0.01em;
}

/* Office account request ------------------------------------------------ */
.request-brand-seal,
.request-intro-copy,
.request-capability-list,
.request-review-note {
  display: none;
}

.login-screen[data-auth-view="request-account"] {
  background:
    radial-gradient(circle at 13% 20%, color-mix(in srgb, var(--gold) 13%, transparent), transparent 29%),
    radial-gradient(circle at 84% 80%, color-mix(in srgb, var(--green) 6%, transparent), transparent 30%),
    var(--bg);
  padding: 16px 24px;
}

.login-screen[data-auth-view="request-account"] .login-card {
  background: transparent;
  border: 0;
  box-shadow: none;
  gap: clamp(32px, 4vw, 64px);
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  max-width: 1440px;
  padding: clamp(16px, 2.5vw, 40px);
}

.login-screen[data-auth-view="request-account"] .login-intro {
  align-content: center;
  gap: 10px;
  padding: 8px 0;
}

.login-screen[data-auth-view="request-account"] .login-brand-mark,
.login-screen[data-auth-view="request-account"] .login-intro-copy,
.login-screen[data-auth-view="request-account"] .login-trust-row {
  display: none;
}

.login-screen[data-auth-view="request-account"] .request-brand-seal,
.login-screen[data-auth-view="request-account"] .request-intro-copy,
.login-screen[data-auth-view="request-account"] .request-capability-list,
.login-screen[data-auth-view="request-account"] .request-review-note {
  display: block;
}

.request-brand-seal {
  background: #fff;
  border: 2px solid color-mix(in srgb, var(--gold) 42%, var(--line));
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(17, 24, 19, 0.16);
  height: 64px;
  object-fit: contain;
  padding: 3px;
  width: 64px;
}

.login-screen[data-auth-view="request-account"] .login-intro h1 {
  font-size: clamp(50px, 5.8vw, 76px);
  margin-bottom: 10px;
}

.request-intro-copy {
  font-size: 15px;
  line-height: 1.6;
  max-width: 34ch;
}

.request-capability-list {
  margin-top: 18px;
}

.request-capability {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 42px minmax(0, 1fr);
  margin-top: 13px;
}

.request-capability > span:last-child {
  display: grid;
  gap: 2px;
}

.request-capability strong {
  color: var(--text);
  font-size: 13px;
}

.request-capability small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.request-capability-icon,
.request-review-icon,
.account-request-header-icon,
.account-request-section-icon {
  align-items: center;
  color: var(--gold-strong);
  display: inline-flex;
  justify-content: center;
}

.request-capability-icon {
  background: color-mix(in srgb, var(--gold-soft) 62%, var(--surface-muted));
  border: 1px solid color-mix(in srgb, var(--gold) 16%, var(--line-soft));
  border-radius: 999px;
  height: 42px;
  width: 42px;
}

.request-capability-icon svg,
.request-review-icon svg,
.account-request-header-icon svg,
.account-request-section-icon svg,
.password-visibility-button svg {
  fill: none;
  height: 20px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 20px;
}

.request-review-note {
  align-items: center;
  background: color-mix(in srgb, var(--surface-tint) 90%, var(--gold) 10%);
  border: 1px solid color-mix(in srgb, var(--gold) 18%, var(--line));
  border-radius: 13px;
  display: none;
  gap: 11px;
  margin-top: 20px;
  padding: 13px 14px;
}

.login-screen[data-auth-view="request-account"] .request-review-note {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
}

.request-review-icon {
  background: var(--green-soft);
  border-radius: 999px;
  color: var(--green);
  height: 34px;
  width: 34px;
}

.request-review-icon svg {
  height: 18px;
  width: 18px;
}

.request-review-note p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin: 0;
}

.account-request-form {
  align-self: center;
  background: color-mix(in srgb, var(--surface-raised) 96%, var(--gold) 4%);
  border-color: color-mix(in srgb, var(--gold) 12%, var(--line));
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  gap: 11px;
  padding: clamp(22px, 2.6vw, 34px);
}

.account-request-header {
  align-items: center;
  display: grid;
  gap: 13px;
  grid-template-columns: 44px minmax(0, 1fr);
  margin-bottom: 2px;
}

.account-request-header-icon {
  background: color-mix(in srgb, var(--gold-soft) 58%, var(--surface-muted));
  border-radius: 13px;
  height: 44px;
  width: 44px;
}

.account-request-header h2 {
  font-size: clamp(22px, 2.2vw, 30px);
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin: 0;
  max-width: 100%;
  width: fit-content;
}

.account-request-header p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin: 5px 0 0;
}

.account-request-section {
  border: 0;
  border-top: 1px solid var(--line-soft);
  margin: 0;
  min-width: 0;
  padding: 11px 0 0;
}

.account-request-section legend {
  align-items: center;
  color: var(--text);
  display: flex;
  font-size: 13px;
  font-weight: 800;
  gap: 8px;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
  padding: 0 10px 0 0;
  width: 100%;
}

.account-request-section-icon {
  color: var(--gold);
}

.account-request-section-icon svg {
  height: 17px;
  width: 17px;
}

.account-request-grid {
  display: grid;
  gap: 9px 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 520px) {
  .place-detail-fields {
    grid-template-columns: 1fr;
  }
}

.account-request-field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.account-request-field label {
  font-size: 11px;
}

.account-request-field input,
.account-request-field select {
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  margin-top: 0;
  min-height: 42px;
  padding-block: 8px;
}

.account-request-password-field {
  position: relative;
}

.account-request-password-field input {
  padding-right: 44px;
}

.password-visibility-button {
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  height: 34px;
  min-height: 34px;
  padding: 0;
  position: absolute;
  right: 5px;
  top: 4px;
  width: 34px;
}

.password-visibility-button:hover:not(:disabled) {
  background: var(--surface-muted);
  color: var(--text);
  transform: none;
}

.password-visibility-button .password-icon-hide,
.password-visibility-button[aria-pressed="true"] .password-icon-show {
  display: none;
}

.password-visibility-button[aria-pressed="true"] .password-icon-hide {
  display: block;
}

.account-request-hint {
  color: var(--muted);
  font-size: 10px;
  margin: 5px 0 0;
}

.account-request-footer {
  align-items: center;
  border-top: 1px solid var(--line-soft);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding-top: 12px;
}

.account-request-required {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 11px;
  gap: 7px;
  margin: 0;
  white-space: nowrap;
}

.account-request-required span {
  align-items: center;
  border: 1px solid var(--muted);
  border-radius: 999px;
  display: inline-flex;
  font-size: 9px;
  font-weight: 900;
  height: 16px;
  justify-content: center;
  width: 16px;
}

.account-request-actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.account-request-actions button {
  min-width: 150px;
}

.request-back-button {
  background: transparent;
  border: 0;
  color: var(--gold-strong);
  min-width: auto !important;
  padding-inline: 12px;
}

.request-back-button:hover:not(:disabled) {
  background: var(--gold-soft);
  transform: none;
}

.account-request-status {
  border-radius: 10px;
  font-size: 12px;
  margin: 0;
  min-height: 0;
}

.account-request-status:empty {
  display: none;
}

.account-request-status:not(:empty) {
  background: var(--surface-muted);
  border: 1px solid var(--line);
  padding: 9px 11px;
}

.account-request-status[data-state="loading"] {
  color: var(--muted);
}

.account-request-status[data-state="success"] {
  background: var(--green-soft);
  border-color: color-mix(in srgb, var(--green) 24%, var(--line));
  color: var(--green);
}

.account-request-status[data-state="error"] {
  background: var(--red-soft);
  border-color: color-mix(in srgb, var(--red) 24%, var(--line));
  color: var(--red);
}

@media (max-width: 1040px) {
  .login-screen[data-auth-view="request-account"] .login-card {
    gap: 28px;
    grid-template-columns: minmax(240px, 290px) minmax(0, 1fr);
  }

  .login-screen[data-auth-view="request-account"] .login-intro h1 {
    font-size: 54px;
  }
}

@media (max-width: 900px) {
  .login-screen[data-auth-view="request-account"] {
    align-items: start;
    padding: 22px;
  }

  .login-screen[data-auth-view="request-account"] .login-card {
    grid-template-columns: 1fr;
    margin: auto;
    max-width: 760px;
  }

  .login-screen[data-auth-view="request-account"] .login-intro {
    padding: 0 8px;
  }

  .login-screen[data-auth-view="request-account"] .request-capability-list {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .request-capability {
    align-items: start;
    grid-template-columns: 34px minmax(0, 1fr);
    margin-top: 0;
  }

  .request-capability-icon {
    height: 34px;
    width: 34px;
  }
}

@media (max-width: 700px) {
  .account-request-grid {
    grid-template-columns: 1fr;
  }

  .login-screen[data-auth-view="request-account"] .request-capability-list {
    grid-template-columns: 1fr;
  }

  .account-request-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .account-request-required {
    white-space: normal;
  }

  .account-request-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .account-request-actions button {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .login-screen[data-auth-view="request-account"] {
    padding: 10px;
  }

  .login-screen[data-auth-view="request-account"] .login-card {
    gap: 18px;
    padding: 8px;
  }

  .login-screen[data-auth-view="request-account"] .login-intro h1 {
    font-size: 44px;
  }

  .account-request-form {
    border-radius: 16px;
    padding: 18px;
  }

  .account-request-header {
    align-items: start;
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .account-request-header-icon {
    border-radius: 11px;
    height: 38px;
    width: 38px;
  }
}

.app-shell {
  background: var(--bg);
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

.sidebar {
  background: #182019;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  padding: 22px 16px 16px;
}

.brand-block {
  margin: 0 8px 28px;
}

.brand-block h1 {
  color: #f4f7f4;
  font-size: 21px;
  letter-spacing: -0.04em;
}

.brand-subtitle {
  color: #9ea99f;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-left: 4px;
  text-transform: uppercase;
}

.brand-block .eyebrow {
  color: #d9aa35;
  margin-bottom: 5px;
}

.nav {
  align-content: start;
  display: grid;
  gap: 20px;
}

.nav-group {
  display: grid;
  gap: 4px;
}

.nav-group-label {
  color: #829087;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  margin: 0 12px 5px;
  text-transform: uppercase;
}

.nav button {
  align-items: center;
  border-radius: 10px;
  color: #b9c4bb;
  gap: 10px;
  min-height: 42px;
  padding: 9px 12px;
  position: relative;
}

.nav button.active,
.nav button:hover {
  background: rgba(218, 171, 54, 0.14);
  color: #fff;
}

.nav button.active::before {
  background: #dfad35;
  border-radius: 4px;
  content: "";
  height: 20px;
  left: 0;
  position: absolute;
  width: 3px;
}

.nav-icon {
  align-items: center;
  color: #92a097;
  display: inline-flex;
  font-size: 16px;
  justify-content: center;
  width: 20px;
}

.nav button.active .nav-icon,
.nav button:hover .nav-icon {
  color: #e0b344;
}

.nav-count {
  background: #ca941b;
  border-radius: 999px;
  color: #17130b;
  font-size: 10px;
  font-weight: 900;
  margin-left: auto;
  min-width: 20px;
  padding: 3px 6px;
  text-align: center;
}

.sidebar-footer {
  border-top-color: rgba(255, 255, 255, 0.09);
  gap: 12px;
  padding: 16px 8px 0;
}

.account-chip {
  align-items: center;
  display: flex;
  gap: 10px;
  min-width: 0;
}

.account-chip strong,
.account-chip span {
  display: block;
  overflow-wrap: anywhere;
}

.account-chip strong {
  color: #f4f7f4;
  font-size: 13px;
}

.account-chip .muted {
  color: #94a198;
  font-size: 11px;
  margin-top: 2px;
}

.avatar {
  align-items: center;
  background: #dcae38;
  border-radius: 10px;
  color: #201908;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 900;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.sidebar-footer-actions {
  display: grid;
  gap: 6px;
}

.ghost-button {
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #dce5de;
  justify-content: flex-start;
  margin: 0;
  min-height: 38px;
}

.ghost-button:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}

.workspace {
  max-width: 1540px;
  padding: 32px clamp(18px, 3.5vw, 52px) 48px;
  width: 100%;
}

.topbar {
  align-items: flex-end;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 24px;
  padding-bottom: 22px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar::before {
  background: var(--bg);
  content: "";
  inset: -32px -52px -1px;
  position: absolute;
  z-index: -1;
}

.breadcrumb {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  margin: 0 0 7px;
}

.breadcrumb span {
  color: var(--line);
  margin: 0 6px;
}

.topbar h2 {
  font-size: clamp(28px, 3.5vw, 40px);
  letter-spacing: -0.05em;
}

.status-dot {
  background: #34a56b;
  border-radius: 999px;
  display: inline-block;
  height: 7px;
  width: 7px;
}

.environment-badge {
  align-items: center;
  background: var(--green-soft);
  border-color: color-mix(in srgb, var(--green) 25%, var(--line));
  color: var(--green);
  gap: 6px;
  padding: 8px 11px;
}

.environment-badge::before {
  background: #34a56b;
  border-radius: 999px;
  content: "";
  display: inline-block;
  height: 7px;
  margin-right: 6px;
  width: 7px;
}

.global-status {
  border-radius: 10px;
  margin: -6px 0 18px;
  min-height: 0;
  padding: 0;
}

.global-status:not(:empty) {
  background: var(--surface-muted);
  border: 1px solid var(--line);
  min-height: 42px;
  padding: 10px 13px;
}

.global-status.error:not(:empty) {
  background: var(--red-soft);
  border-color: color-mix(in srgb, var(--red) 24%, var(--line));
}

.section-intro {
  align-items: flex-end;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 22px;
}

.section-intro h3 {
  font-size: clamp(20px, 2.3vw, 28px);
  letter-spacing: -0.04em;
  margin: 0 0 5px;
}

.section-intro .muted {
  max-width: 600px;
}

.metric-grid,
.dashboard-grid {
  gap: 16px;
}

.metric,
.content-panel,
.record-list,
.empty-state {
  background: var(--surface);
  border-color: var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}

.metric {
  min-height: 142px;
  padding: 20px;
}

.metric-heading {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 12px;
  font-weight: 800;
  justify-content: space-between;
}

.metric-icon {
  align-items: center;
  background: var(--green-soft);
  border-radius: 9px;
  color: var(--green);
  display: inline-flex;
  font-size: 16px;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.metric-icon-warm {
  background: var(--gold-soft);
  color: var(--gold-strong);
}

.metric strong {
  font-size: 38px;
  letter-spacing: -0.05em;
  margin: 18px 0 7px;
}

.metric small {
  color: var(--muted);
  font-size: 12px;
}

.dashboard-grid-main {
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  margin-top: 16px;
}

.content-panel {
  padding: 22px;
}

.content-panel h3 {
  font-size: 17px;
  letter-spacing: -0.025em;
}

.panel-heading {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel-heading .eyebrow {
  margin-bottom: 5px;
}

.panel-heading h3 {
  margin: 0;
}

.panel-heading-icon {
  align-items: center;
  background: var(--surface-muted);
  border-radius: 9px;
  color: var(--gold-strong);
  display: inline-flex;
  font-size: 18px;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.attention-list {
  display: grid;
  gap: 8px;
}

.attention-item {
  align-items: center;
  background: var(--surface-tint);
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 12px 13px;
  text-align: left;
  width: 100%;
}

.attention-item:hover {
  border-color: var(--gold);
  transform: none;
}

.attention-item-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.attention-item-copy strong {
  font-size: 13px;
}

.attention-item-copy span {
  color: var(--muted);
  font-size: 11px;
}

.attention-count {
  color: var(--gold-strong);
  font-size: 20px;
  font-weight: 900;
}

.quick-actions {
  display: grid;
  gap: 8px;
}

.quick-actions button {
  justify-content: flex-start;
  width: 100%;
}

.quick-actions button span {
  color: var(--gold-strong);
  font-size: 18px;
}

.skeleton-row {
  animation: cms-pulse 1.5s ease-in-out infinite;
  background: linear-gradient(90deg, var(--surface-muted), var(--surface-tint), var(--surface-muted));
  background-size: 200% 100%;
  border-radius: 10px;
  height: 48px;
}

@keyframes cms-pulse {
  0% { background-position: 0% 50%; opacity: 0.65; }
  50% { background-position: 100% 50%; opacity: 1; }
  100% { background-position: 0% 50%; opacity: 0.65; }
}

.section-toolbar {
  align-items: flex-end;
  margin-bottom: 14px;
}

.section-toolbar h3 {
  font-size: 23px;
  letter-spacing: -0.04em;
}

.section-toolbar > div:first-child {
  min-width: 0;
}

.filter-bar {
  align-items: center;
  background: var(--surface-tint);
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  padding: 8px;
}

.filter-bar label {
  display: block;
  min-width: 140px;
}

.filter-bar select,
.filter-bar input {
  background: var(--surface);
  margin: 0;
  min-height: 40px;
  padding: 8px 10px;
}

.search-field {
  align-items: center;
  display: flex !important;
  flex: 1 1 260px;
  gap: 7px;
  min-width: min(320px, 100%) !important;
  position: relative;
}

.search-field > span:not(.sr-only) {
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  pointer-events: none;
  position: absolute;
  left: 11px;
}

.search-field input {
  padding-left: 32px;
  width: 100%;
}

.filter-reset {
  min-height: 40px;
}

.bulk-toolbar {
  align-items: center;
  background: var(--gold-soft);
  border: 1px solid color-mix(in srgb, var(--gold) 32%, var(--line));
  border-radius: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  margin: -4px 0 12px;
  padding: 9px 11px;
}

.bulk-toolbar[hidden] {
  display: none;
}

.bulk-toolbar p {
  color: var(--gold-strong);
  font-size: 12px;
  font-weight: 800;
  margin: 0;
}

.bulk-toolbar .toolbar-actions {
  gap: 6px;
}

.record-list {
  overflow-x: auto;
  overflow-y: visible;
}

.table-text,
.title-cell span {
  color: var(--muted);
}

.title-cell strong {
  letter-spacing: -0.01em;
}

.status-badge {
  border: 1px solid transparent;
  padding: 7px 9px;
}

.status-published,
.status-active,
.status-resolved,
.status-closed {
  background: var(--green-soft);
  color: var(--green);
}

.status-draft,
.status-submitted,
.status-under_review,
.status-assigned,
.status-in_progress {
  background: var(--gold-soft);
  color: var(--gold-strong);
}

.status-archived,
.status-rejected,
.status-inactive {
  background: var(--red-soft);
  color: var(--red);
}

.table-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.table-actions button {
  min-height: 36px;
  padding: 7px 10px;
}

.row-select {
  accent-color: var(--gold);
  height: 18px;
  margin: 0;
  width: 18px;
}

.selection-cell {
  align-items: center;
  display: flex;
  gap: 9px;
}

.empty-state {
  box-shadow: none;
  padding: 44px 24px;
  text-align: center;
}

.empty-state::before {
  color: var(--gold-strong);
  content: "⌁";
  display: block;
  font-size: 34px;
  margin-bottom: 8px;
}

.pagination {
  border-top: 1px solid var(--line-soft);
  padding-top: 14px;
}

.drawer {
  background: var(--surface-raised);
  box-shadow: var(--shadow-md);
  padding: 26px;
}

.wide-editor-drawer {
  max-width: 760px;
  width: 760px;
}

.wide-editor-drawer .drawer-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wide-editor-drawer .drawer-form > .editor-span-full,
.wide-editor-drawer .drawer-form > .drawer-actions {
  grid-column: 1 / -1;
}

.wide-editor-drawer .drawer-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin-top: 8px;
  padding: 16px 0 2px;
  background: linear-gradient(to bottom, transparent, var(--surface-raised) 18%);
}

.drawer-header {
  margin-bottom: 22px;
  padding-bottom: 18px;
}

.drawer-header h2 {
  font-size: 25px;
  letter-spacing: -0.04em;
}

.drawer-form {
  gap: 15px;
}

.drawer-actions {
  background: var(--surface-raised);
  border-top-color: var(--line-soft);
  bottom: 0;
  margin-top: 8px;
  padding-top: 16px;
  position: sticky;
  z-index: 2;
}

.icon-button {
  background: var(--surface-muted);
  border: 1px solid var(--line-soft);
  color: var(--text);
}

.text-link {
  background: transparent;
  border: 0;
  color: var(--text);
  justify-content: flex-start;
  min-height: 0;
  padding: 0;
  text-align: left;
}

.text-link:hover:not(:disabled) {
  color: var(--gold-strong);
  transform: none;
}

.mobile-nav-button {
  display: none;
}

.report-detail-view {
  background: var(--bg);
  min-height: 100vh;
  padding: 32px clamp(18px, 3.5vw, 52px) 48px;
}

.report-detail-view[hidden] {
  display: none;
}

.report-detail-header {
  align-items: flex-end;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 22px;
}

.report-detail-header h1 {
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: -0.05em;
  margin: 0;
}

.report-detail-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
}

.detail-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  padding: 22px;
}

.detail-card h2,
.detail-card h3 {
  letter-spacing: -0.03em;
  margin: 0 0 12px;
}

.detail-card h2 { font-size: 19px; }
.detail-card h3 { font-size: 15px; }

.detail-meta {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.detail-meta div {
  background: var(--surface-tint);
  border-radius: 10px;
  padding: 10px;
}

.detail-meta dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.detail-meta dd {
  margin: 3px 0 0;
}

.detail-attachments {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-top: 16px;
}

.detail-attachments img {
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 11px;
  object-fit: cover;
  width: 100%;
}

.timeline {
  border-left: 2px solid var(--line);
  display: grid;
  gap: 14px;
  margin: 16px 0 0 6px;
  padding-left: 18px;
}

.timeline-item {
  position: relative;
}

.timeline-item::before {
  background: var(--gold);
  border: 3px solid var(--surface);
  border-radius: 999px;
  content: "";
  height: 9px;
  left: -25px;
  position: absolute;
  top: 3px;
  width: 9px;
}

.timeline-item strong,
.timeline-item span {
  display: block;
}

.timeline-item span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.confirmation-dialog {
  background: transparent;
  border: 0;
  margin: auto;
  max-width: min(420px, calc(100vw - 32px));
  padding: 0;
  width: 100%;
}

.confirmation-dialog::backdrop {
  background: rgba(17, 24, 39, 0.58);
}

.confirmation-card {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-md);
  display: grid;
  gap: 10px;
  padding: 24px;
}

.confirmation-icon {
  align-items: center;
  background: var(--red-soft);
  border-radius: 10px;
  color: var(--red);
  display: inline-flex;
  font-weight: 900;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.confirmation-card h2 {
  font-size: 21px;
  letter-spacing: -0.04em;
  margin: 0;
}

.dialog-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}

@media (max-width: 980px) {
  .sidebar {
    width: 100%;
  }

  .topbar::before {
    inset-inline: -18px;
  }

  .dashboard-grid-main,
  .report-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
    height: auto;
    max-height: 100vh;
    overflow: auto;
    padding-top: 74px;
    position: fixed;
    transform: translateX(-105%);
    transition: transform 180ms ease;
    width: min(300px, 88vw);
    z-index: 16;
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }

  body.nav-open::after {
    background: rgba(17, 24, 39, 0.5);
    content: "";
    inset: 0;
    position: fixed;
    z-index: 15;
  }

  .mobile-nav-button {
    display: inline-flex;
    left: 16px;
    position: fixed;
    top: 14px;
    z-index: 17;
  }

  .workspace {
    padding: 78px 16px 32px;
  }

  .topbar {
    padding-left: 52px;
    position: relative;
  }

  .topbar::before {
    inset: -78px -16px -1px;
  }

  .section-intro,
  .report-detail-header {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 759px) {
  .wide-editor-drawer {
    max-width: 100vw;
    width: 100vw;
  }

  .wide-editor-drawer .drawer-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .login-screen {
    padding: 14px;
  }

  .login-card {
    gap: 22px;
    padding: 22px;
  }

  .login-intro h1 {
    font-size: 46px;
  }

  .filter-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-bar label,
  .filter-bar button {
    width: 100%;
  }

  .filter-bar .search-field {
    flex-basis: auto;
    min-width: 0 !important;
  }

  .detail-meta {
    grid-template-columns: 1fr;
  }

  .dialog-actions {
    flex-direction: column-reverse;
  }

  .dialog-actions button {
    width: 100%;
  }

}

.check-label input[type="checkbox"] {
  accent-color: var(--gold);
  flex: 0 0 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  width: 18px;
}

.place-details-fieldset {
  border: 0;
  margin: 0;
  min-width: 0;
  padding: 0;
}

.place-details-fieldset legend {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 6px;
  padding: 0;
}

.place-detail-fields {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
