:root {
  color-scheme: light;
  --ink: #1a2731;
  --muted: #5d6b76;
  --line: #d8e1e7;
  --panel: #ffffff;
  --page: #f4f7f8;
  --blue: #1265ad;
  --green: #118548;
  --teal: #0b6b70;
  --gold: #b28b3f;
  --danger: #a73535;
  --shadow: 0 20px 60px rgba(22, 41, 52, .14);
}

* {
  box-sizing: border-box;
}

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

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 70px;
  padding: 12px clamp(18px, 4vw, 52px);
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand img {
  width: min(260px, 48vw);
  height: auto;
  display: block;
}

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

.nav a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: 8px 12px;
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
}

.nav a.primary {
  background: var(--teal);
  color: #ffffff;
}

.hero {
  min-height: calc(100vh - 70px);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: center;
  padding: clamp(28px, 6vw, 78px) clamp(18px, 6vw, 86px);
  background:
    linear-gradient(115deg, rgba(255, 255, 255, .98), rgba(244, 247, 248, .88) 55%, rgba(232, 241, 238, .86)),
    url("/assets/precision-accounting-support-logo.png") right 6vw bottom 8vh / min(42vw, 560px) auto no-repeat;
}

.hero-copy {
  max-width: 760px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
}

h1 {
  margin: 0;
  max-width: 720px;
  font-size: clamp(36px, 6vw, 72px);
  line-height: .98;
  letter-spacing: 0;
}

.hero p {
  max-width: 650px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--teal);
  border-radius: 6px;
  padding: 10px 15px;
  background: var(--teal);
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
}

.button.secondary {
  background: #ffffff;
  color: var(--teal);
}

.text-button {
  width: 100%;
  min-height: 34px;
  margin-top: 8px;
  border: 0;
  background: transparent;
  color: var(--teal);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.summary-panel {
  background: rgba(255, 255, 255, .94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.summary-panel h2 {
  margin: 0;
  padding: 18px 18px 10px;
  font-size: 18px;
}

.workflow-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.workflow-list li {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
}

.workflow-list span {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #ffffff;
  background: var(--blue);
  font-weight: 800;
}

.workflow-list strong {
  display: block;
  margin-bottom: 2px;
}

.workflow-list small {
  color: var(--muted);
  line-height: 1.45;
}

.section {
  padding: clamp(36px, 7vw, 78px) clamp(18px, 6vw, 86px);
}

.section h2 {
  margin: 0 0 14px;
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: 0;
}

.section-intro {
  max-width: 780px;
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

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

.card {
  min-height: 184px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}

.card h3 {
  margin: 0 0 10px;
  font-size: 19px;
}

.card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 500px) 1fr;
  background:
    linear-gradient(90deg, #ffffff 0, #ffffff 45%, rgba(255,255,255,.8) 62%, rgba(244,247,248,.88)),
    url("/assets/precision-accounting-support-logo.png") right 7vw top 12vh / min(44vw, 560px) auto no-repeat,
    var(--page);
}

.login-panel {
  display: flex;
  align-items: center;
  min-height: 100vh;
  padding: 28px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.login-card img {
  width: min(270px, 100%);
  height: auto;
  display: block;
  margin-bottom: 24px;
}

.login-card h1 {
  font-size: 28px;
  line-height: 1.15;
  margin-bottom: 20px;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cbd6dd;
  border-radius: 6px;
  padding: 9px 10px;
  font: inherit;
}

input[type="checkbox"] {
  width: auto;
  min-height: auto;
}

textarea,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cbd6dd;
  border-radius: 6px;
  padding: 9px 10px;
  font: inherit;
  background: #ffffff;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  outline: 3px solid rgba(11, 107, 112, .18);
  border-color: var(--teal);
}

.login-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.form-status {
  min-height: 22px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
}

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

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--page);
}

.app-header {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.app-header .brand img {
  width: min(230px, 44vw);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(520px, 48vw);
}

.header-actions select {
  min-width: 220px;
}

.app-body {
  display: grid;
  grid-template-columns: 230px 1fr;
  min-height: calc(100vh - 68px);
}

.app-nav {
  padding: 14px;
  background: #eaf0f1;
  border-right: 1px solid var(--line);
}

.app-nav button {
  width: 100%;
  min-height: 38px;
  margin-bottom: 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px 10px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.app-nav button.active {
  border-color: #a7c4c7;
  background: #ffffff;
  color: var(--teal);
  font-weight: 800;
}

.app-main {
  padding: 20px;
  overflow: auto;
}

.screen {
  display: none;
  max-width: 1240px;
}

.screen.active {
  display: block;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

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

.toolbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.search-input {
  width: min(220px, 42vw);
  min-height: 34px;
  padding: 6px 9px;
}

.panel {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.panel.padded {
  padding: 16px;
}

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

.metric {
  min-height: 104px;
  padding: 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.metric strong {
  display: block;
  margin-top: 10px;
  font-size: 32px;
  line-height: 1;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
  overflow-wrap: anywhere;
}

th {
  color: var(--muted);
  background: #f8fbfb;
  font-weight: 800;
}

pre {
  margin: 0;
  min-height: 220px;
  padding: 14px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #ecf5f4;
  background: #101820;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  background: #eef4f5;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.pill.good {
  background: #e7f6ee;
  color: var(--green);
}

.pill.warn {
  background: #fff6df;
  color: #7b5a13;
}

.pill.bad {
  background: #fdecec;
  color: var(--danger);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.score-cell {
  display: grid;
  gap: 5px;
  justify-items: start;
}

.small-button {
  min-height: 32px;
  border: 1px solid var(--teal);
  border-radius: 6px;
  padding: 6px 9px;
  color: var(--teal);
  background: #ffffff;
  cursor: pointer;
  font-weight: 800;
}

.small-button.primary {
  color: #ffffff;
  background: var(--teal);
}

.small-button.danger {
  border-color: var(--danger);
  color: var(--danger);
}

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

.hidden {
  display: none !important;
}

.footer {
  padding: 26px clamp(18px, 6vw, 86px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: #ffffff;
  font-size: 14px;
}

@media (max-width: 900px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    width: 100%;
    overflow-x: auto;
  }

  .hero,
  .login-page {
    grid-template-columns: 1fr;
    background: var(--page);
  }

  .hero {
    min-height: auto;
  }

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

  .login-panel {
    min-height: 100vh;
    padding: 20px;
  }

  .login-card {
    max-width: none;
  }

  .app-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
    min-width: 0;
    flex-direction: column;
    align-items: stretch;
  }

  .app-body {
    grid-template-columns: 1fr;
  }

  .app-nav {
    display: flex;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .app-nav button {
    width: auto;
    white-space: nowrap;
  }

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