:root {
  font-family: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  color: #192b26;
  background: #f3f5f1;
  font-size: 15px;
  line-height: 1.45;
  --forest: #15312c;
  --muted: #51625a;
  --line: #dce4dc;
  --accent: #cce588;
}

* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(2rem, 4vw, 3.2rem); letter-spacing: -.055em; line-height: 1.04; }
h2 { margin-bottom: 0; font-size: 1.12rem; letter-spacing: -.025em; }

button, .button, input, textarea, select { font: inherit; }
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.55rem;
  border: 1px solid #cbd8ce;
  border-radius: .55rem;
  padding: .42rem .8rem;
  color: var(--forest);
  background: white;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
button:hover, .button:hover { background: #eaf0e9; }
button:disabled { opacity: .55; cursor: wait; }
:focus-visible { outline: 2px solid #597536; outline-offset: 3px; }
.primary { background: var(--forest); color: white; border-color: var(--forest); }
.primary:hover { background: #285047; }

.shell { display: grid; grid-template-columns: 15.25rem minmax(0, 1fr); min-height: 100vh; }
aside { padding: 1.4rem 1.1rem; background: var(--forest); color: #f7f9f5; display: flex; flex-direction: column; gap: 2.65rem; }
.brand { display: flex; align-items: center; gap: .7rem; font-size: 1.04rem; font-weight: 750; letter-spacing: -.025em; }
.mark { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: .6rem; background: var(--accent); color: var(--forest); }
nav { display: grid; gap: .35rem; }
nav button, .account button { justify-content: flex-start; background: transparent; color: #e2ebe2; border-color: transparent; }
nav button:hover, .account button:hover { background: #25463e; }
nav button[aria-current] { background: #d2eaa1; color: var(--forest); }
.account { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: .4rem; margin-top: auto; padding-top: .9rem; border-top: 1px solid #567166; }
.account span { overflow-wrap: anywhere; }
.account button { padding-inline: .45rem; }

.workspace { width: 100%; max-width: 90rem; margin-inline: auto; padding: 2rem clamp(1rem, 3.7vw, 4rem) 3rem; }
header { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.7rem; }
.date { color: var(--muted); font-variant-numeric: tabular-nums; margin-bottom: .5rem; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; margin-bottom: 1.25rem; }
.metric { display: grid; align-content: space-between; gap: 1rem; border: 1px solid var(--line); border-radius: .9rem; background: white; padding: 1rem 1.15rem; }
.metric strong { font-size: 2.5rem; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.07em; }
.metric.green { background: #e5eedb; }
.metric.amber { background: #faf0db; }
.metric.red { background: #f5e5e2; }
.panel { background: white; border: 1px solid var(--line); border-radius: .9rem; margin-bottom: 1.25rem; overflow: hidden; }
.panel h2 { padding: 1rem 1.2rem; }
.journal-directory td { padding-block: .25rem; }
.journal-directory th:first-child { width: 10rem; }
.journal-directory .journal-category th { width: auto; color: var(--forest); }
.journal-link { justify-content: flex-start; border: 0; padding-inline: .4rem; text-align: left; color: #225846; background: transparent; }
.journal-link:hover { text-decoration: underline; }
.form-code, .journal-date { white-space: nowrap; font-variant-numeric: tabular-nums; }
.filters .form-code { align-self: center; color: var(--muted); font-weight: 650; }
.journal-scroll:focus-visible { outline-offset: -2px; }
.journal-table { min-width: max-content; }
.journal-table th, .journal-table td { max-width: 15rem; overflow-wrap: anywhere; }
.journal-table td { vertical-align: top; }
.journal-table .journal-empty { padding-block: 1.5rem; color: var(--muted); }
.journal-problem td { background: #fbefed; }
.admin-sections { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.admin-sections button { color: var(--forest); background: white; border-color: var(--line); }
.admin-sections button:hover { background: #edf4ef; }
.admin-sections button[aria-current="page"] { background: var(--forest); color: white; border-color: var(--forest); }
.admin-record-filters > label { min-width: 0; }
.admin-record-filters select { max-width: 36rem; }
.admin-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; padding: .9rem 1.2rem; color: var(--muted); border-top: 1px solid var(--line); }
.danger { color: #842b29; }
.production-long-text { white-space: pre-wrap; margin-top: .45rem; }
.print-label { display: grid; gap: .3rem; width: fit-content; padding: .9rem; border: 1px solid currentColor; }
.print-label strong { font-size: 1.2rem; }
.print-document { width: 100%; }
.print-document dl { margin: .5rem 0; }
.print-document dl > div { margin: 0 0 .65rem; break-inside: avoid; }
.print-document dt { font-weight: 650; }
.print-document dd { margin: .15rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
@media print {
  body:has(.print-label) #app, dialog:has(.print-label) .dialog-head,
  dialog:has(.print-label) .dialog-actions, #print-label { display: none; }
  dialog:has(.print-label) { position: static; max-width: none; max-height: none; overflow: visible; width: auto; margin: 0; padding: 0; border: 0; }
  .print-document { padding: 0; border: 0; }
  dialog:has(.print-label)::backdrop { display: none; }
}
.section-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding-right: 1rem; }
.section-head small { margin-top: .25rem; font-weight: 500; }
.empty { border-top: 1px solid var(--line); padding: 2.1rem 1.2rem; color: var(--muted); }
.empty p:last-child { margin-bottom: 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; text-align: left; border-collapse: collapse; }
td, th { padding: .8rem 1.05rem; border-top: 1px solid var(--line); vertical-align: middle; }
th { background: #f6f8f5; color: var(--muted); font-weight: 600; font-size: .88rem; }
td strong { overflow-wrap: anywhere; }
small { display: block; color: var(--muted); }
.table-action { white-space: nowrap; }
.actions { display: flex; flex-wrap: wrap; gap: .35rem; }
.badge { display: inline-block; border-radius: 1rem; padding: .18rem .62rem; font-size: .83rem; font-weight: 650; white-space: nowrap; }
.pending { background: #edf1ef; color: #44534e; }
.done { background: #e3efda; color: #2b532f; }
.late { background: #f9eccb; color: #65471a; }
.issue { background: #f6e4e1; color: #83352f; }
.issue-text, [role=alert] { color: #862e2a; }
[role=alert]:empty { display: none; }
.muted { color: var(--muted); }

label { display: grid; gap: .3rem; color: #32443b; font-weight: 600; }
input, textarea, select {
  width: 100%;
  min-width: 0;
  min-height: 2.55rem;
  padding: .42rem .62rem;
  border-radius: .45rem;
  border: 1px solid #bfcfc2;
  color: #142922;
  background: white;
  font-weight: 400;
}
textarea { min-height: 5rem; resize: vertical; }
.filters { display: flex; flex-wrap: wrap; gap: .8rem; align-items: end; padding: 1rem 1.15rem; }
.filters label { min-width: 9rem; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: #e7ede3; }
.login-card { width: min(100%, 24rem); padding: 1.6rem; background: white; border: 1px solid var(--line); border-radius: 1rem; }
.login-card h1 { margin: 1.65rem 0 1.05rem; }
.login-card form, dialog form { display: grid; gap: .85rem; }
dialog { border: 1px solid var(--line); border-radius: 1rem; padding: 1.2rem; width: min(36rem, calc(100% - 1.5rem)); color: inherit; }
dialog::backdrop { background: #102a24a3; }
.dialog-head, .dialog-actions { display: flex; align-items: center; gap: .6rem; }
.dialog-head { justify-content: space-between; margin-bottom: .8rem; }
.dialog-head h2 { font-size: 1.3rem; overflow-wrap: anywhere; }
.dialog-actions { justify-content: flex-end; flex-wrap: wrap; }
dialog p { margin: 0; overflow-wrap: anywhere; }
.receipt-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin: .25rem 0; }
.receipt-details dt { font-size: .85rem; color: var(--muted); }
.receipt-details dd { margin: .12rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.check-hint { padding: .65rem .75rem; border-radius: .45rem; background: #e5eedb; }
.check-label { display: flex; align-items: center; gap: .5rem; }
.check-label input { width: 1rem; min-height: 1rem; accent-color: var(--forest); }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
fieldset { margin: 0; border: 1px solid var(--line); border-radius: .45rem; }
.weekdays { display: flex; flex-wrap: wrap; gap: .8rem; }
.weekdays label { display: flex; align-items: center; gap: .3rem; }
.weekdays input { width: 1rem; min-height: 1rem; accent-color: var(--forest); margin: 0; }

@media (max-width: 960px) {
  .shell { grid-template-columns: 12rem minmax(0, 1fr); }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 660px) {
  .shell { display: block; }
  aside { display: grid; gap: .6rem; padding: .8rem 1rem; grid-template-columns: 1fr auto; }
  nav { display: flex; flex-wrap: wrap; grid-row: 2; grid-column: 1 / -1; }
  .account { border: 0; margin-top: 0; padding: 0; justify-content: flex-end; }
  .account span { display: none; }
  .workspace { padding-top: 1.3rem; }
  .metric { padding: .8rem; }
  header { align-items: start; flex-wrap: wrap; }
  th, td { padding: .68rem .7rem; }
}
