:root {
  --bg: #f6f5f2;
  --card-bg: #ffffff;
  --border: #ddd8cd;
  --text: #2c2c2a;
  --text-muted: #7a7870;
  --accent: #0f6e56;
  --accent-light: #e1f5ee;
  --danger: #a32d2d;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
}
.brand { font-weight: 600; }
.userinfo { font-size: 14px; color: var(--text-muted); }
.userinfo a { color: var(--accent); text-decoration: none; }
.content { max-width: 720px; margin: 32px auto; padding: 0 16px; }
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px;
}
.card.narrow { max-width: 360px; margin: 60px auto; }
h1 { margin-top: 0; font-size: 22px; }
h2 { font-size: 16px; margin-top: 28px; }
.muted { color: var(--text-muted); font-size: 14px; }
.error { color: var(--danger); }
label { display: block; margin-bottom: 14px; font-size: 14px; }
input, select, textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}
button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}
button:hover { opacity: 0.9; }
.btn {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 6px;
  background: var(--accent-light);
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
}
.back { display: inline-block; margin-bottom: 12px; font-size: 13px; color: var(--text-muted); text-decoration: none; }
.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin: 12px 0 20px;
}
.progress-fill { height: 100%; background: var(--accent); }
.section-list { list-style: none; padding: 0; margin: 0; }
.section-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.section-row:last-child { border-bottom: none; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border); flex-shrink: 0; }
.section-row.complete .status-dot { background: var(--accent); }
.section-label { flex: 1; font-weight: 500; }
.section-status { font-size: 13px; color: var(--text-muted); width: 90px; }
.doc-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.doc-table th, .doc-table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); font-size: 14px; }
.hint { font-size: 12px; color: var(--text-muted); }
.upload-form { display: flex; gap: 16px; align-items: end; margin-bottom: 24px; flex-wrap: wrap; }
.upload-form label { margin-bottom: 0; flex: 1; min-width: 160px; }
h3 { font-size: 14px; margin: 20px 0 8px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.group-block { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.group-row {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
}
.btn-add, .btn-remove {
  background: none;
  color: var(--accent);
  border: 1px solid var(--accent-light);
  padding: 7px 14px;
  font-size: 13px;
}
.btn-remove { color: var(--danger); border-color: #f3dede; margin-top: 4px; }
.btn-save { margin-top: 20px; }
.btn-disabled { opacity: 0.5; cursor: default; pointer-events: none; }
.phase-block { margin-top: 28px; padding-top: 20px; border-top: 2px solid var(--border); }
.phase-block:first-of-type { margin-top: 20px; }
.phase-header { display: flex; justify-content: space-between; align-items: baseline; }
.phase-header h2 { margin: 0; font-size: 15px; text-transform: none; letter-spacing: normal; color: var(--text); }
.phase-status { font-size: 13px; color: var(--text-muted); }
.phase-status.locked { color: var(--danger); font-weight: 500; }
.section-count { color: var(--text-muted); font-weight: 400; }
.phase-controls { margin: 16px 0 24px; padding: 14px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; }
.phase-control-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: 13px; }
.phase-control-row form { margin: 0; }
.phase-control-row button { padding: 5px 12px; font-size: 12px; }
.group-row-label { font-weight: 600; font-size: 13px; color: var(--accent); margin-bottom: 10px; }
.navlinks { flex: 1; margin-left: 28px; }
.navlinks a { color: var(--text); text-decoration: none; font-size: 14px; margin-right: 18px; }
.navlinks a:hover { color: var(--accent); }
.flash { max-width: 720px; margin: 0 auto 16px; padding: 10px 16px; border-radius: 8px; font-size: 14px; }
.flash-ok { background: var(--accent-light); color: var(--accent); border: 1px solid var(--accent); }
.flash-error { background: #f9e9e9; color: var(--danger); border: 1px solid var(--danger); }
.card + .card { margin-top: 24px; }
.invite-link-card { border-color: var(--accent); }
.invite-url-row { display: flex; gap: 10px; align-items: center; }
.invite-url-row input { margin-top: 0; font-family: Consolas, monospace; font-size: 13px; }
.invite-url-row button { flex-shrink: 0; }
.inline-form { display: flex; gap: 16px; align-items: end; flex-wrap: wrap; }
.inline-form label { margin-bottom: 0; flex: 1; min-width: 160px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; margin-bottom: 12px; }
.table-actions { display: flex; gap: 6px; }
.table-actions form { margin: 0; }
.btn-small { padding: 4px 10px; font-size: 12px; background: var(--accent-light); color: var(--accent); border: none; border-radius: 6px; cursor: pointer; }
a.btn-small { text-decoration: none; display: inline-flex; align-items: center; line-height: 1.4; }
.btn-danger { background: #f9e9e9; color: var(--danger); }
.user-inactive td { color: var(--text-muted); text-decoration: line-through; }
.user-inactive td.table-actions { text-decoration: none; }
.ob-switcher { margin: 8px 0 16px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.ob-pill { padding: 4px 12px; border-radius: 999px; border: 1px solid var(--border); text-decoration: none; color: var(--text); font-size: 13px; }
.ob-pill.ob-active { background: var(--accent); color: #fff; border-color: var(--accent); }
.field-heading { font-size: 15px; margin: 26px 0 4px; padding-bottom: 6px; border-bottom: 2px solid var(--accent-light); text-transform: none; letter-spacing: normal; color: var(--text); }
.field-heading:first-of-type { margin-top: 8px; }
.detail-subhead { font-weight: 600; color: var(--accent); background: var(--bg); }
