:root {
  --bg: #f0f4f8;
  --surface: #ffffff;
  --surface-soft: #f8fafb;
  --ink: #0f172a;
  --muted: #5a6a7e;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --navy: #0c1425;
  --navy-2: #111d32;
  --blue: #2563eb;
  --green: #0d7a52;
  --green-soft: #ecfdf5;
  --amber: #a16207;
  --amber-soft: #fffbeb;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --shadow: 0 20px 60px rgba(15, 23, 42, 0.11);
  --shadow-soft: 0 12px 32px rgba(15, 23, 42, 0.07);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, #0c1425 0, #0c1425 316px, var(--bg) 316px),
    var(--bg);
}

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

select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  outline: 0;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.client-shell {
  width: min(1240px, calc(100% - 36px));
  margin: 0 auto;
  padding: 22px 0 54px;
}

.client-auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 50% 40% at 50% 0%, rgba(16, 85, 60, 0.14), transparent),
    #060a0f;
}

.client-auth-card {
  width: min(440px, 100%);
  display: grid;
  gap: 16px;
  border: 1px solid #1e2d3d;
  border-radius: 14px;
  padding: 32px 28px;
  background: rgba(12, 18, 25, 0.97);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255,255,255,0.03);
  color: #f1f5f9;
}

.client-auth-card h1 {
  margin: 5px 0 0;
  font-size: 1.4rem;
  line-height: 1.15;
  color: #f1f5f9;
}

.client-auth-card label,
.findings-toolbar label,
.status-row label {
  display: grid;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.client-auth-card label {
  color: #8492a6;
}

.findings-toolbar label,
.status-row label {
  color: var(--muted);
}

.client-auth-card input,
.client-auth-card select {
  min-height: 42px;
  border: 1px solid #1e2d3d;
  border-radius: 8px;
  padding: 0 14px;
  color: #f1f5f9;
  background: rgba(6, 10, 15, 0.8);
  font: inherit;
  font-size: 0.95rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.client-auth-card input:focus,
.client-auth-card select:focus {
  border-color: #6ee7b7;
  box-shadow: 0 0 0 3px rgba(110, 231, 183, 0.12);
  outline: none;
}

.client-auth-card .primary-action {
  color: #06100c;
  background: #6ee7b7;
  border-color: #6ee7b7;
  font-weight: 800;
}

.client-auth-card .primary-action:hover {
  background: #5dd9a8;
}

#clientLoginMessage {
  min-height: 20px;
  margin: 0;
  color: #f87171;
  font-size: 0.86rem;
  font-weight: 700;
}

.client-auth-card .brand-row p {
  color: #8492a6;
}

.client-auth-card .brand-row strong {
  color: #f1f5f9;
}

.client-header,
.hero-panel,
.summary-grid article,
.notice-panel,
.action-panel,
.findings-panel,
.finding-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.client-header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  margin-bottom: 18px;
  color: #ecf3fb;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

.brand-row,
.header-actions,
.finding-head,
.status-row,
.findings-toolbar,
.finding-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-row img {
  width: 42px;
  height: 42px;
  border-radius: 8px;
}

.brand-row p,
.eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.client-header .brand-row p {
  color: #8ea1b7;
}

.brand-row strong {
  font-size: 1rem;
}

.primary-action,
.secondary-action,
.wide-action {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 850;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.primary-action {
  color: #fff;
  background: #0d7a52;
  border-color: #0d7a52;
}

.secondary-action,
.wide-action {
  color: var(--ink);
  background: #f8fafc;
}

.client-header .secondary-action {
  color: #e9f0f8;
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.2);
}

.primary-action:hover,
.secondary-action:hover,
.wide-action:hover {
  transform: translateY(-1px);
}

.primary-action:disabled,
.secondary-action:disabled,
.wide-action:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
  padding: 26px;
  margin-bottom: 14px;
  border-color: rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    #111d32;
  color: #f8fbff;
  box-shadow: var(--shadow);
  border-radius: 12px;
}

.hero-panel .eyebrow {
  color: #7a92ad;
}

.hero-panel h1 {
  max-width: 840px;
  margin: 0;
  font-size: 2.4rem;
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hero-panel a {
  display: inline-block;
  margin-top: 12px;
  color: #6ee7b7;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.status-card {
  display: grid;
  align-content: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-left: 4px solid #62d39c;
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.06);
}

.status-card span,
.summary-grid span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.status-card span {
  color: #91a4ba;
}

.status-card strong {
  font-size: 1.7rem;
  line-height: 1.05;
}

