:root {
  --bg: #0b0f14;
  --panel: #121820;
  --panel-soft: #161f2a;
  --line: rgba(255, 255, 255, 0.11);
  --text: #edf3fb;
  --muted: #9aa8b8;
  --brand: #4aa3ff;
  --accent: #44d7b6;
  --danger: #ff6875;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, Segoe UI, Arial, sans-serif;
}

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

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

.sidebar {
  border-right: 1px solid var(--line);
  background: #0e141c;
  padding: 24px;
}

.brand,
.profile {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand span {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: #1d2a38;
  color: var(--brand);
  font-weight: 900;
}

.brand small,
.profile small,
.eyebrow {
  color: var(--muted);
}

.profile {
  display: grid;
  margin: 28px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-button,
.back-link,
.ghost-button,
.primary-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 13px;
  text-decoration: none;
  cursor: pointer;
}

.nav-button,
.back-link,
.ghost-button {
  background: transparent;
  color: var(--muted);
}

.nav-button {
  text-align: left;
}

.nav-button:hover,
.nav-button.is-active,
.back-link:hover,
.ghost-button:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.back-link,
#logout-button {
  display: block;
  margin-top: 18px;
  text-align: center;
}

.primary-button {
  border-color: rgba(74, 163, 255, 0.45);
  background: var(--brand);
  color: #06101a;
  font-weight: 800;
}

.content {
  padding: clamp(24px, 4vw, 52px);
}

.panel-heading {
  margin-bottom: 22px;
}

.panel-heading h1 {
  margin: 4px 0 0;
  font-size: clamp(1.7rem, 2.6vw, 2.45rem);
}

.eyebrow {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.login-panel,
.section-panel {
  max-width: 1180px;
}

.login-form {
  display: grid;
  max-width: 460px;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

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

label {
  display: grid;
  gap: 8px;
  color: #d8e2ef;
  font-size: 0.9rem;
  font-weight: 800;
}

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

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(74, 163, 255, 0.16);
}

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

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.form-status {
  min-height: 24px;
  margin: 0;
  color: var(--accent);
  font-weight: 800;
}

.form-status.is-error {
  color: var(--danger);
}

.workspace.is-hidden,
.login-panel.is-hidden,
.section-panel,
.is-hidden {
  display: none;
}

.section-panel.is-active {
  display: block;
}

.archive-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.36fr) minmax(0, 0.64fr);
  gap: 18px;
  align-items: start;
}

.report-list {
  display: grid;
  gap: 10px;
}

.report-card,
.report-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.report-card {
  padding: 14px;
  text-align: left;
  color: var(--text);
  cursor: pointer;
}

.report-card:hover,
.report-card.is-active {
  border-color: rgba(74, 163, 255, 0.5);
  background: var(--panel-soft);
}

.report-card strong,
.report-card small {
  display: block;
}

.report-card small {
  margin-top: 6px;
  color: var(--muted);
}

.report-preview {
  padding: 22px;
}

.report-preview header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.status-pill {
  align-self: start;
  border-radius: 999px;
  background: rgba(68, 215, 182, 0.13);
  color: #9ff1de;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 900;
}

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

.meta-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.meta-grid dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.meta-grid dd {
  margin: 4px 0 0;
}

.report-body h2 {
  margin-top: 22px;
}

.report-body p {
  color: #d7e0eb;
  line-height: 1.65;
}

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

@media (max-width: 860px) {
  .app-shell,
  .archive-grid,
  .report-form {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}
