:root {
  color-scheme: light;
  --ink: #192822;
  --muted: #56655d;
  --line: #dfe6df;
  --paper: #fff;
  --background: #f4f7f2;
  --green: #275843;
  --pale: #e5f0e6;
  --amber: #79470f;
  --shadow: 0 2px 3px #18272307;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--background);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, select, input { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; }
button:disabled { cursor: default; opacity: .55; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #598b73; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2.35rem, 6vw, 4.25rem); font-weight: 650; letter-spacing: -.07em; line-height: 1.05; }
h2 { font-size: 1.3rem; letter-spacing: -.03em; }
h3 { font-size: 1.08rem; letter-spacing: -.02em; }
svg { display: block; width: 1.15rem; height: 1.15rem; flex-shrink: 0; }
.topbar { background: #182723; color: #f6fbf5; }
.top-inner { min-height: 68px; max-width: 1376px; margin: auto; padding: 0 36px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.brand { text-decoration: none; display: flex; gap: 11px; align-items: center; font-weight: 670; letter-spacing: -.025em; }
.brand-icon { display: grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0; background: #c5e1b9; border-radius: 9px; color: var(--ink); }
.top-actions { display: flex; gap: 8px; }
.top-button { display: inline-flex; align-items: center; gap: 7px; color: inherit; border: 1px solid #5a6a64; background: transparent; border-radius: 8px; min-height: 42px; padding: 0 12px; font-size: .875rem; }
.top-button:hover { background: #354740; }
.workspace { max-width: 1376px; margin: auto; min-height: calc(100vh - 68px); display: grid; grid-template-columns: 222px minmax(0, 1fr); }
aside { border-right: 1px solid var(--line); padding: 36px 20px 36px 36px; }
aside label, .eyebrow { display: block; color: var(--green); font-size: .875rem; font-weight: 700; margin-bottom: 8px; }
aside select { width: 100%; }
select { appearance: none; padding: 9px 34px 9px 12px; background: var(--paper); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='m3 5 4 4 4-4' fill='none' stroke='%2356655d' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); background-position: right 11px center; background-repeat: no-repeat; color: var(--ink); border: 1px solid #ccd8ce; border-radius: 8px; min-height: 44px; }
nav { display: grid; gap: 3px; margin-top: 22px; }
.month-button { display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 0; background: transparent; color: var(--muted); min-height: 39px; padding: 0 12px; border-radius: 8px; text-align: left; }
.month-button:hover { background: #edf1ec; }
.month-button[aria-current="date"] { background: #deebdf; color: #204d39; font-weight: 700; }
.month-count { font-variant-numeric: tabular-nums; font-size: .8125rem; }
.mobile-month { display: none; }
main { display: grid; align-content: start; gap: 28px; min-width: 0; padding: 33px 36px 48px; }
.heading, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 13px; }
.heading { align-items: end; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 9px 13px; border: 1px solid #ccd8ce; border-radius: 8px; background: var(--paper); color: var(--ink); font-size: .875rem; font-weight: 650; text-align: center; }
.button:not(:disabled):hover { background: #f0f4ef; }
.primary { background: var(--green); color: white; border-color: var(--green); }
.primary:not(:disabled):hover { background: #1d4735; }
.danger { color: #992e2a; }
.summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric, .workflow, .doc-list, .empty { background: var(--paper); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow); }
.metric { padding: 13px 15px; }
.metric-label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .875rem; }
.metric-label svg { color: var(--green); width: 1rem; height: 1rem; }
.metric strong { display: block; margin-top: 5px; font-size: 1.8rem; font-weight: 650; line-height: 1.15; }
.workflows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 12px; }
.workflow { min-width: 0; overflow: hidden; display: flex; flex-direction: column; }
.workflow-head { display: flex; align-items: flex-start; gap: 11px; padding: 15px; background: #eef5ed; border-bottom: 1px solid var(--line); }
.workflow.daniel .workflow-head { background: #eef0f8; }
.workflow-head p { color: var(--muted); font-size: .875rem; margin-top: 3px; }
.workflow-icon { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 9px; background: #dceadd; color: var(--green); flex-shrink: 0; }
.daniel .workflow-icon { color: #494c76; background: #e0e4f4; }
.checklist { list-style: none; margin: 0; padding: 5px 15px; flex: 1; }
.checklist li { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 43px; padding: 3px 0; font-size: .875rem; }
.checklist li + li { border-top: 1px solid var(--line); }
.slot-action, .text-button { background: transparent; color: var(--green); border: 0; font-size: .875rem; font-weight: 650; padding: 6px; min-height: 36px; text-decoration: underline; text-underline-offset: 3px; }
.slot-action:hover, .text-button:hover { color: #0b3523; }
.workflow-foot { border-top: 1px solid var(--line); padding: 11px 15px; display: grid; gap: 9px; }
.workflow-foot p { font-size: .875rem; color: var(--muted); }
.workflow-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.docs { min-width: 0; }
.docs .section-heading { margin-bottom: 12px; }
.section-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.section-heading select { font-size: .875rem; }
.doc-list { list-style: none; padding: 0; margin: 0; }
.doc-row { padding: 10px 13px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(115px, 145px) auto; align-items: center; gap: 12px; }
.doc-row + .doc-row { border-top: 1px solid var(--line); }
.doc-title { display: flex; gap: 9px; align-items: center; overflow-wrap: anywhere; font-weight: 650; }
.doc-title svg { color: var(--green); }
.doc-meta { margin-left: 27px; font-size: .875rem; color: var(--muted); overflow-wrap: anywhere; }
.doc-actions { display: flex; gap: 5px; }
.icon-button { display: grid; place-items: center; padding: 0; min-width: 44px; min-height: 44px; border-radius: 8px; border: 0; background: transparent; color: var(--green); }
.icon-button:hover { background: var(--pale); }
.status { border-radius: 7px; background: #eef1ed; color: #4b5d50; font-size: .875rem; font-weight: 650; padding: 6px 8px; display: inline-block; border: 0; text-align: left; }
button.status { min-height: 44px; }
button.status:hover { box-shadow: inset 0 0 0 1px currentColor; }
.status small { display: block; font-size: .8125rem; font-weight: 500; }
.status.paid, .status.sent { background: var(--pale); color: #21573c; }
.status.unpaid, .status.overdue { background: #fbefd9; color: var(--amber); }
.empty { min-height: 128px; display: grid; align-content: center; justify-items: center; text-align: center; padding: 15px; gap: 6px; color: var(--muted); }
.empty > svg { width: 25px; height: 25px; color: var(--green); }
.banner { padding: 12px; border-radius: 9px; color: #8d302a; background: #fce9e6; }
.banner.success { color: var(--green); background: var(--pale); }
dialog { color: var(--ink); border: 1px solid var(--line); border-radius: 15px; width: min(530px, calc(100% - 24px)); padding: 20px; max-height: calc(100dvh - 24px); box-shadow: 0 20px 70px #16282235; }
dialog::backdrop { background: #12221990; }
dialog form { display: grid; gap: 13px; }
.dialog-head, .dialog-actions { display: flex; justify-content: space-between; align-items: center; gap: 7px; }
.dialog-actions { justify-content: flex-end; flex-wrap: wrap; }
.dialog-actions .danger { margin-right: auto; }
dialog label { display: grid; gap: 4px; font-size: .875rem; font-weight: 650; align-content: start; }
dialog input, dialog select { width: 100%; min-width: 0; }
dialog input { min-height: 44px; border: 1px solid #ccd8ce; border-radius: 8px; padding: 8px; color: var(--ink); }
dialog input[type="file"] { font-weight: 400; }
dialog input::file-selector-button { border: 0; border-radius: 5px; padding: 5px 8px; color: var(--green); background: var(--pale); margin-right: 8px; }
.optional { display: contents; color: var(--muted); font-weight: 400; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
fieldset { border: 1px solid var(--line); border-radius: 9px; padding: 9px; margin: 0; min-width: 0; }
legend { font-size: .875rem; font-weight: 650; }
.muted, .form-error { color: var(--muted); font-size: .875rem; overflow-wrap: anywhere; }
.form-error { color: #8d302a; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 850px) {
  .top-inner { padding-inline: 20px; }
  .workspace { grid-template-columns: 175px minmax(0, 1fr); }
  aside { padding-inline: 20px 12px; }
  main { padding-inline: 20px; }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .top-inner { min-height: 60px; padding-inline: 13px; gap: 8px; }
  .brand { font-size: .9375rem; gap: 7px; }
  .workspace { display: block; }
  aside { border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 13px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; }
  aside label { margin-bottom: 0; }
  aside > select { grid-column: 1; grid-row: 2; }
  aside nav { display: none; }
  .mobile-month { display: contents; }
  .mobile-month label { grid-row: 1; grid-column: 2; }
  main { padding: 21px 13px 35px; gap: 23px; }
  .heading { flex-wrap: wrap; }
  .heading .button { margin-left: auto; }
  .workflows { grid-template-columns: 1fr; }
  .summary { gap: 8px; }
  .metric { padding: 10px; }
  .doc-row { grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
  .doc-info { grid-column: 1 / -1; }
  .doc-actions { justify-content: end; }
  .section-heading { flex-wrap: wrap; }
  .top-actions { flex-shrink: 0; gap: 4px; }
  .top-button { padding-inline: 7px; }
}
@media (max-width: 420px) {
  .heading .button { width: 100%; }
}
