@font-face {
  font-family: Geist;
  src: url("/geist-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("/geist-mono-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ink: #10251f;
  --muted: #65726d;
  --paper: #f2f0e8;
  --app-paper: #edf0eb;
  --surface: #fffdf7;
  --line: #d9ded8;
  --forest: #173f35;
  --mint: #c8f36b;
  --amber: #f1b757;
}

html,
body,
button,
input,
select,
textarea {
  font-family: Geist, sans-serif, Arial, sans-serif;
}

body {
  color: var(--ink);
  background: var(--paper);
  font-size: 16px;
  line-height: 1.5;
}

.brand {
  gap: 11px;
}

.brand img,
.public-nav .brand img,
.login-card .brand img {
  width: 48px;
  height: 54px;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand strong {
  font-size: 13px;
}

.brand small {
  color: var(--muted);
  font-size: 11px;
}

.public-nav {
  height: 112px;
}

.button {
  cursor: pointer;
  border: 0;
  border-radius: 11px;
  justify-content: center;
  align-items: center;
  padding: 11px 16px;
  font-weight: 750;
  line-height: 1.5;
  text-decoration: none;
  display: inline-flex;
}

.button.dark {
  color: #fff;
  background: var(--forest);
}

.button.lime {
  color: #294510;
  background: var(--mint);
}

.button.outline {
  border: 1px solid var(--line);
  background: #fff;
}

.button.danger {
  color: #942c22;
  background: #fff0ee;
  border: 1px solid #e8b5af;
}

.eyebrow {
  color: #2a6353;
  text-transform: uppercase;
  letter-spacing: .14em;
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 800;
}

.app-page {
  min-height: 100vh;
  background: var(--app-paper);
}

.sidebar {
  width: 244px;
  background: var(--forest);
  padding: 23px 16px;
}

.brand.inverse {
  gap: 11px;
  padding: 0 7px 23px;
  border-bottom: 1px solid rgba(255,255,255,.125);
}

.brand.inverse img {
  width: 45px;
  height: 52px;
}

.brand.inverse strong {
  color: #fff;
}

.brand.inverse small {
  color: #b8cdc5;
}

.sidebar nav {
  gap: 5px;
  margin-top: 23px;
}

.nav-button {
  color: #c9d7d2;
  border-radius: 9px;
  padding: 12px 13px;
  font-weight: 700;
  line-height: 24px;
}

.nav-button.active,
.nav-button:hover {
  color: #fff;
  background: rgba(255,255,255,.08);
}

.user-box {
  border-top: 1px solid rgba(255,255,255,.125);
  gap: 7px;
  padding: 15px 10px;
}

.user-box small {
  font-size: 11px;
}

.user-box span {
  color: #c9d7d2;
  font-size: 12px;
}

.app-main {
  max-width: none;
  min-width: 0;
  margin-left: 244px;
  padding: 31px clamp(18px,3vw,45px) 80px;
}

.app-heading {
  min-height: 111px;
  margin-bottom: 22px;
}

.app-heading h1 {
  color: var(--ink);
  letter-spacing: -.04em;
  margin: 0 0 6px;
  font-size: clamp(28px,3vw,38px);
  font-weight: 400;
  line-height: 1.5;
}

.app-heading > p:last-child {
  color: var(--muted);
  margin: 0;
  font-size: 13px;
}

.add-button {
  top: 65px;
  right: clamp(18px,3vw,45px);
  height: 42px;
}

.metric-grid {
  gap: 13px;
}

.metric-grid.four {
  grid-template-columns: repeat(4,1fr);
  margin-bottom: 19px;
}

.metric {
  min-height: 102px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 15px;
  gap: 10px;
  padding: 18px;
  display: grid;
}

.metric span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.metric strong {
  color: var(--ink);
  letter-spacing: -.04em;
  margin: 0;
  font-size: 28px;
  line-height: 1.5;
}

.filters {
  grid-template-columns: 2fr repeat(5,1fr);
  gap: 8px;
  margin: 0 0 13px;
}

.filters > input,
.filters > select,
.filters > label {
  min-width: 0;
  min-height: 38px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  font-size: 11px;
  line-height: 16.5px;
}

.filters .compact {
  color: var(--muted);
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  font-size: 11px;
}

.filters .compact input,
.filters .compact select {
  min-width: 0;
  height: auto;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 11px;
}

.filters .check-control {
  color: var(--ink);
  justify-content: center;
  gap: 7px;
  padding: 4px 8px;
  font-weight: 750;
}

.filters .check-control input {
  width: 17px;
  height: 17px;
  accent-color: var(--forest);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 17px;
}

.table-panel {
  margin-top: 0;
  padding: 0;
  overflow: hidden;
}

.panel-head {
  min-height: 88px;
  border-bottom: 1px solid var(--line);
  gap: 12px;
  padding: 17px 19px;
}

.table-panel .panel-head {
  padding: 17px 19px;
}

.panel-head h2,
.admin-card h2 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 400;
}

.panel-head p,
.panel-head small {
  color: var(--muted);
  margin: 0;
  font-size: 13px;
}

.table-scroll {
  max-height: none;
  overflow: auto;
}

.exhibit-table {
  width: 100%;
  min-width: 1240px;
  table-layout: fixed;
  color: var(--ink);
  font-size: 12px;
  line-height: 18px;
}

.exhibit-table th {
  height: 34px;
  color: var(--muted);
  background: #f4f5f1;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
  padding: 10px 13px;
  font-size: 9px;
  font-weight: 700;
  line-height: 13.5px;
  position: static;
}

.exhibit-table td {
  height: 64px;
  border-top: 1px solid #e5e8e3;
  border-bottom: 0;
  padding: 12px 13px;
  font-size: 12px;
  line-height: 18px;
}

.exhibit-table th:first-child,
.exhibit-table td:first-child {
  width: 39px;
}

.exhibit-table th:first-child {
  padding: 10px 13px;
}

.exhibit-table td:first-child {
  padding: 12px 13px;
}

.exhibit-table tbody tr:hover {
  background: #f7f8f4;
}

.exhibit-cell {
  width: 100%;
  max-width: 250px;
  gap: 0;
}

.exhibit-cell span,
.exhibit-table td small {
  color: var(--muted);
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 250px;
  margin-top: 4px;
  display: block;
  overflow: hidden;
}

.exhibit-table [data-column="exhibit"] {
  padding-left: 10px;
  padding-right: 10px;
}

.exhibit-table [data-column="exhibit"] .exhibit-cell span {
  max-width: 100%;
  margin-top: 2px;
  font-size: 10px;
  line-height: 13px;
}

.exhibit-table [data-column="investigator"] {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.3;
}

.exhibit-table td[data-column="date_received"],
.exhibit-table td[data-column="investigator"],
.exhibit-table td[data-column="department"],
.exhibit-table td[data-column="suspect"],
.exhibit-table td[data-column="offence"] {
  font-size: 11px;
  line-height: 15px;
}

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

.directory-table th:first-child,
.directory-table td:first-child {
  width: auto;
  text-align: left;
}

.directory-table th:first-child {
  padding: 10px 13px;
}

.directory-table td:first-child,
.directory-table td {
  height: auto;
  min-height: 64px;
  padding: 12px 13px;
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: middle;
}

.directory-table th:nth-child(4),
.directory-table td:nth-child(4) {
  text-align: center;
}

.directory-table td:nth-child(3) a {
  color: var(--forest);
  overflow-wrap: anywhere;
}

.directory-table td:last-child {
  overflow: visible;
}

.directory-table .button-row,
#directory-view .panel-head .button-row {
  gap: 6px;
  margin: 0;
}

