:root {
  --ink: #183028;
  --muted: #66756f;
  --line: #dfe7e3;
  --paper: #fff;
  --wash: #f3f7f5;
  --brand: #0b7153;
  --brand-dark: #07563f;
  --accent: #e8b94e;
  --danger: #a33c3c;
  --shadow: 0 16px 40px rgba(24, 48, 40, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--wash);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--wash); }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, .button { cursor: pointer; }
.shell { min-height: 100vh; }
.app-page .shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 28px 22px; color: #fff; background: linear-gradient(165deg, #0a644a, #123e35); }
.brand { display: flex; flex-direction: column; gap: 3px; margin-bottom: 34px; font-size: 22px; font-weight: 800; text-decoration: none; letter-spacing: -.02em; }
.brand span { color: #b8d5ca; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.user-card { display: flex; flex-direction: column; padding: 15px; margin-bottom: 22px; border: 1px solid rgba(255,255,255,.14); border-radius: 14px; background: rgba(255,255,255,.07); }
.user-card small { color: #c9ddd6; margin-top: 4px; }
.sidebar nav { display: grid; gap: 5px; }
.sidebar nav a, .logout { padding: 11px 13px; border-radius: 9px; color: #e9f4f0; text-decoration: none; font-weight: 650; }
.sidebar nav a:hover, .logout:hover { background: rgba(255,255,255,.1); }
.logout { margin-top: auto; }
.main { width: min(1280px, 100%); margin: 0 auto; padding: 38px clamp(22px, 4vw, 58px) 72px; }
.login-page { background: radial-gradient(circle at top left, #d5eee4, transparent 45%), linear-gradient(135deg, #f6faf8, #e6f0ec); }
.login-page .shell { display: grid; place-items: center; padding: 28px; }
.login-page .main { width: 100%; max-width: 480px; padding: 0; }
.login-card { padding: clamp(30px, 6vw, 52px); border: 1px solid rgba(255,255,255,.9); border-radius: 28px; background: rgba(255,255,255,.92); box-shadow: 0 30px 90px rgba(7, 86, 63, .16); backdrop-filter: blur(14px); }
.login-mark { display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 28px; border-radius: 17px; color: #fff; background: var(--brand); font-weight: 900; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 9px; font-size: clamp(31px, 4vw, 48px); line-height: 1.06; letter-spacing: -.04em; }
h2 { letter-spacing: -.025em; }
h3 { margin-bottom: 7px; font-size: 18px; }
p { line-height: 1.55; }
.eyebrow { margin-bottom: 8px; color: var(--brand); font-size: 12px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.muted, small { color: var(--muted); }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.page-heading p { max-width: 700px; color: var(--muted); }
.back-link { display: inline-block; margin-bottom: 16px; color: var(--brand); font-weight: 700; text-decoration: none; }
.panel, .progress-card, .task-card, .resource-card, .worker-card { border: 1px solid var(--line); border-radius: 18px; background: var(--paper); box-shadow: var(--shadow); }
.panel { padding: 24px; margin-bottom: 24px; }
.panel.narrow { max-width: 720px; }
.stack { display: grid; gap: 17px; }
label { display: grid; gap: 7px; font-size: 13px; font-weight: 750; }
label small { font-weight: 500; }
input, select, textarea { width: 100%; padding: 11px 12px; border: 1px solid #cdd9d4; border-radius: 9px; color: var(--ink); background: #fff; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(11,113,83,.12); }
textarea { resize: vertical; }
fieldset { padding: 15px; border: 1px solid var(--line); border-radius: 12px; }
legend { padding: 0 6px; font-weight: 800; }
.button { display: inline-flex; align-items: center; justify-content: center; width: fit-content; min-height: 42px; padding: 9px 16px; border: 1px solid #c8d6d0; border-radius: 10px; color: var(--ink); background: #fff; font-weight: 750; text-decoration: none; }
.button:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(24,48,40,.1); }
.button.primary { border-color: var(--brand); color: #fff; background: var(--brand); }
.button.primary:hover { background: var(--brand-dark); }
.button.small { min-height: 36px; padding: 7px 12px; font-size: 13px; }
.button.wide { width: 100%; }
.button.danger-text { color: var(--danger); }
.text-button { padding: 0; border: 0; color: var(--brand); background: none; font-weight: 750; }
.icon-button { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--wash); font-size: 22px; }
.flash { padding: 14px 16px; margin-bottom: 20px; border-radius: 11px; border-left: 4px solid; background: #fff; box-shadow: var(--shadow); }
.flash-success { border-color: #1b8a5a; }
.flash-error { border-color: var(--danger); }
.flash-warning { border-color: #c38b17; }
.badge { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: 999px; color: #51635c; background: #edf2f0; font-size: 12px; font-weight: 800; text-transform: capitalize; white-space: nowrap; }
.badge-approved, .badge-completed, .badge-active { color: #11663f; background: #ddf3e7; }
.badge-rejected { color: #8d2d2d; background: #f9e2e2; }
.badge-submitted, .badge-uploaded { color: #815c0d; background: #fff1c9; }
.badge-archived { color: #5e6260; background: #e9eceb; }
.progress-card { display: grid; gap: 15px; padding: 20px 24px; margin-bottom: 32px; }
.progress-card > div:first-child { display: flex; justify-content: space-between; gap: 20px; }
.progress-card span { color: var(--muted); }
.progress { height: 9px; overflow: hidden; border-radius: 999px; background: #e8efec; }
.progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), #31a97d); }
.task-section { margin-bottom: 36px; }
.section-heading { margin-bottom: 14px; }
.section-heading h2 { margin-bottom: 5px; }
.section-heading p { color: var(--muted); }
.task-list { display: grid; gap: 14px; }
.task-card { padding: 20px; }
.task-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.task-top p { margin-bottom: 8px; color: var(--muted); }
.task-section-label { display: block; margin-bottom: 6px; color: var(--brand); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.text-link { display: inline-block; margin: 4px 0 14px; color: var(--brand); font-weight: 750; }
.callout { padding: 13px 15px; margin: 12px 0; border-radius: 10px; background: #f3f7f5; }
.callout p { margin: 4px 0 0; }
.callout.danger { color: #792b2b; background: #fff0f0; }
.file-count { margin-bottom: 10px; color: var(--muted); font-size: 13px; }
.upload-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.upload-row input { flex: 1; }
.submit-panel { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.submit-panel h2, .submit-panel p { margin-bottom: 4px; }
.resource-grid, .worker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 30px; }
.resource-card, .worker-card { display: flex; flex-direction: column; justify-content: space-between; gap: 20px; min-height: 180px; padding: 21px; }
.resource-card h2, .worker-card h2 { margin-bottom: 6px; font-size: 19px; }
.resource-card p, .worker-card p { color: var(--muted); }
.worker-card { color: inherit; text-decoration: none; }
.worker-card:hover { transform: translateY(-2px); border-color: #b9cec5; }
.worker-card dl { display: grid; gap: 8px; margin: 0; }
.worker-card dl div { display: flex; justify-content: space-between; gap: 12px; }
.worker-card dt { color: var(--muted); }
.worker-card dd { margin: 0; font-weight: 700; text-align: right; }
.empty-state { grid-column: 1 / -1; padding: 42px; border: 2px dashed #cddbd5; border-radius: 18px; text-align: center; }
.empty-state p { color: var(--muted); }
.admin-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.sticky { position: sticky; top: 24px; }
.review-form { display: grid; grid-template-columns: 150px 160px 1fr auto; gap: 10px; align-items: end; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.document-row { display: flex; justify-content: space-between; gap: 18px; padding: 10px 12px; margin-top: 7px; border-radius: 8px; color: var(--brand); background: var(--wash); font-size: 13px; font-weight: 700; text-decoration: none; }
.divider { height: 1px; margin: 20px 0; background: var(--line); }
.note { padding: 13px 0; border-bottom: 1px solid var(--line); }
.note:last-child { border-bottom: 0; }
.note p { margin-bottom: 6px; }
.checklist { display: grid; gap: 8px; }
.checklist-item { display: flex; grid-template-columns: none; flex-direction: row; align-items: center; gap: 12px; padding: 10px; border-radius: 9px; }
.checklist-item:hover { background: var(--wash); }
.checklist-item button { flex: 0 0 28px; width: 28px; height: 28px; border: 2px solid #b7c8c1; border-radius: 8px; color: #fff; background: #fff; }
.checklist-item span { display: flex; flex-direction: column; }
.checklist-item.is-complete button { border-color: var(--brand); background: var(--brand); }
.checklist-item.is-complete strong { color: var(--muted); text-decoration: line-through; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 11px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
td strong, td small { display: block; }
.action-cell { display: flex; gap: 12px; }
.check-row, .check-grid { display: flex; flex-wrap: wrap; gap: 12px 20px; }
.check-row label, .check-grid label, .check-label { display: flex; grid-template-columns: none; flex-direction: row; align-items: center; font-weight: 600; }
.check-row input, .check-grid input, .check-label input { width: auto; }
.invite-panel textarea { width: 100%; margin: 10px 0; }
dialog { width: min(520px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 20px; box-shadow: 0 30px 90px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(11,35,28,.55); backdrop-filter: blur(3px); }
.dialog-card { padding: 26px; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; }
.dialog-heading h2 { margin: 0; }

@media (max-width: 920px) {
  .app-page .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 18px; }
  .sidebar .brand { margin-bottom: 15px; }
  .user-card { display: none; }
  .sidebar nav { display: flex; overflow-x: auto; }
  .logout { position: absolute; top: 18px; right: 18px; }
  .admin-layout { grid-template-columns: 1fr; }
  .sticky { position: static; }
  .review-form { grid-template-columns: 1fr 1fr; }
  .review-form .wide-field { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  .main { padding: 25px 16px 55px; }
  .page-heading, .submit-panel, .progress-card > div:first-child { flex-direction: column; }
  .upload-row { align-items: stretch; flex-direction: column; }
  .review-form { grid-template-columns: 1fr; }
  .review-form .wide-field { grid-column: auto; }
  .resource-grid, .worker-grid { grid-template-columns: 1fr; }
}
