:root {
    color-scheme: light;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #162d27;
    background: #f3f6f2;
    --muted: #536660;
    --border: #dbe4df;
}

* { box-sizing: border-box; }
body { margin: 0; }
h1, h2, p, dl, dd { margin: 0; }

.container {
    width: min(100% - 48px, 1060px);
    margin-inline: auto;
}

.topbar {
    color: #fff;
    background: #142e28;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 64px;
    font-size: 18px;
    font-weight: 700;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    color: #153e30;
    background: #a8e6bd;
}

main { padding-block: 52px; }

.workspace {
    color: #276749;
    font-size: 14px;
    font-weight: 650;
}

.workspace span { margin-inline: 4px; }

h1 {
    margin-block: 8px;
    font-size: clamp(32px, 5vw, 48px);
    line-height: 1.08;
    letter-spacing: -0.045em;
}

.intro > p:last-child, .panel-heading p, .department { color: var(--muted); }

.summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-block: 30px 22px;
}

.stat, .panel {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
}

.stat { padding: 18px 20px; }
.stat dt {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 650;
}

.stat dd {
    margin-top: 6px;
    color: #162d27;
    font-size: 32px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.green { color: #1d6347; }
.amber { color: #805012; }
.red { color: #9c2d27; }

.panel-heading { padding: 22px 24px; }
.panel-heading h2 { font-size: 20px; }
.panel-heading p { margin-top: 5px; font-size: 14px; }

.table-scroll { overflow-x: auto; }
.table-scroll:focus-visible { outline: 2px solid #276749; outline-offset: -2px; }

table {
    width: 100%;
    min-width: 580px;
    border-collapse: collapse;
    text-align: left;
}

th, td { padding: 13px 24px; border-top: 1px solid var(--border); }
thead th { background: #f8faf8; color: var(--muted); font-size: 13px; }
tbody { font-size: 14px; }
tbody th { font-weight: 650; }
.department { display: block; margin-top: 4px; font-size: 12px; font-weight: 400; }

.badge {
    display: inline-block;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
}

.badge.green { background: #e5f5eb; }
.badge.amber { background: #fff2d7; }
.badge.red { background: #fce9e7; }

@media (max-width: 540px) {
    .container { width: calc(100% - 32px); }
    main { padding-block: 34px; }
    .summary { gap: 8px; }
    .stat { padding: 13px 10px; }
    .stat dt { gap: 5px; font-size: 12px; }
    .stat dd { font-size: 26px; }
    .panel-heading, th, td { padding-inline: 16px; }
}

.database-notice { margin-top: 30px; }

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

button, input { font: inherit; }

.sign-out, .primary-button {
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 650;
}

.sign-out { border-color: #69847b; color: #fff; background: transparent; }
.sign-out:hover { background: #25463c; }
.primary-button { color: #fff; background: #276749; }
.primary-button:hover { background: #1d5039; }
button:focus-visible, input:focus-visible { outline: 2px solid #548c71; outline-offset: 3px; }

.login { width: min(100% - 32px, 420px); }
.login-panel { padding: clamp(22px, 5vw, 32px); }
.login h1 { font-size: 36px; }
.login form { display: grid; gap: 8px; margin-top: 20px; }
.login label { font-size: 14px; font-weight: 650; }

.login input:not([type="hidden"]) {
    width: 100%;
    min-width: 0;
    border: 1px solid #aebfb6;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    color: inherit;
}

.login-error { margin-top: 12px; color: #9c2d27; font-size: 14px; }

.brand { color: inherit; text-decoration: none; }

.app-nav { border-bottom: 1px solid var(--border); background: #fff; }
.app-nav .container { display: flex; gap: 22px; flex-wrap: wrap; }
.app-nav a { padding-block: 12px; color: var(--muted); font-size: 14px; text-decoration: none; }
.app-nav a[aria-current] { border-bottom: 2px solid #276749; color: #174d38; font-weight: 700; }

.editor { margin-block: 22px; padding: 22px 24px; }
.editor h2 { font-size: 20px; }
.inline-form { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.inline-form label { display: grid; gap: 6px; flex: 1 1 150px; font-size: 14px; font-weight: 650; }
.inline-form input:not([type="hidden"]), .inline-form select {
    width: 100%;
    min-width: 0;
    padding: 8px 10px;
    font: inherit;
    color: inherit;
    background: #fff;
    border: 1px solid #aebfb6;
    border-radius: 8px;
}

.notice { margin-top: 14px; padding: 10px 14px; border-radius: 8px; background: #e5f5eb; }
.notice.error { color: #9c2d27; background: #fce9e7; }
.row-actions { white-space: nowrap; }
.row-actions form { display: inline; margin-left: 12px; }
.row-actions a, .text-button, .inline-form a { color: #1d6347; text-decoration: underline; }
.text-button { padding: 0; color: #1d6347; background: transparent; border: 0; cursor: pointer; }

.summary { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.neutral { color: #4d5b65; }
.badge.neutral { background: #edf0f2; }
.completion-form { display: flex; gap: 6px; white-space: nowrap; }
.completion-form input { padding: 5px; border: 1px solid #aebfb6; border-radius: 8px; }

.row-actions a + a { margin-left: 12px; }
.form-help { margin-top: 6px; color: var(--muted); font-size: 14px; }
.back-link { color: #1d6347; }

.report-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.report-filters { margin: 0; padding: 0 24px 20px; }
.report-filters label { flex-basis: 125px; }

.download-button {
    display: inline-block;
    border: 1px solid #aebfb6;
    border-radius: 8px;
    padding: 8px 12px;
    color: #174d38;
    font-size: 14px;
    font-weight: 650;
    text-decoration: none;
    white-space: nowrap;
}
.download-button:hover { background: #e5f5eb; }

@media (max-width: 540px) {
    .report-filters { padding-inline: 16px; }
}