.directory-table .button-row {
  justify-content: flex-start;
}

.directory-table .button {
  min-height: 32px;
  padding: 8px 10px;
  font-size: 10px;
  line-height: 15px;
}

#directory-search {
  width: min(330px,31vw);
  height: 39px;
  padding: 0 10px;
  font-size: 12px;
}

.status {
  color: #53605b;
  white-space: nowrap;
  background: #e9ece8;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  display: inline-flex;
}

.status.pending {
  color: #79500d;
  background: #f7e4b9;
}

.status.analyzed {
  color: #2f6b27;
  background: #dcefcf;
}

.status.returned {
  color: #256577;
  background: #dbe9ed;
}

.bulk-bar {
  background: #e8f2ed;
  border: 1px solid var(--line);
  border-radius: 0;
  gap: 8px;
  margin: 0;
  padding: 10px 18px;
}

.drawer {
  width: min(510px,100%);
  background: var(--surface);
  padding: 25px;
}

.drawer-head {
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
  margin-bottom: 20px;
}

.drawer-head h2 {
  margin: 0;
  font-size: 27px;
}

.close {
  width: 34px;
  height: 34px;
  background: #ecefea;
  border-radius: 50%;
  font-size: 21px;
}

.temporary-password-row input {
  font-family: "Geist Mono", Consolas, monospace;
}

@media (max-width: 1000px) {
  .metric-grid.five {
    grid-template-columns: repeat(3,1fr);
  }

  .filters {
    grid-template-columns: repeat(4,1fr);
  }
}

