:root {
  --bg: #090a0c;
  --panel: #15181d;
  --panel-2: #1c2027;
  --line: rgba(255, 255, 255, 0.12);
  --text: #f5f1e7;
  --muted: #b8b0a3;
  --gold: #d2a43c;
  --gold-2: #f0d36f;
  --steel: #93a5aa;
  --green: #78c6a3;
  --red: #e08484;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
  color: var(--text);
  background:
    linear-gradient(120deg, rgba(210, 164, 60, 0.08), transparent 30%),
    linear-gradient(280deg, rgba(147, 165, 170, 0.10), transparent 38%),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px;
  border-right: 1px solid var(--line);
  background: rgba(9, 10, 12, 0.88);
}

.brand {
  display: grid;
  gap: 14px;
  margin-bottom: 30px;
}

.brand img {
  width: 190px;
  max-width: 100%;
}

.brand span {
  color: var(--gold-2);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.74rem;
}

nav {
  display: grid;
  gap: 8px;
}

.nav-item,
.primary,
.secondary {
  min-height: 42px;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  text-align: left;
  padding: 0 14px;
  cursor: pointer;
}

.nav-item.active,
.primary {
  color: #15110a;
  border-color: transparent;
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  font-weight: 900;
}

.secondary {
  text-align: center;
  color: var(--gold-2);
}

.app {
  padding: 28px clamp(24px, 4vw, 58px) 58px;
}

.topbar,
.screen-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 22px;
}

.topbar {
  justify-content: flex-start;
}

.screen-head {
  position: relative;
  padding-top: 22px;
}

.screen-head::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgba(240, 211, 111, 0.95), rgba(210, 164, 60, 0.28) 34%, rgba(210, 164, 60, 0));
}

.screen-head .eyebrow {
  display: none;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold-2);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.74rem;
  font-weight: 900;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(1.6rem, 3vw, 2.5rem);
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.7rem, 3vw, 2.8rem);
}

h3 {
  margin-bottom: 14px;
}

.user-chip,
.panel,
.notice {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.055);
}

.user-chip {
  min-width: 190px;
  padding: 12px 14px;
}

.user-chip span,
.muted {
  color: var(--muted);
}

