:root {
  color-scheme: dark;
  --bg: #08121d;
  --bg-elevated: #122033;
  --bg-panel: rgba(17, 32, 51, 0.84);
  --bg-muted: #0d1726;
  --border: rgba(132, 160, 194, 0.16);
  --text: #f2f7fb;
  --muted: #9caec1;
  --accent: #21c086;
  --accent-strong: #17a974;
  --accent-soft: rgba(33, 192, 134, 0.15);
  --warn: #f6c85f;
  --warn-soft: rgba(246, 200, 95, 0.12);
  --fail: #f06a73;
  --fail-soft: rgba(240, 106, 115, 0.14);
  --pass: #5fd6a4;
  --pass-soft: rgba(95, 214, 164, 0.14);
  --shadow: 0 24px 50px rgba(0, 0, 0, 0.28);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(33, 192, 134, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(84, 132, 255, 0.12), transparent 22%),
    linear-gradient(180deg, #09121d 0%, #060d15 100%);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3, h4, p {
  margin: 0;
}

.auth-shell {
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card,
.panel,
.sidebar-card {
  backdrop-filter: blur(16px);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.auth-card {
  width: min(460px, 100%);
  border-radius: 28px;
  padding: 32px;
}

.brand-lockup,
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: linear-gradient(135deg, #1fd8ad, #2563eb);
  color: white;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 18px;
}

.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

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

.stack-lg {
  display: grid;
  gap: 18px;
}

.stack-md {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 13px;
  font-weight: 600;
  color: #cfe0ef;
}

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

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(140, 167, 199, 0.2);
  border-radius: 14px;
  background: rgba(7, 15, 25, 0.72);
  color: var(--text);
  padding: 12px 14px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(33, 192, 134, 0.7);
  box-shadow: 0 0 0 3px rgba(33, 192, 134, 0.14);
}

.btn {
  appearance: none;
  border: none;
  border-radius: 14px;
  padding: 12px 18px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #1c9fef);
  color: white;
  font-weight: 700;
}

.btn-secondary {
  background: rgba(18, 31, 48, 0.9);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(33, 192, 134, 0.4);
}

.btn-danger {
  background: transparent;
  color: var(--fail);
  border: 1px solid rgba(240, 106, 115, 0.35);
}

.btn-block {
  width: 100%;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 26px 20px;
  border-right: 1px solid rgba(132, 160, 194, 0.12);
  background: rgba(3, 8, 14, 0.72);
  display: grid;
  align-content: start;
  gap: 18px;
  overflow: auto;
}

.sidebar-card {
  border-radius: 20px;
  padding: 16px;
}

.sidebar-user {
  margin-top: 8px;
  font-size: 20px;
  font-weight: 700;
}

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

.sidebar-nav a {
  padding: 12px 14px;
  border-radius: 14px;
  color: #cfdeeb;
  background: rgba(15, 25, 39, 0.55);
  border: 1px solid transparent;
}

.sidebar-nav a:hover {
  border-color: rgba(33, 192, 134, 0.35);
  background: rgba(16, 29, 46, 0.85);
}

.sidebar-nav a.is-active {
  border-color: rgba(33, 192, 134, 0.42);
  background: rgba(16, 29, 46, 0.96);
  color: #f4fbff;
  box-shadow: inset 0 0 0 1px rgba(33, 192, 134, 0.12);
}

.sidebar-history-panel {
  min-height: 0;
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(132, 160, 194, 0.14);
  background: rgba(9, 16, 26, 0.72);
}

.sidebar-history-list {
  min-height: 0;
  max-height: 44vh;
  overflow: auto;
  display: grid;
  gap: 10px;
  padding-right: 4px;
}

.content {
  padding: 30px;
  display: grid;
  gap: 24px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 20px;
}

.page-header h2 {
  font-size: clamp(28px, 4vw, 42px);
  max-width: 720px;
}

.panel {
  border-radius: var(--radius);
  padding: 24px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  margin-bottom: 18px;
}

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

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

.panel-actions,
.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: end;
}

.report-toolbar,
.history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.field-grow {
  flex: 1 1 240px;
}

.content-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
}

.content-grid-single {
  grid-template-columns: 1fr;
}

.banner {
  border-radius: 16px;
  padding: 14px 16px;
  margin: 0 0 18px;
  border: 1px solid transparent;
}

.banner-pass {
  color: var(--pass);
  background: var(--pass-soft);
  border-color: rgba(95, 214, 164, 0.32);
}

.banner-fail {
  color: var(--fail);
  background: var(--fail-soft);
  border-color: rgba(240, 106, 115, 0.35);
}

.banner-partial {
  color: var(--warn);
  background: var(--warn-soft);
  border-color: rgba(246, 200, 95, 0.35);
}

.empty-state {
  border: 1px dashed rgba(132, 160, 194, 0.24);
  border-radius: 18px;
  padding: 26px;
  color: var(--muted);
}

.report-root {
  display: grid;
  gap: 18px;
}

.report-summary {
  display: grid;
  gap: 18px;
}

.status-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.status-chip {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.status-chip.pass {
  color: var(--pass);
  background: var(--pass-soft);
}

.status-chip.fail {
  color: var(--fail);
  background: var(--fail-soft);
}

.status-chip.partial {
  color: var(--warn);
  background: var(--warn-soft);
}

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

.metric-card,
.finding-card,
.history-item,
.token-card,
.user-card,
.evidence-card {
  border-radius: 18px;
  border: 1px solid rgba(132, 160, 194, 0.15);
  background: rgba(10, 18, 29, 0.74);
}

.metric-card {
  padding: 16px;
}

.metric-value {
  margin-top: 6px;
  font-size: 30px;
  font-weight: 800;
}

.finding-list,
.evidence-grid {
  display: grid;
  gap: 14px;
}

.finding-card {
  padding: 18px;
}

.finding-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 10px;
}

.finding-card ul,
.evidence-card ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: #d5e1ea;
}

.scan-history,
.token-list,
.user-list {
  display: grid;
  gap: 12px;
}

.history-item,
.token-card,
.user-card,
.evidence-card {
  padding: 16px;
}

.history-item.is-active {
  border-color: rgba(33, 192, 134, 0.45);
  box-shadow: inset 0 0 0 1px rgba(33, 192, 134, 0.16);
}

.history-actions {
  margin-top: 12px;
}

.evidence-screenshot {
  display: block;
  width: 100%;
  margin-top: 12px;
  border-radius: 14px;
  border: 1px solid rgba(132, 160, 194, 0.18);
  background: rgba(7, 15, 25, 0.72);
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.token-secret {
  margin-top: 14px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(8, 18, 29, 0.88);
  border: 1px solid rgba(33, 192, 134, 0.24);
}

.token-secret code {
  display: block;
  margin-top: 8px;
  word-break: break-all;
  color: #9bedcb;
}

.helper-text {
  font-size: 13px;
  color: var(--muted);
}

.helper-link {
  color: #8fdcff;
  text-decoration: underline;
  text-decoration-color: rgba(143, 220, 255, 0.38);
  text-underline-offset: 2px;
  word-break: break-all;
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

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

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

  .sidebar-history-list {
    max-height: none;
  }
}

@media (max-width: 720px) {
  .content {
    padding: 18px;
  }

  .page-header,
  .panel-heading {
    flex-direction: column;
  }
}
