:root {
  font-family:
    Inter,
    Segoe UI,
    Arial,
    sans-serif;
  color: #243c35;
  background: #f5f5ef;
  font-synthesis: none;
  --green: #123d32;
  --muted: #6e7c72;
  --line: #dde2d8;
  --gold: #e8b85f;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select {
  touch-action: manipulation;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
a {
  color: var(--green);
}
button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: 1px solid var(--line);
  background: white;
  color: var(--green);
  border-radius: 8px;
  padding: 10px 17px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
button:hover,
.btn:hover {
  background: #eaf0e7;
}
.primary {
  background: var(--green);
  border-color: var(--green);
  color: white;
}
.primary:hover {
  background: #215746;
}
.gold {
  background: var(--gold);
  border-color: var(--gold);
  color: #243c35;
}
input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cad4c8;
  border-radius: 7px;
  background: white;
  padding: 10px;
  color: #243c35;
}
textarea {
  min-height: 88px;
  resize: vertical;
}
input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid #d6b566;
  outline-offset: 2px;
}
label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 7px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 32px;
  letter-spacing: -1px;
  font-weight: 600;
  margin-bottom: 10px;
}
h2 {
  font-size: 19px;
  letter-spacing: -0.4px;
}
h3 {
  font-size: 15px;
}
p {
  line-height: 1.6;
}
.muted {
  color: var(--muted);
}
.eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #829187;
}
.shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  background: var(--green);
  color: #e4ebe4;
  padding: 34px 22px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: 1px;
}
.brand img {
  width: 39px;
  height: 39px;
  border: 1px solid #547062;
  border-radius: 10px;
}
.brand small {
  display: block;
  font-size: 9px;
  letter-spacing: 1.5px;
  color: #a4b6a7;
  margin-top: 5px;
}
.sidebar .eyebrow {
  margin: 45px 12px 15px;
  color: #94ab9e;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.nav button {
  justify-content: flex-start;
  background: transparent;
  border: 0;
  color: #b7cabf;
  font-weight: 500;
  padding: 13px;
  gap: 13px;
}
.nav button.active {
  background: #2a5142;
  color: #fff;
}
.nav span {
  font-size: 18px;
}
.sidebar-bottom {
  margin-top: auto;
  border-top: 1px solid #375c4d;
  padding-top: 22px;
  font-size: 12px;
  line-height: 1.7;
}
.sidebar-bottom button {
  background: transparent;
  color: #bed0c4;
  border: 0;
  padding: 5px 0;
  min-height: 30px;
  font-size: 11px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 20px 40px;
  background: #fafbf7;
  font-size: 12px;
}
.topbar strong {
  font-size: 13px;
}
.online {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #5e7165;
}
.online:before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #739b63;
}
.content {
  padding: 37px 40px;
  max-width: 1500px;
  margin: 0 auto;
}
.heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 28px;
}
.heading p {
  font-size: 13px;
  margin: 0;
  color: var(--muted);
}
.heading .eyebrow {
  margin-bottom: 10px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 26px;
}
.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 23px;
}
.stat .label {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 16px;
}
.stat .value {
  font-size: 31px;
  letter-spacing: -1px;
}
.stat .value small {
  font-size: 13px;
  letter-spacing: 0;
  color: var(--muted);
  margin-left: 4px;
}
.stat .foot {
  font-size: 10px;
  color: #7b887a;
  margin-top: 12px;
}
.stat.dark {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
.stat.dark .label,
.stat.dark .foot,
.stat.dark small {
  color: #bdcdbf;
}
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 11px;
  margin-bottom: 22px;
  overflow: hidden;
}
.panel-head {
  padding: 23px 25px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.panel-head h2 {
  margin: 0;
  font-size: 16px;
}
.panel-head p {
  margin: 7px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.panel-body {
  padding: 25px;
}
.filters {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.filters.report {
  grid-template-columns: repeat(3, 1fr);
}
.filters label {
  font-size: 10px;
  color: var(--muted);
}
.filters input,
.filters select {
  font-size: 12px;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
  font-size: 12px;
}
th {
  text-align: left;
  padding: 13px 24px;
  background: #fafbf7;
  color: #7c887b;
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 600;
}
td {
  padding: 19px 24px;
  border-top: 1px solid #edf0e9;
}
td strong {
  font-weight: 600;
}
td small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}
td button {
  padding: 4px 10px;
  min-height: 32px;
  font-size: 11px;
}
.badge {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 5px;
  background: #f2eee3;
  color: #967030;
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}
.badge.matched {
  background: #e9f1e8;
  color: #52764a;
}
.badge.flagged {
  background: #fae9e2;
  color: #a15538;
}
.badge.draft {
  background: #eceef1;
  color: #6a7381;
}
.badge.submitted {
  background: #e6eeeb;
  color: #426858;
}
.empty {
  text-align: center;
  padding: 55px 20px;
  color: var(--muted);
  font-size: 13px;
}
.empty h3 {
  color: var(--green);
  font-size: 19px;
  margin: 15px 0 9px;
}
.notice {
  padding: 15px 18px;
  background: #f5f1e5;
  border: 1px solid #e6d9b4;
  border-radius: 8px;
  color: #796235;
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 20px;
}
.notice.good {
  background: #edf3ea;
  border-color: #d3e0cc;
  color: #4c6843;
}
.notice.error {
  background: #fff0ea;
  border-color: #edc9bb;
  color: #914b32;
}
.upload-zone {
  padding: 45px 25px;
  text-align: center;
  background: #fafbf7;
  border: 1px dashed #b9c9b7;
  border-radius: 10px;
}
.upload-zone .symbol {
  width: 60px;
  height: 60px;
  background: #e9eee3;
  border-radius: 16px;
  margin: 0 auto 22px;
  display: grid;
  place-items: center;
  font-size: 27px;
}
.upload-zone p {
  font-size: 12px;
  color: var(--muted);
  max-width: 400px;
  margin: 12px auto 24px;
}
.upload-zone .actions {
  justify-content: center;
}
.steps {
  display: flex;
  gap: 20px;
  margin: 24px 0;
  color: #748373;
  font-size: 11px;
}
.steps span {
  display: flex;
  align-items: center;
  gap: 7px;
}
.steps b {
  border: 1px solid #ccd6c8;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 10px;
}
.steps .current {
  color: var(--green);
  font-weight: 650;
}
.steps .current b {
  background: var(--green);
  color: white;
}
.sample-picker {
  margin-top: 22px;
  max-width: 600px;
}
.sample-picker p {
  font-size: 11px;
  color: var(--muted);
}
.sample-picker .actions {
  flex-wrap: nowrap;
}
.review-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(350px, 1.1fr);
  gap: 22px;
  align-items: start;
}
.photo-panel {
  position: sticky;
  top: 20px;
}
.photo-panel img {
  display: block;
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  background: #eaece6;
}
.photo-panel .panel-body {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.7;
}
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 17px;
}
.field-grid input {
  font-size: 13px;
}
.field-grid input:disabled {
  background: #f7f8f3;
  color: #344c40;
  opacity: 1;
}
.field .original {
  font-size: 10px;
  color: #987339;
  margin-top: 5px;
}
.field-wide {
  grid-column: 1/-1;
}
.form-section {
  padding: 23px;
  border-bottom: 1px solid var(--line);
}
.form-section h3 {
  margin-bottom: 20px;
}
.confirmation {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.7;
}
.confirmation input {
  width: 18px;
  min-height: 18px;
  margin-top: 3px;
  flex: none;
}
.submit-bar {
  padding: 23px;
  background: #fafbf7;
}
.submit-bar .actions {
  margin-top: 18px;
}
.comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.comparison img {
  width: 100%;
  max-height: 60vh;
  object-fit: contain;
  background: #eceee8;
}
.comparison dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  font-size: 12px;
}
.comparison dt {
  color: var(--muted);
}
.comparison dd {
  margin: 0;
}
.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.login-story {
  background: var(--green);
  padding: 55px 65px;
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-story h1 {
  font-size: 58px;
  line-height: 1.08;
  letter-spacing: -2px;
  max-width: 550px;
}
.login-story p {
  color: #b6cab9;
  max-width: 380px;
  font-size: 14px;
}
.login-story .eyebrow {
  color: var(--gold);
}
.login-story footer {
  font-size: 11px;
  color: #94b29e;
}
.login-form {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.login-form form {
  width: 100%;
  max-width: 350px;
}
.login-form h1 {
  font-size: 30px;
}
.login-form p {
  font-size: 13px;
}
.login-form .field {
  margin-top: 22px;
}
.login-form button {
  width: 100%;
  margin-top: 25px;
}
.login-form .help {
  font-size: 11px;
  line-height: 1.7;
  margin-top: 28px;
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: #173e32;
  color: white;
  font-size: 13px;
  padding: 14px 20px;
  border-radius: 9px;
  z-index: 10;
  box-shadow: 0 5px 30px #0002;
  display: none;
  max-width: 90vw;
}
#toast.show {
  display: block;
}
.loading {
  padding: 50px;
}
.error-text {
  color: #a1442c;
  font-size: 12px;
  line-height: 1.6;
}
.trend-row {
  display: grid;
  grid-template-columns: 150px 1fr 90px;
  gap: 15px;
  align-items: center;
  margin: 20px 0;
  font-size: 12px;
}
.bar {
  height: 9px;
  border-radius: 10px;
  background: #edf0e8;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: #b0c19a;
  border-radius: 10px;
}
.trend-row strong {
  text-align: right;
}
.checkline {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  margin: 15px 0;
}
.checkline input {
  width: 18px;
  min-height: 18px;
}
.hidden {
  display: none !important;
}
.mobile-brand {
  display: none;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  max-width: 430px;
  width: calc(100% - 32px);
  padding: 28px;
  color: var(--green);
}
dialog::backdrop {
  background: #102c24aa;
}
dialog .field {
  margin: 18px 0;
}
dialog p {
  font-size: 13px;
}
.record-count {
  font-size: 11px;
  color: var(--muted);
}
@media (min-width: 1500px) {
  .content {
    padding-top: 48px;
  }
}
@media (max-width: 1050px) {
  .sidebar {
    padding: 28px 15px;
  }
  .shell {
    grid-template-columns: 195px minmax(0, 1fr);
  }
  .content {
    padding: 28px 24px;
  }
  .topbar {
    padding: 20px 24px;
  }
  .stats {
    gap: 10px;
  }
  .stat {
    padding: 18px;
  }
  .stat .value {
    font-size: 26px;
  }
  .review-grid {
    grid-template-columns: 1fr;
  }
  .photo-panel {
    position: static;
  }
  .photo-panel img {
    max-height: 450px;
  }
  .login-story {
    padding: 40px;
  }
  .login-story h1 {
    font-size: 45px;
  }
}
@media (max-width: 700px) {
  .shell {
    display: block;
  }
  .sidebar {
    height: auto;
    position: static;
    padding: 18px 18px 10px;
  }
  .brand {
    font-size: 16px;
  }
  .brand img {
    width: 33px;
    height: 33px;
  }
  .brand small {
    font-size: 8px;
  }
  .sidebar > .eyebrow,
  .sidebar-bottom {
    display: none;
  }
  /* Menu wraps into a grid so every page is visible without sideways scrolling. */
  .nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 14px;
    gap: 4px;
  }
  .nav button {
    padding: 8px 6px;
    min-height: 42px;
    font-size: 11px;
    justify-content: center;
    text-align: center;
    line-height: 1.2;
    gap: 6px;
  }
  .nav span {
    font-size: 14px;
  }
  .topbar {
    padding: 13px 18px;
    font-size: 10px;
  }
  .topbar strong {
    font-size: 11px;
  }
  .content {
    padding: 25px 16px;
  }
  .heading {
    align-items: flex-start;
    gap: 12px;
  }
  .heading h1 {
    font-size: 27px;
  }
  .heading p {
    font-size: 12px;
  }
  .heading button {
    padding: 10px 12px;
    white-space: nowrap;
    font-size: 11px;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .stat {
    padding: 18px;
  }
  .stat .label {
    font-size: 10px;
    margin-bottom: 12px;
  }
  .stat .value {
    font-size: 28px;
  }
  .stat .foot {
    font-size: 9px;
  }
  .filters {
    grid-template-columns: 1fr 1fr;
  }
  .filters.report {
    grid-template-columns: 1fr 1fr;
  }
  .panel-head,
  .panel-body {
    padding: 18px;
  }
  .panel-head {
    flex-wrap: wrap;
  }
  .review-grid {
    display: block;
  }
  .form-section,
  .submit-bar {
    padding: 18px;
  }
  .field-grid {
    gap: 14px;
  }
  .field label {
    font-size: 11px;
  }
  .comparison {
    grid-template-columns: 1fr;
  }
  .login {
    display: block;
  }
  .login-story {
    padding: 25px;
  }
  .login-story .eyebrow {
    margin-top: 28px;
  }
  .login-story h1 {
    font-size: 36px;
    margin: 10px 0 15px;
  }
  .login-story p {
    margin-bottom: 10px;
    font-size: 12px;
  }
  .login-story footer {
    display: none;
  }
  .login-form {
    padding: 32px 24px;
  }
  .steps {
    gap: 12px;
    font-size: 10px;
  }
  .trend-row {
    grid-template-columns: 100px 1fr 70px;
    gap: 10px;
    font-size: 11px;
  }
  td,
  th {
    padding: 15px;
  }
  .photo-panel img {
    max-height: 400px;
  }
}

/* ── Smart typing ── */
.field.auto input {
  background: #eef0e8;
  color: #3e5149;
  border-style: dashed;
}
.field .hint {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  margin-left: 4px;
}
.field input:not([readonly]):not([disabled]) {
  background: #fff;
}
button.mini {
  padding: 3px 10px;
  font-size: 0.78rem;
  margin-left: 8px;
  vertical-align: middle;
}

/* ── Sites & vehicles / team ── */
.setup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
}
.inline-add {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.inline-add input {
  flex: 1;
  min-width: 0;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 4px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-weight: 500;
}
.chip input {
  width: auto;
  margin: 0;
}
td small {
  display: block;
  color: var(--muted);
}
.chip input {
  min-height: 0;
  padding: 0;
  width: 16px;
  height: 16px;
}
form.panel-body > p.muted,
#carry-note {
  font-size: 13px;
}