.status-card small {
  color: #b7c4d2;
}

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

.summary-grid article {
  min-height: 92px;
  display: grid;
  align-content: space-between;
  gap: 10px;
  padding: 14px;
  box-shadow: var(--shadow-soft);
}

.summary-grid strong {
  color: var(--navy);
  font-size: 1.35rem;
  line-height: 1.08;
}

.notice-panel {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  margin-bottom: 14px;
  box-shadow: none;
  border-color: #efcf87;
  background: var(--amber-soft);
}

.notice-panel strong {
  color: #5b3e0d;
}

.notice-panel p {
  margin: 0;
  color: #634b18;
  line-height: 1.45;
}

.portal-layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.action-panel,
.findings-panel {
  padding: 16px;
}

.action-panel {
  position: sticky;
  top: 14px;
}

.panel-head h2,
.findings-toolbar h2 {
  margin: 0;
  font-size: 1.08rem;
}

.panel-head.compact {
  margin-top: 20px;
}

#actionChecklist {
  margin: 12px 0 0;
  padding-left: 20px;
  color: #475569;
  line-height: 1.55;
}

#actionChecklist li + li {
  margin-top: 6px;
}

.wide-action {
  width: 100%;
  margin-top: 8px;
  justify-content: flex-start;
}

.request-log {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.request-log p,
.request-log article {
  margin: 0;
  color: var(--muted);
  font-size: 0.83rem;
}

.request-log article {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-soft);
}

.request-log strong {
  color: var(--ink);
}

.request-log time {
  color: var(--muted);
  font-size: 0.74rem;
}

.findings-toolbar {
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.findings-list {
  display: grid;
  gap: 12px;
}

.finding-card {
  padding: 16px;
  box-shadow: none;
}

.finding-head {
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.finding-head h3 {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.25;
}

.finding-meta {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.severity-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px 9px;
  color: #fff;
  background: var(--amber);
  font-size: 0.7rem;
  font-weight: 950;
  text-transform: uppercase;
}

.severity-pill.high {
  background: var(--red);
}

.severity-pill.medium {
  background: var(--amber);
}

.severity-pill.low {
  color: #07563a;
  background: #ccefe0;
}

.status-row {
  justify-content: space-between;
  margin: 14px 0;
  padding: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

.finding-detail div {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: #fff;
}

.finding-detail div:first-child {
  grid-column: 1 / -1;
  min-height: auto;
  background: var(--green-soft);
  border-color: #b9e6d1;
}

dt {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 950;
  text-transform: uppercase;
}

dd {
  margin: 6px 0 0;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

dd a {
  color: #0f5ab8;
  font-weight: 850;
}

.developer-box {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface-soft);
}

.developer-box summary {
  cursor: pointer;
  font-weight: 900;
}

.developer-box ul {
  margin: 10px 0 0;
  padding-left: 20px;
  color: #475569;
  line-height: 1.45;
}

.evidence-box {
  margin-top: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 12px;
  color: var(--muted);
  background: #fbfcfe;
}

.evidence-box strong {
  color: var(--ink);
}

.evidence-box p {
  margin: 4px 0 0;
}

.evidence-box img {
  width: min(100%, 620px);
  display: block;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.finding-actions {
  flex-wrap: wrap;
  margin-top: 12px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100% - 36px));
  padding: 12px 14px;
  border-radius: 8px;
  color: #fff;
  background: #101828;
  opacity: 0;
  transform: translateY(8px);
  transition: 0.18s ease;
  pointer-events: none;
  font-weight: 850;
  box-shadow: var(--shadow);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  body {
    background:
      linear-gradient(180deg, #101927 0, #101927 260px, var(--bg) 260px),
      var(--bg);
  }

  .hero-panel,
  .portal-layout {
    grid-template-columns: 1fr;
  }

  .hero-panel h1 {
    font-size: 2.1rem;
  }

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

  .action-panel {
    position: static;
  }
}

@media (max-width: 680px) {
  .client-shell {
    width: min(100% - 24px, 1240px);
    padding-top: 12px;
  }

  .client-header,
  .header-actions,
  .findings-toolbar,
  .status-row {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-panel {
    padding: 18px;
  }

  .hero-panel h1 {
    font-size: 1.65rem;
  }

  .summary-grid,
  .finding-detail {
    grid-template-columns: 1fr;
  }

  .summary-grid article {
    min-height: 76px;
  }

  .finding-actions > *,
  .header-actions > * {
    width: 100%;
  }
}