@media (max-width: 760px) {
  .brand img,
  .public-nav .brand img,
  .login-card .brand img {
    width: 38px;
    height: 45px;
  }

  .sidebar {
    width: 244px;
  }

  .app-main {
    margin-left: 0;
    padding: 25px 14px 60px;
  }

  .app-heading {
    min-height: auto;
    margin-bottom: 15px;
  }

  .app-heading h1 {
    font-size: 36px;
  }

  .add-button {
    position: static;
    height: auto;
    margin-bottom: 14px;
  }

  .metric-grid.four,
  .metric-grid.five {
    grid-template-columns: repeat(2,1fr);
  }

  .metric-grid.four {
    gap: 7px;
  }

  .metric {
    min-height: 90px;
    padding: 13px;
  }

  .filters {
    grid-template-columns: 1fr 1fr;
  }

  .filters > input:first-child {
    grid-column: 1 / -1;
  }

  .panel-head {
    align-items: flex-start;
  }

  .drawer {
    width: 100%;
    padding: 18px;
  }

  .directory-table {
    min-width: 860px;
  }

  #directory-search {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .metric {
    min-height: 78px;
  }

  .filters {
    grid-template-columns: 1fr;
  }

  .filters > input:first-child {
    grid-column: auto;
  }
}

@media (max-width: 760px) {
  .sidebar {
    width: min(300px,86vw);
    padding: 18px 14px;
    overflow-y: auto;
  }

  .sidebar nav {
    margin-top: 16px;
  }

  .nav-button {
    min-height: 48px;
  }

  .mobile-menu {
    position: fixed;
    z-index: 35;
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
    padding: 0;
  }

  .app-main {
    margin-left: 0;
    padding: 72px 12px 48px;
  }

  .app-heading h1 {
    font-size: 32px;
  }

  .metric span {
    font-size: 10px;
  }

  .metric strong {
    font-size: 24px;
  }

  .filters > input,
  .filters > select,
  .filters > label,
  input,
  select,
  textarea,
  .button {
    min-height: 44px;
  }

  .panel {
    border-radius: 14px;
  }

  .panel-head,
  .table-panel .panel-head {
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
    padding: 15px;
  }

  .panel-head > .button,
  .panel-head > div:last-child,
  #directory-view .panel-head .button-row {
    width: 100%;
  }

  #directory-view .panel-head .button-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .table-scroll {
    max-height: none;
    overflow: visible;
  }

  .exhibit-table,
  .directory-table {
    display: block;
    width: 100%;
    min-width: 0;
    table-layout: auto;
  }

  .exhibit-table colgroup,
  .exhibit-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
  }

  .exhibit-table tbody {
    display: grid;
    gap: 12px;
    padding: 12px;
  }

  .exhibit-table tbody tr {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0,1fr) minmax(0,1fr);
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
  }

  .exhibit-table tbody tr.loading {
    display: block;
  }

  .exhibit-table tbody td,
  .directory-table tbody td {
    display: block;
    width: auto !important;
    height: auto;
    min-width: 0;
    min-height: 0;
    padding: 10px 12px;
    overflow: visible;
    white-space: normal;
    overflow-wrap: anywhere;
    text-overflow: clip;
    border: 0;
  }

  .exhibit-table tbody td::before,
  .directory-table tbody td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    font-size: 8px;
    font-weight: 800;
    line-height: 12px;
  }

  .exhibit-table:not(.directory-table) tbody td:first-child {
    position: absolute;
    z-index: 2;
    top: 12px;
    right: 12px;
    width: 24px !important;
    padding: 0;
    text-align: right;
  }

  .exhibit-table:not(.directory-table) tbody td:first-child::before {
    display: none;
  }

  .exhibit-table tbody td[data-column="exhibit"] {
    grid-column: 1 / -1;
    padding: 12px 50px 12px 12px;
    background: #f4f5f1;
  }

  .exhibit-table tbody td[data-column="exhibit"]::before {
    display: none;
  }

  .exhibit-table tbody td[data-column="exhibit"] .exhibit-cell span {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .exhibit-table tbody td[data-column="offence"],
  .exhibit-table tbody td[data-column="report_number"],
  .exhibit-table tbody td[data-column="court_dates"] {
    grid-column: 1 / -1;
  }

  .directory-table tbody td:first-child,
  .directory-table tbody td:nth-child(3),
  .directory-table tbody td:last-child {
    grid-column: 1 / -1;
  }

  .directory-table tbody td:first-child {
    padding: 12px;
    background: #f4f5f1;
  }

  .directory-table tbody td:first-child::before { content: "Investigator"; }
  .directory-table tbody td:nth-child(2)::before { content: "Department"; }
  .directory-table tbody td:nth-child(3)::before { content: "Email"; }
  .directory-table tbody td:nth-child(4)::before { content: "Exhibits"; }
  .directory-table tbody td:nth-child(5)::before { content: "Actions"; }

  .directory-table tbody td:nth-child(4) {
    text-align: left;
  }

  .directory-table tbody td:last-child {
    border-top: 1px solid var(--line);
  }

  .directory-table .button-row {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
  }

  .directory-table .button {
    min-height: 40px;
    white-space: normal;
  }

  .bulk-bar,
  .pending-approval-bar,
  .submission-admin-row,
  .submission-status-card {
    align-items: stretch;
    flex-direction: column;
  }

  .bulk-bar .button,
  .pending-approval-bar .button,
  .submission-actions .button {
    width: 100%;
  }

  .button-row {
    gap: 8px;
    margin-top: 18px;
  }

  .form-grid,
  .content-editor-grid,
  .settings-fields,
  .staff-form,
  .staff-row,
  .admin-grid,
  .result-grid,
  .result-actions {
    grid-template-columns: 1fr;
  }

  .form-grid label.full,
  .content-editor-grid .full,
  .wide-definition {
    grid-column: auto;
  }

  .drawer {
    width: 100%;
    padding: 18px 14px 32px;
  }

  .directory-table {
    min-width: 0;
  }

  #directory-search {
    width: 100%;
  }

  .submission-section,
  .submission-status-section {
    padding: 45px 0;
  }

  .submission-card,
  .lookup-card,
  .public-result,
  .login-card {
    border-radius: 16px;
    padding: 18px;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 44px;
    letter-spacing: -1.8px;
  }

  .lead {
    font-size: 16px;
  }

  .exhibit-table tbody {
    padding: 9px;
  }

  .directory-table .button-row {
    grid-template-columns: 1fr;
  }
}