/* Install-as-app banner */
.install-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  margin: 16px 32px 0;
  padding: 14px 18px;
  background: #edf3ea;
  border: 1px solid #d3e0cc;
  border-radius: 8px;
  color: #3d5636;
  font-size: 13px;
  line-height: 1.5;
}
.install-banner strong {
  color: var(--green);
}
.install-banner > span {
  flex: 1 1 220px;
}
.install-banner .actions {
  margin: 0;
}
@media (max-width: 700px) {
  .install-banner {
    margin: 12px 16px 0;
  }
  .install-banner > strong {
    flex-basis: 100%;
  }
}

/* ── Paging ── */
.load-more {
  padding: 16px;
  text-align: center;
  border-top: 1px solid var(--line);
}
.filters input[type='search'] {
  -webkit-appearance: none;
  appearance: none;
}

/* ── Folding parts of the log form ── */
.more-fields {
  margin-top: 14px;
}
.more-fields > summary,
.averages > summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  list-style-position: inside;
}
.more-fields > summary {
  padding: 8px 0;
}
.more-fields[open] > summary {
  margin-bottom: 12px;
}
.averages > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}
.averages > summary h3 {
  display: inline;
  margin: 0;
}
.averages[open] > summary {
  margin-bottom: 14px;
}

/* ── Tables become cards on phones ── */
@media (max-width: 700px) {
  .table-wrap.cards {
    overflow: visible;
  }
  .table-wrap.cards table {
    white-space: normal;
  }
  .table-wrap.cards table,
  .table-wrap.cards tbody,
  .table-wrap.cards tr,
  .table-wrap.cards td {
    display: block;
    width: auto;
  }
  .table-wrap.cards thead {
    display: none;
  }
  .table-wrap.cards tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 14px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
  }
  .table-wrap.cards td {
    padding: 0;
    border: 0;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .table-wrap.cards td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 2px;
  }
  .table-wrap.cards .title-cell,
  .table-wrap.cards .action-cell {
    grid-column: 1 / -1;
  }
  .table-wrap.cards .title-cell strong {
    font-size: 15px;
  }
  .table-wrap.cards .select-cell {
    grid-column: 1 / -1;
    order: -1;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .table-wrap.cards .select-cell::before {
    margin: 0;
    white-space: nowrap;
  }
  .table-wrap.cards .select-cell input {
    width: 20px;
    height: 20px;
    min-height: 0;
    padding: 0;
    margin: 0;
    flex: none;
  }
  .table-wrap.cards .action-cell .actions {
    flex-wrap: wrap;
  }
  .table-wrap.cards .action-cell button {
    flex: 1 1 auto;
  }
  .install-banner > strong {
    flex-basis: 100%;
  }
}
