:root {
  color-scheme: light;
  font-family: "Aptos", "Inter", system-ui, sans-serif;
  color: #222a23;
  background: #f4f5ee;
  --ink: #222a23;
  --muted: #60695d;
  --green: #315f42;
  --deep: #19382a;
  --line: #e0e3d9;
  --paper: #fffef9;
  --soft: #eef2e5;
  --focus: #926126;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .65; cursor: wait; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1 { font-family: Georgia, serif; font-size: clamp(2.2rem, 5vw, 3.35rem); font-weight: 500; letter-spacing: -.045em; line-height: 1.08; }
h2 { font-size: 1.1rem; font-weight: 670; letter-spacing: -.02em; }
h3 { font-size: .94rem; }
small { color: var(--muted); }
.layout { min-height: 100dvh; display: grid; grid-template-columns: 235px minmax(0, 1fr); }
.sidebar { display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; padding: 28px 17px 19px; background: var(--deep); color: #f3f3e8; }
.brand { display: flex; align-items: center; gap: 12px; text-align: left; }
.sidebar .brand { padding: 0 8px; }
.brand-mark { display: inline-grid; flex: 0 0 40px; place-items: center; width: 40px; height: 40px; border-radius: 13px; background: #dce8bd; color: #244431; }
.brand-mark svg { width: 25px; height: 25px; }
.brand strong { display: block; font-family: Georgia, serif; font-size: 1.72rem; line-height: .98; letter-spacing: -.055em; }
.brand strong span { color: #b6ce8a; }
.brand small { display: block; margin-top: 6px; font-size: .58rem; font-weight: 750; letter-spacing: .16em; color: #c0d0bb; }
.sidebar nav { display: grid; gap: 5px; margin-top: 48px; }
.side-title { margin: 0 0 8px 12px; color: #bcccb8; font-size: .64rem; letter-spacing: .18em; font-weight: 750; }
.sidebar nav a { border-radius: 9px; padding: 12px 13px; display: flex; gap: 12px; align-items: center; color: #dde8d9; font-size: .91rem; font-weight: 560; }
.sidebar nav a:hover, .sidebar nav a.active { background: #2b503b; color: #fff; text-decoration: none; }
.sidebar nav a.active svg { color: #dce8bd; }
.sidebar footer { margin-top: auto; border-top: 1px solid #456352; padding: 15px 4px 0; }
.identity { display: flex; align-items: center; gap: 9px; min-width: 0; }
.identity > span:last-child { min-width: 0; }
.identity strong { display: block; overflow-wrap: anywhere; font-size: .8rem; }
.identity small { display: block; color: #c0d0bb; text-transform: capitalize; margin-top: 3px; font-size: .72rem; }
.avatar { display: grid; place-items: center; min-width: 33px; height: 33px; border-radius: 50%; background: #345742; color: #e6efd4; font-size: .72rem; font-weight: bold; }
#main { width: 100%; max-width: 1440px; padding: 36px clamp(18px, 4.1vw, 61px) 55px; margin: 0 auto; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin-bottom: 26px; }
.page-head p:last-child { color: var(--muted); margin-top: 9px; line-height: 1.45; }
.eyebrow { display: flex; align-items: center; gap: 7px; color: var(--green); font-size: .77rem; font-weight: 700; margin-bottom: 10px; }
.eyebrow svg { width: 15px; height: 15px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 8px; padding: 10px 14px; font-weight: 650; font-size: .83rem; line-height: 1.35; white-space: nowrap; }
.button svg { width: 17px; height: 17px; }
.button:hover { text-decoration: none; }
.primary { color: white; background: var(--green); }
.primary:hover { background: #255035; }
.quiet { color: #2d5038; border-color: #d7dece; background: var(--paper); }
.quiet:hover { background: var(--soft); }
.signout { color: #ecf3e3; background: transparent; padding-left: 0; margin-top: 4px; }
.signout:hover { text-decoration: underline; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--paper); padding: 16px; border: 1px solid var(--line); border-radius: 11px; display: grid; gap: 7px; min-width: 0; }
.stat > div { display: flex; align-items: center; justify-content: space-between; gap: 4px; color: #475246; font-weight: 650; font-size: .78rem; }
.stat > strong { font-family: Georgia, serif; font-weight: 500; font-size: 2.35rem; line-height: 1; color: var(--deep); }
.stat > small { font-size: .71rem; }
.action-icon { display: inline-grid; flex: 0 0 35px; width: 35px; height: 35px; place-items: center; border-radius: 9px; background: var(--soft); color: var(--green); }
.action-icon svg { width: 18px; height: 18px; }
.overview-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 18px; }
.settings-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 18px; align-items: start; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 18px; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 17px 19px 13px; }
.panel-head a { font-size: .78rem; font-weight: 700; display: flex; align-items: center; gap: 4px; }
.panel-head a svg { width: 15px; height: 15px; }
.divided { border-top: 1px solid var(--line); }
.actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); padding: 0 15px 15px; gap: 7px; }
.quick-action { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; text-align: left; background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 9px; padding: 9px; min-width: 0; }
.quick-action:hover { border-color: #9bb493; background: #f8f9f3; }
.quick-action strong, .quick-action small { display: block; }
.quick-action strong { font-size: .79rem; }
.quick-action small { margin-top: 3px; font-size: .7rem; line-height: 1.3; }
.quick-action > svg { width: 14px; height: 14px; color: var(--green); }
.empty { padding: 17px 20px 22px; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .84rem; }
.empty svg { color: #698161; flex: 0 0 20px; }
.review-list { padding: 0 17px 12px; }
.review-list > * { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); color: var(--green); font-size: .83rem; padding: 9px 2px; }
.review-list > * > span:first-child { display: flex; gap: 6px; align-items: center; }
.review-list svg { width: 16px; height: 16px; }
.badge { display: inline-block; padding: 4px 8px; border-radius: 12px; white-space: nowrap; background: #edf0ed; color: #3b493b; font-size: .71rem; font-weight: 670; }
.badge.good { background: #e6f0db; color: #315329; }
.badge.warn { background: #faecd9; color: #774315; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: .83rem; }
th { background: #f1f3eb; color: #495648; font-size: .7rem; font-weight: 750; white-space: nowrap; }
th, td { padding: 9px 16px; line-height: 1.4; border-top: 1px solid var(--line); }
td { min-width: 95px; overflow-wrap: anywhere; }
.record-link { font-weight: 750; }
.subline { display: block; font-size: .72rem; }
.toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 14px; padding: 16px; }
.toolbar label:first-child { flex: 1 1 230px; }
.toolbar label { flex: 0 1 155px; }
#report-day { max-width: 270px; }
label { display: grid; gap: 6px; min-width: 0; font-size: .79rem; font-weight: 650; color: #3e4b3d; }
input, select, textarea { display: block; width: 100%; min-width: 0; padding: 9px 10px; border-radius: 7px; border: 1px solid #ccd4c7; background: white; color: var(--ink); font-size: .9rem; }
textarea { resize: vertical; }
.details-grid { display: grid; margin: 0; padding: 6px 20px 18px; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 17px; }
.details-grid dt { font-size: .73rem; color: var(--muted); }
.details-grid dd { margin: 5px 0 0; font-weight: 625; font-size: .86rem; overflow-wrap: anywhere; }
.panel-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 13px 18px; border-top: 1px solid var(--line); }
.back { display: inline-block; margin-bottom: 11px; font-size: .83rem; font-weight: 650; }
.report-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .78rem; color: var(--muted); }
.report-notes { padding: 16px 19px 0; border-top: 1px solid var(--line); }
.report-notes > p { font-size: .85rem; padding: 8px 0 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.report-notes .panel-actions { margin: 0 -19px; }
.loading { max-width: 700px; margin: 25px auto; padding: 20px; color: var(--muted); }
.auth-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .95fr); min-height: 100dvh; }
.auth-brand { position: relative; overflow: hidden; background: var(--deep); color: #f3f3e8; display: flex; flex-direction: column; justify-content: space-between; min-height: 550px; padding: clamp(28px, 6vw, 76px); isolation: isolate; }
.auth-brand h1 { max-width: 470px; font-size: clamp(2.75rem, 5.6vw, 6rem); }
.auth-brand p { color: #d5dfcc; font-size: 1.05rem; max-width: 390px; margin-top: 18px; }
.auth-brand > small { color: #c0d0bb; }
.terrain { position: absolute; z-index: -1; width: 160%; height: 78%; left: 9%; bottom: -46%; transform: rotate(-19deg); border-radius: 50%; border: 1px solid #597354; box-shadow: 0 0 0 23px #1e3e2e, 0 0 0 24px #536e50, 0 0 0 49px #264633, 0 0 0 50px #597355, 0 0 0 80px #2b4b35, 0 0 0 81px #627e58, 0 0 0 119px #2c4d39; }
.auth-main { display: grid; place-items: center; padding: 24px; }
.auth-card { max-width: 385px; width: 100%; }
.auth-card h2 { font-family: Georgia, serif; font-size: clamp(1.8rem, 3vw, 2.65rem); font-weight: 500; margin-top: 12px; }
.auth-card p { margin: 10px 0 24px; color: var(--muted); font-size: .95rem; line-height: 1.5; }
.mobile-brand { display: none; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
.form-grid .wide { grid-column: 1 / -1; }
.in-panel { padding: 0 19px 18px; }
.muted { color: var(--muted); font-size: .82rem; }
.error { color: #933121; font-size: .83rem; }
.error:empty { display: none; }
dialog { width: min(570px, calc(100% - 24px)); max-height: calc(100dvh - 24px); border: 1px solid #c6cfbf; border-radius: 13px; background: var(--paper); color: var(--ink); padding: 20px; box-shadow: 0 18px 65px #1b382c40; }
dialog::backdrop { background: #152c21a4; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; gap: 12px; }
.dialog-head h2 { font-size: 1.28rem; }
.dialog-head ~ p { color: var(--muted); margin-bottom: 14px; line-height: 1.5; }
.close { border: 0; background: var(--soft); color: var(--ink); border-radius: 6px; width: 30px; height: 30px; font-size: 1.25rem; }
.dialog-buttons { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
#toast { position: fixed; inset: auto 18px 18px auto; max-width: 320px; color: #fff; background: var(--deep); padding: 0; z-index: 5; border-radius: 9px; }
#toast.visible { padding: 10px 15px; }
#toast.toast-error { background: #813523; }
@media (max-width: 1100px) { .actions { grid-template-columns: 1fr; } }
@media (max-width: 850px) {
  .layout { grid-template-columns: 174px minmax(0,1fr); }
  .sidebar { padding-inline: 10px; }
  .stats, .details-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .settings-grid { grid-template-columns: 1fr; gap: 0; }
}
@media (max-width: 620px) {
  .layout { display: block; }
  .sidebar { position: static; height: auto; padding: 12px 11px 4px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; }
  .sidebar .brand { padding: 0; }
  .sidebar nav { grid-column: 1 / -1; grid-row: 2; margin-top: 12px; display: flex; gap: 3px; overflow-x: auto; }
  .sidebar nav a { flex: 1 0 auto; padding: 8px 5px 10px; font-size: .67rem; gap: 3px; flex-direction: column; }
  .sidebar nav svg { width: 19px; height: 19px; }
  .side-title, .identity { display: none; }
  .sidebar footer { margin: 0; padding: 0; border: none; }
  .signout { padding: 8px; }
  #main { padding: 20px 13px 36px; }
  .page-head { align-items: start; flex-direction: column; gap: 10px; margin-bottom: 17px; }
  .stats { gap: 8px; margin-bottom: 12px; }
  .stat { padding: 10px; }
  .stat .action-icon { flex-basis: 28px; width: 28px; height: 28px; }
  .stat > strong { font-size: 1.95rem; }
  .overview-grid { grid-template-columns: 1fr; gap: 0; }
  .actions { grid-template-columns: repeat(2,minmax(0,1fr)); padding-inline: 9px; }
  .quick-action { grid-template-columns: auto minmax(0,1fr); }
  .quick-action > svg { display: none; }
  .quick-action .action-icon { flex-basis: 26px; width: 26px; height: 26px; }
  .quick-action .action-icon svg { width: 15px; height: 15px; }
  .auth-layout { display: block; }
  .auth-main { min-height: 100dvh; }
  .auth-brand { display: none; }
  .mobile-brand { display: block; padding-bottom: 27px; }
  .mobile-brand .brand small { color: var(--muted); }
  .mobile-brand .brand strong span { color: var(--green); }
  th, td { padding-inline: 10px; }
  input, select, textarea { font-size: 16px; }
}
@media (max-width: 350px) { .actions { grid-template-columns: minmax(0,1fr); } }
