:root {
  color-scheme: light;
  --ink: #17211b;
  --muted: #66736c;
  --paper: #fbf5e7;
  --surface: rgba(255, 252, 244, 0.88);
  --line: rgba(23, 33, 27, 0.14);
  --green: #2ca01c;
  --green-dark: #177a12;
  --copper: #b46c2f;
  --blue: #143c5c;
  --shadow: 0 24px 80px rgba(35, 47, 40, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: Arial, sans-serif;
  background:
    radial-gradient(circle at 12% 16%, rgba(44, 160, 28, 0.22), transparent 28rem),
    radial-gradient(circle at 84% 8%, rgba(180, 108, 47, 0.22), transparent 24rem),
    linear-gradient(135deg, #fff8e7 0%, #eaf3df 48%, #d7e6ee 100%);
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(23, 33, 27, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 33, 27, 0.045) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent);
}

code,
pre,
button,
input,
select,
.button {
  font-family: Arial, sans-serif;
}

.shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.reportWorkspace,
.loginCard {
  display: grid;
  gap: 18px;
}

.loginCard {
  max-width: 720px;
  margin: 10vh auto;
  padding: 42px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.reportHeader {
  display: flex;
  gap: 20px;
  align-items: flex-end;
  justify-content: space-between;
  padding: 10px 2px;
}

.reportHeader h1 {
  margin-bottom: 6px;
}

.reportHeader p {
  margin-bottom: 0;
}

.notice {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid rgba(163, 41, 26, 0.22);
  border-radius: 18px;
  color: #6f2b20;
  background: rgba(255, 238, 225, 0.86);
}

.notice span {
  line-height: 1.45;
}

.hero,
.card {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 380px;
  padding: clamp(32px, 6vw, 72px);
  border-radius: 36px;
}

.hero::after {
  position: absolute;
  right: -96px;
  bottom: -132px;
  width: 360px;
  height: 360px;
  border-radius: 44% 56% 52% 48%;
  content: "";
  background: linear-gradient(135deg, var(--green), var(--blue));
  opacity: 0.16;
}

.eyebrow {
  margin-bottom: 12px;
  color: var(--green-dark);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 860px;
  margin-bottom: 12px;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

h2 {
  margin-bottom: 18px;
  font-size: 1.25rem;
}

h3 {
  margin-bottom: 0;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  letter-spacing: -0.04em;
}

p {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--green);
  box-shadow: 0 14px 28px rgba(44, 160, 28, 0.24);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.button:hover {
  box-shadow: 0 18px 34px rgba(44, 160, 28, 0.3);
  transform: translateY(-2px);
}

.button.secondary {
  color: var(--ink);
  background: #fff;
}

.button.ghost {
  color: var(--green-dark);
  background: rgba(44, 160, 28, 0.12);
  box-shadow: none;
}

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

.card {
  padding: 22px;
  border-radius: 22px;
}

.reportCard {
  padding: 0;
  overflow: hidden;
}

.wide {
  margin-top: 18px;
}

.detail {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 18px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.detail span {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.detail strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 1rem;
}

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

.error {
  color: #a3291a;
}

.errorCard {
  max-width: 720px;
  margin: 10vh auto;
}

.setup li {
  margin: 10px 0;
  color: var(--muted);
  line-height: 1.5;
}

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

.pill {
  padding: 8px 12px;
  border: 1px solid rgba(44, 160, 28, 0.28);
  border-radius: 999px;
  color: var(--green-dark);
  background: rgba(44, 160, 28, 0.12);
  font-size: 0.78rem;
  font-weight: 800;
}

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

.reportForm {
  display: grid;
  grid-template-columns: 1.1fr 1.1fr 1.1fr 1.7fr 1.1fr 1fr auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.reportForm label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.reportForm input,
.reportForm select {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.74);
  font-size: 0.85rem;
}

.reportMeta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 22px;
  padding: 22px;
  margin-top: 0;
}

.reportTableWrap {
  overflow: auto;
  margin-top: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.52);
}

.reportTable {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

.reportTable th,
.reportTable td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

.reportTable th:first-child,
.reportTable td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 300px;
  min-width: 300px;
  max-width: 300px;
  border-right: 2px solid rgba(23, 33, 27, 0.18);
  background: #fffaf0;
  text-align: left;
}

.periodReportTable th {
  text-align: center;
}

.periodReportTable th span,
.periodReportTable th small {
  display: block;
}

.periodReportTable th small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.reportTable th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: #fffaf0;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.reportTable td:first-child {
  padding-left: calc(14px + (var(--depth, 0) * 22px));
  overflow: hidden;
  text-overflow: ellipsis;
}

.reportTable tr.section td {
  color: #243a4a;
  background: #f0f2f3;
  font-weight: 800;
}

.reportTable tr.section td:first-child {
  background: #f0f2f3;
}

.reportTable tr.summary td {
  border-top: 1px solid rgba(23, 33, 27, 0.28);
  background: #f7faf4;
  font-weight: 900;
}

.reportTable tr.summary td:first-child {
  background: #f7faf4;
}

.reportTable tr.data td:first-child {
  background: rgba(255, 252, 244, 0.98);
  font-weight: 500;
}

.reportTable tr.computed td:first-child::after {
  margin-left: 8px;
  color: var(--muted);
  content: "calcule";
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

.reportTable .percentCell {
  color: var(--green-dark);
  font-weight: 800;
}

details {
  margin-top: 18px;
}

summary {
  cursor: pointer;
  font-weight: 800;
}

pre {
  max-height: 440px;
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(23, 33, 27, 0.06);
  color: #223128;
  font-size: 0.82rem;
  line-height: 1.5;
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 20px, 1120px);
    padding: 20px 0;
  }

  .hero,
  .card {
    border-radius: 22px;
  }

  .grid,
  .facts,
  .reportMeta,
  .reportForm {
    grid-template-columns: 1fr;
  }

  .detail {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .resultHeader {
    display: block;
  }

  .pill {
    display: inline-flex;
    margin-top: 16px;
  }
}
