:root {
  --ink: #17201d;
  --muted: #6f7773;
  --line: #ddd9d0;
  --surface: #f6f5f1;
  --paper: #fff;
  --deep: #101916;
  --deep-soft: #17231f;
  --gold: #b68c3e;
  --red: #8f2930;
  --green: #2e6a4f;
  --shadow: 0 20px 60px rgba(13, 23, 19, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background: var(--surface);
  color: var(--ink);
  font-family: "Inter", sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.eyebrow {
  margin: 0;
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 1.08fr) minmax(420px, 0.92fr);
}

.login-brand {
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 38px 54px 42px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(9, 17, 14, 0.75), rgba(9, 17, 14, 0.94)),
    url("assets/roman-dawn-fields.webp") center / cover;
  color: white;
}

.login-brand::after {
  position: absolute;
  inset: 0;
  border-top: 3px solid var(--gold);
  content: "";
  pointer-events: none;
}

.brand-lockup,
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-lockup img,
.sidebar-brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.brand-lockup span,
.sidebar-brand span {
  display: grid;
  gap: 2px;
}

.brand-lockup strong,
.sidebar-brand strong {
  font-family: "Cormorant Garamond", serif;
  font-size: 20px;
}

.brand-lockup small,
.sidebar-brand small {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  opacity: 0.62;
}

.login-statement {
  max-width: 650px;
  padding: 60px 0;
}

.login-statement h1 {
  max-width: 580px;
  margin: 16px 0 20px;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(52px, 6vw, 88px);
  font-weight: 600;
  line-height: 0.92;
}

.login-statement > p:last-child {
  max-width: 520px;
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  line-height: 1.75;
}

.preview-notice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 9px;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 160ms ease;
}

.preview-notice:hover {
  color: white;
}

.preview-notice svg {
  width: 14px;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 40px;
  background: #f7f6f2;
}

.login-panel form {
  width: min(420px, 100%);
  display: grid;
  gap: 18px;
}

.login-heading {
  margin-bottom: 14px;
}

.seal {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  margin-bottom: 30px;
  border: 1px solid var(--line);
  background: white;
}

.seal img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.login-heading h2 {
  margin: 8px 0 8px;
  font-family: "Cormorant Garamond", serif;
  font-size: 42px;
  font-weight: 600;
}

.login-heading > p:last-child {
  max-width: 360px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.login-panel label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.login-panel input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  outline: none;
  background: white;
  color: var(--ink);
}

.login-panel input:focus {
  border-color: var(--gold);
}

.login-panel button {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--deep);
  background: var(--deep);
  color: white;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.login-panel button svg {
  width: 15px;
}

.login-error {
  margin: -4px 0 0;
  color: var(--red);
  font-size: 10px;
}

.login-footnote {
  color: var(--muted);
  font-size: 8px;
  line-height: 1.5;
  text-align: center;
}

.staff-app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 226px minmax(0, 1fr);
}

.staff-sidebar {
  min-height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  padding: 22px 14px 16px;
  background: var(--deep);
  color: white;
}

.sidebar-brand {
  padding: 0 10px 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.staff-sidebar nav {
  display: grid;
  gap: 3px;
  padding: 24px 0;
}

.staff-sidebar nav button,
.sidebar-footer button {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 11px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.62);
  font-size: 10px;
  font-weight: 600;
  text-align: left;
}

.staff-sidebar nav button:hover,
.staff-sidebar nav button.active {
  background: rgba(255, 255, 255, 0.07);
  color: white;
}

.staff-sidebar nav button.active {
  box-shadow: inset 2px 0 var(--gold);
}

.staff-sidebar nav svg,
.sidebar-footer svg {
  width: 15px;
}

