:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --panel: #ffffff;
  --ink: #17202a;
  --muted: #667085;
  --line: #d9dee7;
  --brand: #176b5b;
  --brand-dark: #0f4f43;
  --warn: #9a3412;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

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

button {
  border: 0;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  min-height: 40px;
  padding: 0 14px;
}

button:hover {
  background: var(--brand-dark);
}

.qa-shell {
  min-height: 100vh;
}

.topbar {
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 18px 24px;
}

.topbar h1 {
  font-size: 24px;
  line-height: 1.2;
  margin: 0;
}

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

.auth-actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.auth-email,
.submit-status {
  color: var(--muted);
  font-size: 13px;
}

.workspace {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(320px, 440px) minmax(0, 1fr);
  padding: 20px 24px 32px;
}

.login-page {
  display: grid;
  min-height: calc(100vh - 82px);
  padding: 48px 24px;
  place-items: center;
}

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

.login-panel h2 {
  font-size: 22px;
  line-height: 1.2;
  margin: 0;
}

.login-panel p {
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.login-panel button {
  justify-self: start;
}

.issue-form,
.issue-board {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.issue-form {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.quick-intake {
  display: grid;
  gap: 14px;
}

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

label {
  color: #344054;
  display: grid;
  font-size: 13px;
  font-weight: 700;
  gap: 6px;
}

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  min-height: 40px;
  padding: 9px 10px;
  width: 100%;
}

textarea {
  resize: vertical;
}

.memo-field textarea {
  min-height: 148px;
}

.drop-zone {
  border: 1px dashed #98a2b3;
  border-radius: 8px;
  background: #f9fbfb;
  padding: 14px;
}

.drop-zone input {
  background: #fff;
}

.evidence-preview-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
}

.evidence-preview-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin: 0;
  min-width: 0;
  overflow: hidden;
  position: relative;
}

.evidence-preview-media {
  aspect-ratio: 4 / 3;
  background: #101828;
  display: block;
  object-fit: cover;
  width: 100%;
}

.evidence-preview-card figcaption {
  display: grid;
  gap: 2px;
  padding: 8px;
}

.evidence-preview-name {
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.evidence-preview-meta {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.evidence-preview-remove {
  align-items: center;
  background: rgb(23 32 42 / 84%);
  border-radius: 999px;
  display: inline-flex;
  font-size: 18px;
  height: 28px;
  justify-content: center;
  min-height: 28px;
  padding: 0;
  position: absolute;
  right: 6px;
  top: 6px;
  width: 28px;
}

.evidence-preview-remove:hover {
  background: #101828;
}

.field-hint,
.auto-meta-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

.auto-meta-note {
  margin: -4px 0 0;
}

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

.advanced-options summary {
  color: var(--brand-dark);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  min-height: 32px;
}

.advanced-options .form-grid {
  margin-top: 10px;
}

.wide-field {
  grid-column: 1 / -1;
}

.submit-row,
.board-header {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.issue-board {
  min-width: 0;
  padding: 18px;
}

.board-header h2 {
  font-size: 18px;
  margin: 0;
}

.issue-table {
  margin-top: 14px;
  overflow-x: auto;
}

.issue-list-grid {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 1040px;
  overflow: hidden;
}

.issue-table-header,
.issue-row {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 72px minmax(220px, 1.5fr) 152px 164px 72px minmax(156px, 0.8fr) minmax(260px, 1.2fr);
  padding: 0 14px;
}

.issue-table-header {
  background: #f4f7f8;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  min-height: 42px;
}

.issue-row {
  background: #fff;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  min-height: 70px;
  text-align: left;
  width: 100%;
}

.issue-row:hover {
  background: #f2f7f5;
}

.issue-row:last-child {
  border-bottom: 0;
}

.issue-cell {
  min-width: 0;
}

.issue-index {
  color: #344054;
  font-weight: 800;
}

.issue-title {
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
}

.issue-link {
  color: var(--brand-dark);
  display: inline-block;
  font-size: 13px;
  font-weight: 800;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.muted-cell {
  color: var(--muted);
  font-weight: 700;
}

.status-pill,
.issue-tags span {
  background: #e7f3ef;
  border: 1px solid #b9d9cf;
  border-radius: 999px;
  color: #105345;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  justify-content: center;
  min-height: 26px;
  padding: 5px 9px;
}

.issue-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.empty {
  color: var(--muted);
  margin: 0;
  padding: 18px;
}

a {
  color: var(--brand-dark);
  font-weight: 800;
}

@media (max-width: 920px) {
  .topbar,
  .auth-actions,
  .submit-row,
  .board-header {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace {
    grid-template-columns: 1fr;
    padding: 14px;
  }

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

  .issue-table {
    overflow: visible;
  }

  .issue-list-grid {
    background: transparent;
    border: 0;
    display: grid;
    gap: 10px;
    min-width: 0;
    overflow: visible;
  }

  .issue-table-header {
    display: none;
  }

  .issue-row {
    border: 1px solid var(--line);
    border-radius: 8px;
    gap: 8px;
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 14px;
  }

  .issue-cell {
    align-items: flex-start;
    display: flex;
    gap: 10px;
    line-height: 1.45;
  }

  .issue-cell::before {
    color: var(--muted);
    content: attr(data-label);
    flex: 0 0 92px;
    font-size: 11px;
    font-weight: 800;
    padding-top: 3px;
  }

  .issue-tags {
    align-items: flex-start;
  }

  .issue-tags span {
    justify-content: flex-start;
  }
}
