:root {
  font-family:
    Inter,
    system-ui,
    -apple-system,
    sans-serif;
  color: #22372f;
  background: #f5f4ef;
  --green: #263c36;
  --gold: #b78653;
  --line: #d9ded7;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 3px;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  padding: 0.65rem 1rem;
  border-radius: 8px;
  background: white;
  color: var(--green);
}
button:hover {
  background: #edf1eb;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button.primary {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
button.danger {
  color: #9c2525;
}
input,
select,
textarea {
  padding: 0.68rem;
  border: 1px solid #bdc8bf;
  border-radius: 7px;
  background: white;
  min-width: 0;
  width: 100%;
}
input[type="checkbox"] {
  width: auto;
}
textarea {
  min-height: 90px;
}
label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.85rem;
}
header {
  padding: 1rem 2rem;
  background: var(--green);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
header .brand {
  font-family: Georgia, serif;
  font-size: 1.9rem;
  letter-spacing: 0.04em;
}
header .user {
  margin-left: auto;
  font-size: 0.9rem;
}
header button {
  background: transparent;
  color: white;
  border-color: #597166;
}
header select {
  width: auto;
}
aside {
  padding: 1rem;
  position: fixed;
  top: 85px;
  bottom: 0;
  width: 210px;
  overflow: auto;
  border-right: 1px solid var(--line);
}
aside button {
  display: block;
  text-align: left;
  border: 0;
  background: transparent;
  width: 100%;
  margin: 0.2rem 0;
}
aside button.selected {
  background: var(--green);
  color: white;
}
main {
  max-width: 1400px;
  margin: auto;
  padding: 2rem;
}
.shell main {
  margin-left: 210px;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #806c50;
  font-size: 0.72rem;
  margin: 0;
}
.titlebar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
h1 {
  font-family: Georgia, serif;
  font-weight: 400;
  font-size: 2.2rem;
  margin: 0.5rem 0;
}
h2 {
  font-size: 1.2rem;
}
.titlebar .actions {
  margin-left: auto;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.toolbar {
  display: flex;
  gap: 0.75rem;
  align-items: end;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}
.toolbar input {
  max-width: 340px;
}
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.4rem;
}
.tablewrap {
  overflow: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}
th,
td {
  text-align: left;
  padding: 0.85rem;
  border-bottom: 1px solid #e6e9e3;
  max-width: 350px;
  overflow-wrap: anywhere;
}
th {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: #5e7067;
  background: #f0f3ed;
}
td button {
  padding: 0.4rem 0.55rem;
  margin: 0.15rem;
  font-size: 0.78rem;
}
tr:last-child td {
  border-bottom: 0;
}
.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}
.muted {
  color: #6f7f76;
  font-size: 0.85rem;
}
.login {
  max-width: 440px;
  margin: 9vh auto;
}
.login form {
  display: grid;
  gap: 1.2rem;
}
.login img {
  max-width: 200px;
  max-height: 100px;
  object-fit: contain;
}
.formgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.formactions {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.5rem;
  justify-content: end;
}
.wide {
  grid-column: 1/-1;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 14px;
  width: min(760px, 94vw);
  max-height: 90vh;
  padding: 1.7rem;
  color: var(--green);
}
dialog::backdrop {
  background: #11241c88;
}
.error {
  color: #a22d2d;
  white-space: pre-wrap;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.5rem;
}
.stat strong {
  display: block;
  font-size: 2rem;
  font-weight: 500;
  margin-top: 0.5rem;
}
#notice {
  position: fixed;
  bottom: 24px;
  right: 24px;
  max-width: min(440px, 90vw);
  background: var(--green);
  color: white;
  border-radius: 10px;
  padding: 0;
  z-index: 20;
  white-space: pre-wrap;
}
#notice.visible {
  padding: 1rem 1.3rem;
}
.env {
  background: #efe3c3;
  padding: 0.5rem 1rem;
  text-align: center;
  font-size: 0.75rem;
}
.survey {
  max-width: 740px;
  margin: auto;
}
.question {
  display: grid;
  gap: 0.7rem;
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--line);
}
pre {
  white-space: pre-wrap;
  max-height: 380px;
  overflow: auto;
  font-size: 0.8rem;
}
.notice {
  background: #fcf2d8;
  padding: 1rem;
  border-radius: 8px;
}
.empty {
  padding: 2rem;
  text-align: center;
  color: #718075;
}
@media (max-width: 850px) {
  header {
    padding: 1rem;
  }
  header .user {
    margin-left: 0;
  }
  aside {
    position: static;
    width: auto;
    display: flex;
    overflow: auto;
    border-bottom: 1px solid var(--line);
    padding: 0.5rem;
  }
  aside button {
    white-space: nowrap;
    width: auto;
  }
  .shell main {
    margin: 0;
    padding: 1rem;
  }
  .formgrid {
    grid-template-columns: 1fr;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  h1 {
    font-size: 1.8rem;
  }
  .titlebar .actions {
    margin-left: 0;
  }
  .login {
    margin: 3vh auto;
  }
}

/* Clients: approved legacy-inspired direction, scoped to this module. */
.clients-page { color:#152028; }
.clients-page h1 {font-size:3rem;letter-spacing:-.02em}
.clients-page .titlebar {margin-bottom:.25rem}
.client-intro {color:#70808c;margin:0 0 1.8rem;line-height:1.6}
.clients-page h2 {font:1.8rem Georgia,serif;margin:1.5rem 0 1rem}
.clients-page .primary {background:#9d7956;border-color:#9d7956;box-shadow:0 6px 16px #61483218}
.client-kpis {display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:1rem;margin-bottom:1.5rem}
.client-kpis button {text-align:left;background:white;border:1px solid #e1e7eb;padding:1.25rem;border-radius:10px;color:#152028;box-shadow:0 10px 28px #25343d0d}
.client-kpis strong {display:block;font:2.4rem Georgia,serif;margin:.7rem 0}
.client-kpis small {color:#70808c;font-size:.72rem}
.client-kpis button[aria-pressed="true"] {background:#faf6f0;border-color:#9d7956}
.clients-page .tablewrap {border-color:#e1e7eb;box-shadow:0 10px 28px #25343d0d}
.clients-page th {background:#f8fafb;color:#62737f;text-transform:uppercase}
.clients-page td {padding:1.1rem .85rem}
.clients-page tbody tr:hover {background:#faf8f5}
.clients-page .toolbar {background:white;padding:1rem;border:1px solid #e1e7eb;border-radius:10px}
@media(max-width:1100px){.client-kpis{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:600px){.client-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.clients-page h1{font-size:2.4rem}}

.form-section {border-bottom:1px solid #e1e7eb;padding-bottom:.65rem;margin:.8rem 0 .1rem;color:#816244;font-size:.95rem}