.sidebar-footer {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-footer span {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
}

.staff-workspace {
  min-width: 0;
  padding: 26px 30px 30px;
}

.workspace-header {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.workspace-header h1 {
  margin: 4px 0 0;
  font-family: "Cormorant Garamond", serif;
  font-size: 36px;
  font-weight: 600;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.search-control {
  width: min(360px, 34vw);
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: white;
}

.search-control svg {
  width: 15px;
  color: var(--muted);
}

.search-control input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  font-size: 10px;
}

.icon-button {
  width: 42px;
  min-height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}

.icon-button svg {
  width: 15px;
}

.workspace-controls {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.status-tabs {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 54px;
}

.status-tabs button {
  height: 54px;
  padding: 2px 0 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.status-tabs button.active {
  box-shadow: inset 0 -2px var(--red);
  color: var(--ink);
}

#workspaceStatus {
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
}

.inbox-layout {
  height: calc(100vh - 184px);
  min-height: 560px;
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
  border-bottom: 1px solid var(--line);
}

.submission-list {
  overflow-y: auto;
  border-right: 1px solid var(--line);
}

.submission-row {
  width: 100%;
  display: grid;
  gap: 9px;
  padding: 18px 18px 17px 2px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.submission-row:hover,
.submission-row.active {
  background: rgba(255, 255, 255, 0.68);
}

.submission-row.active {
  box-shadow: inset 2px 0 var(--red);
  padding-left: 14px;
}

.row-meta,
.detail-meta,
.detail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.route-label,
.status-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 7px;
  font-weight: 700;
  text-transform: uppercase;
}

.status-label::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a6aaa7;
  content: "";
}

.status-label.new::before {
  background: var(--red);
}

.status-label.review::before {
  background: var(--gold);
}

.status-label.resolved::before {
  background: var(--green);
}

.submission-row strong {
  overflow: hidden;
  font-family: "Cormorant Garamond", serif;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.submission-row p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.row-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 7px;
  font-weight: 600;
}

.submission-detail {
  min-width: 0;
  overflow-y: auto;
  background: white;
}

.empty-detail,
.empty-list {
  min-height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 9px;
  padding: 30px;
  color: var(--muted);
  text-align: center;
}

.empty-detail svg,
.empty-list svg {
  width: 24px;
  color: var(--gold);
}

.empty-detail h2,
.empty-list h2 {
  margin: 4px 0 0;
  color: var(--ink);
  font-family: "Cormorant Garamond", serif;
  font-size: 26px;
  font-weight: 600;
}

.empty-detail p,
.empty-list p {
  max-width: 320px;
  margin: 0;
  font-size: 9px;
  line-height: 1.6;
}

.detail-header {
  display: grid;
  gap: 16px;
  padding: 28px 32px 26px;
  border-bottom: 1px solid var(--line);
}

.detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
}

.detail-heading h2 {
  max-width: 720px;
  margin: 7px 0 0;
  font-family: "Cormorant Garamond", serif;
  font-size: 32px;
  font-weight: 600;
  line-height: 1;
}

.detail-reference {
  color: var(--red);
  font-size: 8px;
  font-weight: 700;
  white-space: nowrap;
}

.detail-meta {
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 8px;
  font-weight: 600;
}

.detail-meta span:not(:last-child)::after {
  margin-left: 8px;
  color: var(--line);
  content: "/";
}

.detail-actions {
  flex-wrap: wrap;
  padding-top: 2px;
}

.detail-actions button {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  background: white;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
}

.detail-actions button.active {
  border-color: var(--deep);
  background: var(--deep);
  color: white;
}

.detail-body {
  padding: 6px 32px 38px;
}

.detail-section {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 28px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.detail-section > h3 {
  margin: 0;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
}

.detail-section dl {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 26px;
  margin: 0;
}

.detail-section dl .wide {
  grid-column: 1 / -1;
}

.detail-section dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 7px;
  font-weight: 700;
  text-transform: uppercase;
}

.detail-section dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 10px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.detail-section a {
  color: var(--red);
}

.loading-list {
  display: grid;
  gap: 1px;
}

.loading-list span {
  height: 124px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
  background-size: 200% 100%;
  animation: loading 1.2s linear infinite;
}

@keyframes loading {
  to {
    background-position: -200% 0;
  }
}

@media (max-width: 980px) {
  .login-screen {
    grid-template-columns: 1fr;
  }

  .login-brand {
    min-height: 360px;
  }

  .staff-app {
    grid-template-columns: 70px minmax(0, 1fr);
  }

  .sidebar-brand span,
  .staff-sidebar nav span,
  .sidebar-footer span,
  .sidebar-footer button {
    display: none;
  }

  .sidebar-brand {
    justify-content: center;
    padding: 0 0 24px;
  }

  .staff-sidebar nav button {
    justify-content: center;
    padding: 0;
  }

  .inbox-layout {
    grid-template-columns: 320px minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .login-brand {
    min-height: 320px;
    padding: 26px 24px;
  }

  .login-statement {
    padding: 38px 0 24px;
  }

  .login-statement h1 {
    font-size: 48px;
  }

  .login-panel {
    padding: 36px 22px;
  }

  .staff-app {
    display: block;
  }

  .staff-sidebar {
    min-height: auto;
    position: sticky;
    z-index: 20;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
  }

  .sidebar-brand {
    padding: 0;
    border: 0;
  }

  .sidebar-brand img {
    width: 34px;
    height: 34px;
  }

  .staff-sidebar nav {
    display: flex;
    gap: 2px;
    padding: 0;
    overflow-x: auto;
  }

  .staff-sidebar nav button {
    width: 38px;
    min-width: 38px;
    min-height: 38px;
  }

  .sidebar-footer {
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
  }

  .sidebar-footer button {
    width: 38px;
    min-height: 38px;
    display: flex;
    justify-content: center;
    gap: 0;
    padding: 0;
    font-size: 0;
  }

  .staff-workspace {
    padding: 18px 16px;
  }

  .workspace-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions,
  .search-control {
    width: 100%;
  }

  .workspace-controls {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 12px;
  }

  .status-tabs {
    width: 100%;
    gap: 18px;
    overflow-x: auto;
  }

  #workspaceStatus {
    padding-bottom: 12px;
  }

  .inbox-layout {
    height: auto;
    min-height: 0;
    display: block;
  }

  .submission-list {
    max-height: 420px;
    border-right: 0;
  }

  .submission-detail {
    min-height: 480px;
  }

  .detail-header,
  .detail-body {
    padding-left: 18px;
    padding-right: 18px;
  }

  .detail-heading,
  .detail-section {
    display: grid;
    grid-template-columns: 1fr;
  }

  .detail-section {
    gap: 14px;
  }

  .detail-section dl {
    grid-template-columns: 1fr;
  }
}
