:root {
  color-scheme: dark;
  --bg: #0b0b0b;
  --surface: #151515;
  --surface-2: #202020;
  --surface-3: #292929;
  --border: #343434;
  --text: #fff7ed;
  --muted: #b8aaa0;
  --accent: #ff7a1a;
  --accent-strong: #ff8f2f;
  --accent-dark: #211205;
  --success: #34d399;
  --warn: #ffb020;
  --danger: #ff4d4d;
}

* {
  box-sizing: border-box;
}

html {
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Manrope, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 600;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #140700;
  font-weight: 900;
  padding: 10px 14px;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

button:hover:not(:disabled) {
  background: var(--accent-strong);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.ghost {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}

.ghost:hover {
  border-color: var(--accent);
  background: var(--surface-3);
}

.shell {
  width: calc(100% - 32px);
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 0 56px;
}

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

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

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

h1 {
  margin-bottom: 0;
  font-size: clamp(26px, 4vw, 42px);
  font-weight: 900;
  letter-spacing: 0;
}

.panel,
.report-card,
.stat {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
}

.panel {
  padding: 18px;
}

.auth-panel {
  max-width: 420px;
}

.form,
.resolution-form,
.filters {
  display: grid;
  gap: 14px;
}

.resolution-form {
  align-content: start;
  border-left: 1px solid var(--border);
  padding-left: 18px;
}

.filters {
  grid-template-columns: 140px minmax(220px, 1fr);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #3d2a1d;
  background: #1c1c1c;
  color: var(--text);
  padding: 8px 12px;
}

.tab[data-scope="open"] {
  --tab-color: var(--accent);
  --tab-active-bg: rgba(255, 122, 26, 0.18);
}

.tab[data-scope="investigating"] {
  --tab-color: var(--warn);
  --tab-active-bg: rgba(255, 176, 32, 0.18);
}

.tab[data-scope="resolved"] {
  --tab-color: var(--success);
  --tab-active-bg: rgba(52, 211, 153, 0.16);
}

.tab[data-scope="wontfix"] {
  --tab-color: var(--danger);
  --tab-active-bg: rgba(255, 77, 77, 0.16);
}

.tab-icon {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--tab-color);
  fill: currentColor;
}

.tab strong {
  min-width: 18px;
  color: var(--tab-color);
  text-align: center;
  font-size: 13px;
  font-weight: 900;
}

.tab.active {
  border-color: var(--tab-color);
  background: var(--tab-active-bg);
  color: var(--text);
}

.tab.active .tab-icon {
  color: var(--tab-color);
}

.tab.active strong {
  color: var(--tab-color);
}

.tabs .tab:hover:not(:disabled) {
  border-color: var(--tab-color);
  background: #1c1c1c;
  color: var(--text);
}

.tabs .tab.active:hover:not(:disabled) {
  border-color: var(--tab-color);
  background: var(--tab-active-bg);
  color: var(--text);
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #080808;
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 122, 26, 0.24);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat {
  padding: 16px;
  border-color: #3d2a1d;
  background: #17120e;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.stat strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
  color: var(--accent-strong);
  font-weight: 900;
}

.reports-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.report-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  padding: 16px;
  animation: card-enter 220ms ease both;
  transition:
    border-color 160ms ease,
    background-color 160ms ease;
}

.report-card:hover {
  border-color: #5b3820;
  background: #181818;
}

.report-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.report-title-row h2 {
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 18px;
  font-weight: 900;
}

.kind,
.status {
  flex: none;
  border-radius: 999px;
  border: 1px solid #3d2a1d;
  background: #100f0e;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 900;
}

.kind {
  color: var(--accent);
}

.status.open {
  color: var(--accent);
}

.status.investigating {
  color: var(--warn);
}

.status.resolved {
  color: var(--success);
}

.status.wontfix {
  color: var(--muted);
}

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

.meta div {
  min-width: 0;
}

.meta dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.meta dd {
  overflow: hidden;
  margin: 4px 0 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.comment,
.reason {
  margin: 0;
  border-radius: 8px;
  border: 1px solid #2b2119;
  background: #0f0f0f;
  padding: 10px 12px;
  color: var(--muted);
}

.reason {
  margin-top: 10px;
  color: var(--accent-strong);
}

.error {
  min-height: 20px;
  color: var(--danger);
}

.hidden {
  display: none !important;
}

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 880px) {
  .filters,
  .report-card,
  .meta {
    grid-template-columns: 1fr;
  }

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

  .resolution-form {
    border-left: 0;
    border-top: 1px solid var(--border);
    padding-left: 0;
    padding-top: 16px;
  }
}

@media (max-width: 560px) {
  .shell {
    width: calc(100% - 20px);
    padding: 18px 0 36px;
  }

  .topbar {
    align-items: flex-start;
    margin-bottom: 16px;
    padding-bottom: 16px;
  }

  h1 {
    font-size: 20px;
  }

  .eyebrow {
    font-size: 9px;
  }

  .panel {
    padding: 14px;
  }

  .stats-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
  }

  .stat {
    display: inline-flex;
    align-items: baseline;
    gap: 7px;
    min-height: 0;
    padding: 7px 10px;
    box-shadow: none;
  }

  .stat span {
    font-size: 9px;
  }

  .stat strong {
    margin-top: 0;
    font-size: 15px;
  }

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

  .tab {
    width: 100%;
    justify-content: center;
    padding: 9px 10px;
  }

  .tab-icon {
    width: 16px;
    height: 16px;
  }

  .filters {
    gap: 10px;
  }

  .report-card {
    gap: 14px;
    padding: 14px;
  }

  .report-title-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .report-title-row h2 {
    width: 100%;
    white-space: normal;
  }
}