@media print {
  body,
  .app-page {
    background: #fff;
  }

  .table-scroll {
    max-height: none;
    overflow: visible;
  }
}

/* V1.4.1 register controls and compact mobile tables */
.add-button {
  position: static;
  display: flex;
  width: max-content;
  margin: 2px 0 14px auto;
}

.register-filters {
  grid-template-columns: minmax(145px,1.05fr) minmax(220px,2fr) repeat(4,minmax(120px,1fr)) auto;
  align-items: stretch;
}

.register-filters .search-filter {
  display: grid;
  grid-template-columns: auto minmax(0,1fr);
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.register-filters .search-filter select {
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 11px;
}

@media (max-width: 1100px) {
  .register-filters {
    grid-template-columns: repeat(3,minmax(0,1fr));
  }

  .register-filters #filter-value {
    grid-column: span 2;
  }
}

@media (max-width: 760px) {
  .add-button {
    width: 100%;
    margin: 0 0 10px;
  }

  .register-filters {
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }

  .register-filters .search-filter,
  .register-filters #filter-value {
    grid-column: 1 / -1;
  }

  .register-filters .search-filter {
    min-height: 42px;
  }

  .exhibit-table tbody {
    gap: 8px;
    padding: 8px;
  }

  .exhibit-table tbody tr {
    border-radius: 10px;
  }

  .exhibit-table tbody td,
  .directory-table tbody td {
    padding: 7px 9px;
    font-size: 10.5px;
    line-height: 1.25;
  }

  .exhibit-table tbody td::before,
  .directory-table tbody td::before {
    margin-bottom: 2px;
    font-size: 7px;
    line-height: 10px;
  }

  .exhibit-table:not(.directory-table) tbody td:first-child {
    top: 9px;
    right: 9px;
  }

  .exhibit-table tbody td[data-column="exhibit"],
  .directory-table tbody td:first-child {
    padding: 9px 42px 9px 9px;
  }

  .directory-table tbody td:first-child {
    padding-right: 9px;
  }

  .directory-table tbody td:last-child {
    padding-top: 8px;
  }

  .directory-table .button-row {
    gap: 5px;
  }

  .directory-table .button {
    min-height: 34px;
    padding: 6px 8px;
    font-size: 9px;
  }
}

@media (max-width: 480px) {
  .register-filters {
    grid-template-columns: 1fr;
  }

  .register-filters > * {
    grid-column: auto !important;
  }

  .app-main {
    padding-left: 8px;
    padding-right: 8px;
  }

  .exhibit-table tbody {
    padding: 6px;
  }

  .directory-table .button-row {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
}