.user-chip strong {
  display: block;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.status-card {
  min-height: 110px;
  padding: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
}

.status-card strong {
  display: block;
  margin-top: 12px;
  font-size: 1.35rem;
}

.status-card.active {
  border-color: rgba(240, 211, 111, 0.58);
  background: rgba(210, 164, 60, 0.12);
}

.panel {
  padding: 22px;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.dashboard-section {
  display: grid;
  gap: 16px;
}

.dashboard-section.span-full {
  grid-column: auto;
}

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

.section-title-row h3,
.section-title-row p {
  margin-bottom: 0;
}

.count-chip,
.method-chip {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border: 1px solid rgba(240, 211, 111, 0.38);
  color: var(--gold-2);
  background: rgba(210, 164, 60, 0.09);
  padding: 0 10px;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.work-queue,
.quick-grid,
.template-grid {
  display: grid;
  gap: 12px;
}

.quick-grid,
.template-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.queue-item,
.quick-card,
.template-card,
.report-row {
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(0, 0, 0, 0.16);
}

.queue-item,
.quick-card,
.report-row {
  width: 100%;
  cursor: pointer;
  text-align: left;
}

.queue-item {
  display: grid;
  grid-template-columns: auto minmax(220px, 1.1fr) minmax(260px, 1fr) minmax(170px, auto);
  gap: 12px;
  align-items: center;
  min-height: 68px;
  padding: 12px;
}

.queue-item strong,
.queue-item span,
.queue-item em {
  min-width: 0;
}

.queue-item em {
  color: var(--green);
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.quick-card {
  min-height: 110px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  padding: 16px;
}

.quick-card span,
.template-card p {
  color: var(--gold-2);
  font-weight: 900;
}

.quick-card strong {
  font-size: 0.95rem;
  line-height: 1.35;
}

.report-table {
  display: grid;
  gap: 8px;
}

.report-row {
  display: grid;
  grid-template-columns: minmax(170px, 0.95fr) minmax(170px, 0.95fr) minmax(120px, 0.55fr) minmax(180px, 1.05fr);
  gap: 12px;
  align-items: center;
  min-height: 56px;
  padding: 10px 12px;
}

.report-row-head {
  min-height: auto;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: default;
}

.report-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.report-row mark {
  color: #15110a;
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  padding: 4px 8px;
  font-weight: 900;
}

.template-card {
  display: grid;
  gap: 14px;
  align-content: start;
  min-height: 190px;
  padding: 18px;
}

.template-card.active {
  border-color: rgba(240, 211, 111, 0.48);
  background: rgba(210, 164, 60, 0.1);
}

.template-card h3 {
  margin-bottom: 0;
}

.empty-state {
  max-width: 760px;
}

.empty-state p {
  margin-bottom: 0;
}

.account-grid {
  max-width: 720px;
}

.two-col,
.review-grid,
.output-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
}

.form-grid,
.report-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.form-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.report-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.report-section {
  display: grid;
  gap: 16px;
}

.report-section.span-full {
  grid-column: 1 / -1;
}

.report-section.results-section {
  grid-column: 1 / -1;
  max-width: 760px;
}

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

.report-section:nth-of-type(3) .section-columns {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field-block {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.14);
  padding: 14px;
}

.field-block h4,
.technician-strip h4 {
  margin: 0 0 12px;
  color: var(--gold-2);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.field-pairs {
  display: grid;
  gap: 12px;
}

.technician-strip {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.tech-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(90px, 0.55fr) minmax(140px, 0.8fr);
  gap: 12px;
}

.field-hint {
  justify-self: start;
  margin-top: -2px;
  color: var(--gold-2);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(0, 0, 0, 0.28);
  padding: 9px 10px;
}

input[data-auto="true"],
select[data-auto="true"] {
  border-color: rgba(240, 211, 111, 0.24);
  background: rgba(210, 164, 60, 0.06);
}

textarea {
  resize: vertical;
  line-height: 1.5;
}

.summary-list {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 8px 14px;
  margin: 0;
}

.summary-list dt {
  color: var(--muted);
}

.summary-list dd {
  margin: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.output-panel .summary-list {
  grid-template-columns: 130px minmax(0, 1fr);
}

.photo-workspace {
  display: grid;
  gap: 18px;
}

.photo-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.file-action {
  display: inline-flex;
  min-height: 42px;
  width: auto;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  color: #15110a;
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  padding: 0 16px;
  cursor: pointer;
  font-weight: 900;
}

.file-action.secondary-action {
  border-color: var(--line);
  color: var(--gold-2);
  background: rgba(255, 255, 255, 0.04);
}

.photo-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(280px, 1.1fr);
  gap: 18px;
  align-items: start;
}

.photo-preview {
  min-height: 330px;
  display: grid;
  gap: 16px;
}

.empty-photo {
  min-height: 260px;
  display: grid;
  place-items: center;
  max-width: 290px;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.18);
  padding: 20px;
}

.photo-card {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 260px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.18);
  padding: 8px;
}

.delete-photo {
  justify-self: end;
  min-height: 34px;
  border: 1px solid rgba(224, 132, 132, 0.5);
  color: #ffd1d1;
  background: rgba(224, 132, 132, 0.08);
  padding: 0 12px;
  cursor: pointer;
  font-weight: 800;
}

.delete-photo:hover {
  border-color: rgba(224, 132, 132, 0.9);
  background: rgba(224, 132, 132, 0.15);
}

.evidence-photo {
  display: block;
  max-width: 100%;
  max-height: 520px;
  border: 8px solid #fff;
  background: #fff;
}

.photo-form {
  display: grid;
  gap: 14px;
}

.photo-id-row {
  min-height: 86px;
  align-content: start;
}

.system-field {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.18);
  padding: 12px;
}

.system-field span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.system-field strong {
  overflow-wrap: anywhere;
}

.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.review-text {
  color: var(--muted);
  line-height: 1.65;
}

.notice {
  display: none;
  margin-top: 14px;
  padding: 16px;
  color: var(--green);
  font-weight: 800;
}

.notice.active {
  display: block;
}

.notice a {
  color: var(--gold-2);
  font-weight: 900;
}

@media (max-width: 1100px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

  nav,
  .status-grid,
  .dashboard-layout,
  .quick-grid,
  .template-grid,
  .queue-item,
  .report-row,
  .form-grid,
  .report-form,
  .section-columns,
  .report-section:nth-of-type(3) .section-columns,
  .tech-grid,
  .two-col,
  .photo-layout,
  .review-grid,
  .output-panel {
    grid-template-columns: 1fr;
  }

  .topbar,
  .screen-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .screen-head {
    padding-top: 18px;
  }
}
