:root {
  --header: #111111;
  --red: #f51b16;
  --red-dark: #b91512;
  --ink: #252525;
  --muted: #6e6863;
  --line: #e6e1da;
  --paper: #fffdf9;
  --soft: #f7f4ef;
  --inactive: #e6e1da;
  --green: #12805c;
  --teal: #237c8c;
  --gold: #d49a28;
  --blue: #3f6f8f;
  --violet: #74649b;
  --warmgray: #8a8178;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--soft);
}

button,
input,
select {
  font: inherit;
}

.topbar {
  position: relative;
  z-index: 20;
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 44px);
  color: white;
  background: var(--header);
  border-bottom: 5px solid var(--red);
}

.mobileMenuButton {
  display: none;
  grid-template-columns: 20px auto;
  grid-template-rows: repeat(3, 4px);
  align-items: center;
  gap: 6px;
  min-height: 42px;
  border: 1px solid #363636;
  border-radius: 8px;
  color: white;
  background: #1b1b1b;
  padding: 8px 10px;
  font-weight: 900;
  cursor: pointer;
}

.mobileMenuButton span {
  display: block;
  grid-column: 1;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.mobileMenuButton strong {
  grid-column: 2;
  grid-row: 1 / 4;
  margin-left: 3px;
  font-size: 0.82rem;
}

body.isLogin .mobileMenuButton {
  display: none !important;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  background: white;
  border-radius: 8px;
  padding: 4px;
}

.brand p,
.dialogHead p {
  margin: 0 0 3px;
  color: #d8d4d1;
  font-size: 0.82rem;
}

.brand h1,
.dialogHead h2 {
  margin: 0;
  font-size: clamp(1.25rem, 3vw, 1.8rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.primary {
  border: 0;
  color: white;
  background: var(--red);
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
}

.logoutButton {
  margin-left: auto;
  min-height: 38px;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  color: white;
  background: #1c1c1c;
  padding: 8px 12px;
  font-weight: 900;
  cursor: pointer;
}

.logoutButton:hover {
  border-color: var(--red);
}

main {
  width: min(1540px, 100%);
  margin: 0 auto;
  padding: 18px clamp(12px, 3vw, 30px) 38px;
}

.isHidden {
  display: none !important;
}

.loginPage {
  min-height: calc(100vh - 138px);
  display: grid;
  place-items: center;
  padding: clamp(22px, 7vw, 72px) 0;
}

.loginCard {
  width: min(448px, 100%);
  display: grid;
  gap: 20px;
  padding: clamp(24px, 5vw, 34px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 18px 52px rgba(17, 17, 17, 0.08);
}

.loginIntro {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.loginIcon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--red);
  background: #fff1ef;
}

.loginIntro p {
  margin: 0 0 5px;
  color: var(--red-dark);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.loginIntro h2 {
  margin: 0 0 8px;
  font-size: clamp(1.45rem, 5vw, 1.8rem);
  line-height: 1.05;
}

.loginIntro span {
  color: #364152;
  line-height: 1.4;
}

.loginCard label {
  display: grid;
  gap: 8px;
  color: #283241;
  font-weight: 800;
}

.loginCard input {
  width: 100%;
  min-height: 46px;
  border: 1px solid #cfd8e3;
  border-radius: 12px;
  padding: 11px 12px;
  background: white;
  color: var(--ink);
  font-size: 1rem;
}

.loginCard input:focus {
  border-color: var(--teal);
  outline: 3px solid rgba(35, 124, 140, 0.2);
}

.loginSubmit {
  min-height: 46px;
  border: 0;
  border-radius: 10px;
  color: white;
  background: var(--green);
  font-weight: 900;
  cursor: pointer;
}

.loginSubmit:disabled {
  cursor: wait;
  opacity: 0.68;
}

.loginError {
  margin: -6px 0 0;
  border: 1px solid #ffc2c2;
  border-radius: 10px;
  color: var(--red-dark);
  background: #fff1f1;
  padding: 9px 10px;
  font-weight: 800;
}

.overviewToolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: stretch;
  margin-bottom: 14px;
}

.sectionNav {
  display: grid;
  grid-template-columns: repeat(5, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.sectionNav button {
  min-height: 78px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.sectionNav button strong {
  display: block;
  font-size: 1rem;
}

.sectionNav button small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.25;
}

.sectionIcon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--red);
  background: #fff1ef;
}

.sectionNav button[data-section="finance"] .sectionIcon {
  color: var(--teal);
  background: #eef8f8;
}

.sectionNav button[data-section="match"] .sectionIcon {
  color: var(--green);
  background: #edf8f3;
}

.sectionNav button[data-section="work"] .sectionIcon {
  color: var(--gold);
  background: #fff7e6;
}

.sectionNav button[data-section="board"] .sectionIcon {
  color: var(--violet);
  background: #f3eff9;
}

.uiIcon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sectionNav button.isActive {
  color: var(--ink);
  border-color: var(--red);
  background: #fff8f6;
}

.sectionNav button.isActive small {
  color: var(--muted);
}

.sectionNav button[data-section="finance"].isActive {
  border-color: var(--teal);
  background: #f2fbfb;
}

.sectionNav button[data-section="match"].isActive {
  border-color: var(--green);
  background: #f2faf6;
}

.sectionNav button[data-section="work"].isActive {
  border-color: var(--gold);
  background: #fff8eb;
}

.sectionNav button[data-section="board"].isActive {
  border-color: var(--violet);
  background: #f7f3fb;
}

.sectionActions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin: -4px 0 14px;
}

body[data-section="match"] .memberActions,
body[data-section="work"] .memberActions,
body[data-section="board"] .memberActions,
body:not([data-section="members"]) .newMemberAction {
  display: none;
}

.exportActions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.exportActions a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #bfe2d5;
  border-radius: 8px;
  color: var(--green);
  background: #edf9f4;
  padding: 8px 11px;
  font-size: 0.85rem;
  font-weight: 900;
  text-decoration: none;
}

.exportActions a:nth-child(2) {
  color: var(--teal);
  border-color: #bddfe4;
  background: #eef8f8;
}

.searchBlock {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.searchBlock input,
.compactControls select,
.formGrid input,
.formGrid select {
  width: 100%;
  min-height: 38px;
  border: 1px solid #d5ceca;
  border-radius: 8px;
  padding: 8px 10px;
  background: white;
  color: var(--ink);
}

.searchBlock input {
  min-height: 42px;
  font-size: 1rem;
}

.compactControls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.viewSwitch {
  display: flex;
  flex-wrap: wrap;
  flex: 1 1 420px;
  gap: 6px;
}

.viewSwitch button {
  min-height: 38px;
  min-width: 150px;
  border: 1px solid #d5ceca;
  border-radius: 8px;
  background: white;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.viewSwitch button.isActive {
  color: white;
  border-color: var(--red);
  background: var(--red);
}

.compactControls > select {
  flex: 0 1 170px;
}

.compactControls select:disabled {
  color: #a39a95;
  background: #eee8e4;
}

.matchFilters {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(130px, 1fr);
  flex: 0 1 270px;
  gap: 8px;
}

.topNumbers {
  min-width: 250px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.topNumbers div {
  min-height: 48px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.topNumbers > div > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--red);
}

.topNumbers p {
  margin: 0;
}

.topNumbers small {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.topNumbers strong {
  display: block;
  font-size: 1.25rem;
  line-height: 1;
}

.metricFinance > span {
  background: var(--teal) !important;
}

.metricWorkDues > span {
  background: var(--gold) !important;
}

body[data-section="members"] .metricFinance,
body[data-section="members"] .metricWorkDues,
body:not([data-section="finance"]) .metricWorkDues,
body[data-section="match"] .topNumbers,
body[data-section="work"] .topNumbers,
body[data-section="board"] .topNumbers {
  display: none;
}

body[data-section="match"] .summaryPane,
body[data-section="work"] .summaryPane,
body[data-section="board"] .summaryPane {
  display: none;
}

body[data-section="finance"] #ageSummary {
  display: none;
}

body[data-section="match"] .overviewGrid,
body[data-section="work"] .overviewGrid,
body[data-section="board"] .overviewGrid {
  grid-template-columns: 1fr;
}

.overviewGrid {
  display: grid;
  grid-template-columns: minmax(720px, 2fr) minmax(300px, 0.85fr);
  gap: 16px;
  align-items: start;
}

body.isWorkMode .topNumbers,
body.isWorkMode .summaryPane {
  display: none;
}

body.isWorkMode .overviewToolbar {
  grid-template-columns: 1fr;
}

body.isWorkMode .overviewGrid {
  grid-template-columns: 1fr;
}

.listPane,
.summaryCard,
.detail {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.listHeader {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.82rem;
  border-bottom: 1px solid var(--line);
}

.memberList {
  display: grid;
}

.tableHead {
  display: grid;
  gap: 12px;
  align-items: center;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  background: #fbf8f5;
}

.membersHead,
.memberRow {
  grid-template-columns: minmax(210px, 1.45fr) minmax(96px, 0.58fr) minmax(84px, 0.45fr) minmax(170px, 1fr) 38px;
}

.payersHead,
.payerHead {
  grid-template-columns: minmax(220px, 1.5fr) minmax(96px, 0.58fr) 48px minmax(78px, 0.45fr) 38px;
}

.matchHead,
.matchRow {
  grid-template-columns: minmax(220px, 1.4fr) 54px minmax(92px, 0.55fr) minmax(92px, 0.55fr) 38px 44px 44px minmax(88px, 0.55fr);
}

.workHead,
.workRow,
.workEventHead,
.workEventRow {
  grid-template-columns: minmax(170px, 1.2fr) minmax(110px, 0.7fr) 80px minmax(92px, 0.55fr) 84px;
}

.memberRow,
.matchRow,
.workRow,
.workEventRow {
  width: 100%;
  min-height: 46px;
  display: grid;
  gap: 12px;
  align-items: center;
  padding: 9px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.memberRow:hover,
.payerHead:hover,
.matchRow:hover,
.workRow:hover,
.workEventRow:hover {
  background: #fff8f8;
}

.memberRow strong,
.matchRow strong,
.workRow strong,
.workEventRow strong,
.payerMain strong,
.relatedInline strong {
  display: block;
  line-height: 1.2;
}

.rowMeta,
.memberRow small,
.matchRow small,
.payerHead small,
.summaryCard small {
  color: var(--muted);
  line-height: 1.25;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 23px;
  width: fit-content;
  max-width: 170px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid #dacfc9;
  color: #3b3431;
  background: #fff;
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
}

.pill.red {
  color: var(--red-dark);
  border-color: #ffb7b7;
  background: #fff1f1;
}

.pill.green {
  color: var(--green);
  border-color: #bfe2d5;
  background: #edf9f4;
}

.pill.mutedPill {
  color: #5f5854;
  border-color: #ded6d1;
  background: #f5f1ee;
}

.moneyCell {
  color: var(--red-dark);
  font-weight: 900;
  white-space: nowrap;
}

.mutedCell {
  color: var(--muted);
  font-weight: 800;
}

.checkMark {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: white;
  background: var(--green);
  font-size: 0.82rem;
  font-weight: 900;
}

.matchCheck {
  display: flex;
  justify-content: center;
}

.lkCell {
  font-weight: 900;
}

.relatedInline {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.relatedInline span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 7px;
  border-radius: 8px;
  background: #f5f1ee;
  color: #433b37;
  font-size: 0.78rem;
}

.payerList {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.payerCard {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  overflow: hidden;
}

.payerHead {
  width: 100%;
  display: grid;
  gap: 12px;
  align-items: center;
  border: 0;
  background: white;
  color: inherit;
  text-align: left;
  cursor: pointer;
  padding: 11px 12px;
}

.relatedList {
  display: grid;
  gap: 5px;
  padding: 0 12px 10px 34px;
}

.relatedPerson {
  position: relative;
  width: 100%;
  min-height: 34px;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  align-items: center;
  border: 1px solid #ebe4df;
  border-radius: 8px;
  background: #fbf8f5;
  color: inherit;
  text-align: left;
  cursor: pointer;
  padding: 7px 10px 7px 14px;
}

.relatedPerson::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 16px;
  width: 13px;
  border-top: 2px solid #d8cec8;
}

.relatedPerson:hover {
  background: white;
  border-color: #d8cec8;
}

.soloNote {
  color: var(--muted);
  font-size: 0.86rem;
}

.workList {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.workForm {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) minmax(116px, 0.55fr) minmax(116px, 0.55fr) auto;
  gap: 8px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.workForm label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.workForm input,
.workForm select,
.workForm textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid #d5ceca;
  border-radius: 8px;
  padding: 8px 10px;
  background: white;
  color: var(--ink);
}

.workForm textarea {
  resize: vertical;
  min-height: 78px;
}

.workCreatePanel,
.workExisting {
  display: grid;
  gap: 0;
}

.workCreatePanel h3,
.workExisting h3 {
  margin: 0;
  padding: 11px 14px;
  border-radius: 8px 8px 0 0;
  color: white;
  background: var(--header);
  font-size: 1rem;
  font-weight: 900;
}

.workCreatePanel {
  border: 1px solid #ead8d8;
  border-radius: 8px;
  background: #fff6f6;
  overflow: hidden;
}

.workCreatePanel .workForm {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.workExisting {
  margin-top: 18px;
}

.workExisting h3 {
  border-radius: 8px;
}

.workNoteWide {
  grid-column: 1 / -1;
}

.dateQuick span {
  display: grid;
  grid-template-columns: minmax(136px, 1fr) 64px;
  gap: 6px;
}

.dateQuick button {
  min-height: 38px;
  border: 1px solid #ffb7b7;
  border-radius: 8px;
  color: var(--red-dark);
  background: white;
  padding: 7px 10px;
  font-weight: 900;
  cursor: pointer;
}

.dateQuick input {
  min-width: 0;
}

.workRecent {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.workStats {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: 8px;
}

.workStats div {
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fbf8f5;
}

.workStats div:nth-child(2) {
  color: var(--red-dark);
  background: #fff1f1;
}

.workStats div:nth-child(3) {
  color: var(--green);
  background: #edf9f4;
}

.workStats span {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--muted);
}

.workStats strong {
  font-size: 1.05rem;
  line-height: 1.05;
}

.workRecent h3 {
  margin: 0 0 4px;
  font-size: 0.95rem;
}

.serviceEntry {
  display: grid;
  grid-template-columns: 92px minmax(180px, 1fr) 100px minmax(160px, 1fr);
  gap: 10px;
  align-items: center;
  padding: 7px 0;
  border-top: 1px solid #eee8e4;
  font-size: 0.88rem;
}

.serviceEntry:first-of-type {
  border-top: 0;
}

.serviceEntry small {
  color: var(--muted);
}

.workRows {
  display: grid;
}

.workRows .moneyCell {
  display: grid;
  gap: 2px;
}

.workRows .moneyCell small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.workCreateButton {
  width: fit-content;
}

.workDetailHead {
  grid-template-columns: 1fr;
}

.workEventEdit {
  grid-template-columns: 150px 120px 120px minmax(180px, 1fr) auto;
}

.workEventMeta {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid #6f2626;
  border-radius: 8px;
  color: white;
  background: #651f25;
}

.workEventMeta.isClosed {
  border-color: #0d6c4d;
  background: #0f6f50;
}

.workEventMeta div {
  display: grid;
  gap: 3px;
}

.workEventMeta strong {
  font-size: 1rem;
}

.workEventMeta span,
.workEventMeta small {
  color: rgba(255, 255, 255, 0.86);
}

.workEventMeta button {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 8px 12px;
  font-weight: 900;
  cursor: pointer;
}

.reportEventRow {
  cursor: default;
}

.workReportPreview {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 12px;
}

.reportSummary {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  color: white;
  background: var(--header);
}

.reportSummary span {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.84rem;
}

.reportTableWrap {
  overflow-x: auto;
}

.reportTable {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.reportTable th {
  position: sticky;
  top: 0;
  padding: 7px 8px;
  color: white;
  background: var(--header);
  text-align: left;
  white-space: nowrap;
}

.reportTable td {
  padding: 7px 8px;
  border-bottom: 1px solid #eee8e0;
  white-space: nowrap;
}

.reportTable tbody tr:nth-child(even) td {
  background: #fbf8f5;
}

.reportTable tbody tr.isExempt td {
  color: #766f68;
  background: #f0ede8;
}

.reportTable tbody tr.isExempt td:first-child {
  background: #f0ede8;
}

.exemptToggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.exemptToggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.reportTable td:first-child,
.reportTable th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
}

.reportTable td:first-child {
  background: white;
  font-weight: 800;
}

.reportTable tbody tr:nth-child(even) td:first-child {
  background: #fbf8f5;
}

.reportTable tfoot th {
  color: white;
  background: var(--green);
}

.boardIntro p {
  margin: 8px 0 0;
  color: var(--muted);
}

.boardCreateForm {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 8px;
  align-items: end;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #d9d1e6;
  border-radius: 8px;
  background: linear-gradient(180deg, #fbf8ff 0%, #f4effa 100%);
}

.boardCreateForm label,
.boardNameForm label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.boardCreateForm input,
.boardNameForm input {
  min-height: 38px;
  border: 1px solid #d9d2ca;
  border-radius: 7px;
  background: white;
  padding: 8px 9px;
  color: var(--ink);
  font-weight: 700;
}

.boardCreateForm button {
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  color: white;
  background: var(--violet);
  padding: 9px 14px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 7px 16px rgba(116, 100, 155, 0.2);
}

.boardRows {
  display: grid;
  gap: 10px;
}

.boardRoleCard {
  position: relative;
  display: grid;
  grid-template-columns: minmax(230px, 1fr) minmax(190px, 0.8fr) minmax(390px, 1.45fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px 12px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 8px 22px rgba(17, 17, 17, 0.04);
  overflow: hidden;
}

.boardRoleCard::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--violet);
}

.boardRoleCard strong {
  display: block;
}

.boardRoleCard small {
  color: var(--muted);
}

.boardNameForm {
  display: grid;
  grid-template-columns: minmax(160px, 1fr);
  gap: 6px;
}

.boardRoleActions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.boardRoleActions button {
  min-height: 32px;
  border: 0;
  border-radius: 7px;
  color: white;
  background: var(--violet);
  padding: 6px 9px;
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
}

.boardRoleActions .dangerGhost {
  border: 1px solid #f2b4b2;
  color: var(--red-dark);
  background: #fff2f1;
}

.boardCurrent {
  display: grid;
  gap: 4px;
  padding: 9px 10px;
  border-radius: 8px;
  background: #f7f4ef;
}

.boardCurrent strong {
  font-size: 1rem;
}

.boardCurrentMail {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  margin-top: 2px;
  border: 1px solid #cce5d6;
  border-radius: 999px;
  color: var(--green);
  background: #edf8f3;
  padding: 4px 8px;
  font-size: 0.78rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.boardCurrentMail.isMissing {
  border-color: #f0d39c;
  color: #8a5d00;
  background: #fff8eb;
}

.boardAssignForm {
  display: grid;
  grid-template-columns: auto minmax(145px, 1fr) 140px auto;
  gap: 7px;
  align-items: center;
  padding: 9px;
  border: 1px solid #eee7de;
  border-radius: 8px;
  background: #fffaf4;
}

.boardAssignForm strong {
  color: var(--gold);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.boardAssignForm select,
.boardAssignForm input {
  min-height: 36px;
  border: 1px solid #d9d2ca;
  border-radius: 7px;
  background: white;
  padding: 7px 8px;
}

.boardAssignForm button {
  min-height: 36px;
  border: 0;
  border-radius: 7px;
  color: white;
  background: var(--violet);
  font-weight: 900;
  cursor: pointer;
}

.boardHistoryButton {
  min-height: 38px;
  border: 1px solid #d8d1c8;
  border-radius: 8px;
  color: var(--ink);
  background: #f7f4ef;
  padding: 8px 12px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

.boardHistoryPanel {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f4ef;
}

.boardHistoryPanel h3,
.boardHistoryPanel p {
  margin: 0;
}

.boardHistoryPanel p {
  color: var(--muted);
  font-size: 0.88rem;
}

.boardHistory {
  display: grid;
  gap: 6px;
  max-height: 280px;
  overflow: auto;
  padding: 8px;
  border-radius: 8px;
  background: #f1eee9;
}

.boardHistory > strong {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.boardHistoryItem {
  position: relative;
  display: grid;
  gap: 1px;
  padding: 6px 8px 6px 12px;
  border-radius: 7px;
  color: #49423d;
  background: linear-gradient(90deg, #e7e1da 0%, #f8f6f3 100%);
}

.boardHistoryItem::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 999px;
  background: #b7afa7;
}

.boardHistoryItem.isHighlighted {
  outline: 2px solid var(--violet);
  background: linear-gradient(90deg, #e6ddf3 0%, #fbf8ff 100%);
}

.boardMeetingForm {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) 150px 120px minmax(170px, 1fr) auto;
  gap: 8px;
  align-items: end;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #d9d1e6;
  border-radius: 8px;
  background: linear-gradient(180deg, #fbf8ff 0%, #f4effa 100%);
}

.boardMeetingForm label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.boardMeetingForm input,
.boardMeetingForm textarea {
  min-height: 38px;
  border: 1px solid #d9d2ca;
  border-radius: 7px;
  background: white;
  padding: 8px 9px;
  color: var(--ink);
  font-weight: 700;
}

.boardMeetingForm textarea {
  min-height: 72px;
  resize: vertical;
}

.meetingNoteWide {
  grid-column: 1 / -2;
}

.boardMeetingForm button,
.meetingUploadCard button {
  min-height: 40px;
  border: 0;
  border-radius: 7px;
  color: white;
  background: var(--violet);
  padding: 8px 13px;
  font-weight: 900;
  cursor: pointer;
}

.boardMeetingRows {
  display: grid;
  gap: 8px;
}

.boardMeetingRow {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 120px 140px 150px;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 66px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 11px 13px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.boardMeetingRow:hover {
  border-color: #d7c9e8;
  background: #fbf8ff;
}

.boardMeetingRow strong,
.meetingDetailHero strong {
  display: block;
  font-size: 1rem;
}

.boardMeetingRow small,
.meetingDetailHero small,
.meetingUploadCard small {
  display: block;
  color: var(--muted);
}

.statusOk,
.statusOpen {
  justify-self: start;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 0.78rem;
  font-weight: 900;
}

.statusOk {
  color: var(--green);
  background: #e9f6ef;
}

.statusOpen {
  color: var(--gold);
  background: #fff6df;
}

.meetingDetailHero {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(220px, 1.4fr);
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid #d9d1e6;
  border-radius: 8px;
  background: linear-gradient(180deg, #fbf8ff 0%, #fffdf9 100%);
}

.meetingDetailHero span {
  display: block;
  margin-top: 4px;
  color: var(--violet);
  font-weight: 900;
}

.meetingDetailHero p {
  margin: 0;
  color: var(--muted);
}

.meetingUploads {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.meetingUploadCard {
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 260px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.meetingUploadCard.isFeatured {
  border-color: #d9d1e6;
  background: linear-gradient(180deg, #fffdf9 0%, #f7f3fb 100%);
}

.meetingUploadCard input[type="file"] {
  width: 100%;
  border: 1px dashed #cabfda;
  border-radius: 8px;
  background: white;
  padding: 10px;
}

.meetingUploadCard button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.meetingDocumentList {
  display: grid;
  gap: 6px;
  margin-top: 4px;
}

.meetingDocument {
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  border: 1px solid #e2dce9;
  border-radius: 8px;
  color: var(--ink);
  background: #fbf8ff;
  text-decoration: none;
}

.meetingDocument:hover {
  border-color: var(--violet);
}

.mailInviteList {
  display: grid;
  gap: 12px;
}

.mailInviteHero {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid #d9d1e6;
  border-radius: 8px;
  background: linear-gradient(180deg, #fbf8ff 0%, #fffdf9 100%);
}

.mailInviteHero strong {
  display: block;
  font-size: 1.1rem;
}

.mailInviteHero span,
.mailInviteHero small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.mailInviteForm {
  display: grid;
  grid-template-columns: repeat(3, minmax(170px, 1fr));
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.mailInviteForm label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.mailInviteForm select,
.mailInviteForm input,
.mailInviteForm textarea {
  min-height: 38px;
  border: 1px solid #d9d2ca;
  border-radius: 7px;
  background: white;
  padding: 8px 9px;
  color: var(--ink);
}

.mailInviteForm textarea {
  resize: vertical;
  line-height: 1.45;
}

.mailSubjectWide,
.mailBodyWide,
.mailPreview {
  grid-column: 1 / -1;
}

.mailPreview {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #dceadf;
  border-radius: 8px;
  background: #f3fbf7;
}

.mailPreview h3,
.mailPreview p {
  margin: 0;
}

.mailPreview p {
  color: var(--muted);
  font-size: 0.88rem;
}

.mailRecipientList {
  display: grid;
  gap: 8px;
}

.mailRecipientList span {
  display: grid;
  grid-template-columns: minmax(190px, 0.85fr) minmax(160px, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid #cce5d6;
  border-radius: 8px;
  background: white;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 0.84rem;
}

.mailRecipientList strong {
  color: var(--ink);
}

.mailRecipientList small {
  color: var(--muted);
}

.mailMissingList {
  display: grid;
  gap: 5px;
  margin-top: 4px;
  padding: 10px;
  border: 1px solid #f0d39c;
  border-radius: 8px;
  color: #6f4d0d;
  background: #fff8eb;
  font-size: 0.86rem;
}

.mailMissingList strong {
  color: var(--gold);
}

.mailResult {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #cce5d6;
  background: #edf8f3;
}

.mailResult.hasFailure {
  border-color: #f0d39c;
  background: #fff8eb;
}

.mailResult div {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.88rem;
}

.participantRows {
  display: grid;
  gap: 6px;
}

.participantRow {
  display: grid;
  grid-template-columns: minmax(155px, 1fr) minmax(210px, 0.9fr) 74px 72px 88px 42px;
  gap: 7px;
  align-items: center;
  padding: 6px 8px;
  border: 1px solid #eee8e4;
  border-radius: 8px;
  background: #fbf8f5;
}

.participantRow.isCheckedOut {
  border-color: #cfe8dc;
  background: #f3fbf7;
}

.participantRow.isFinalized {
  border-color: #0d6c4d;
  background: #0f6f50;
  color: white;
}

.participantRow.isFinalized small,
.participantRow.isFinalized .durationCell,
.participantRow.isFinalized .autosaveState {
  color: white;
}

.participantRow.isEditingFinalized {
  border-color: #d8c190;
  background: #fff8e9;
  color: var(--ink);
}

.participantRow.isEditingFinalized .durationCell,
.participantRow.isEditingFinalized .autosaveState {
  color: var(--ink);
}

.durationCell {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.participantRow input,
.participantRow select,
.memberPickSearch {
  width: 100%;
  min-height: 36px;
  border: 1px solid #d5ceca;
  border-radius: 8px;
  padding: 7px 9px;
  background: white;
}

.participantRow button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 6px 8px;
  cursor: pointer;
}

.checkoutButton {
  color: var(--teal);
  border-color: #b8d9df !important;
  font-size: 0.76rem;
  font-weight: 900;
  white-space: nowrap;
}

.saveParticipantButton {
  color: white;
  border-color: var(--green) !important;
  background: var(--green) !important;
  font-size: 0.76rem;
  font-weight: 900;
  white-space: nowrap;
}

.editParticipantButton {
  color: var(--ink);
  border-color: #d5ceca !important;
  background: white !important;
  font-size: 0.76rem;
  font-weight: 900;
  white-space: nowrap;
}

.checkoutButton:hover {
  color: white;
  background: var(--teal);
}

.trashButton {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  justify-self: end;
  border-color: #ffb7b7 !important;
  color: var(--red-dark);
  background: #fff1f1 !important;
}

.trashButton svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trashButton:hover {
  color: white;
  background: var(--red) !important;
}

.timePair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.endNowPair {
  display: grid;
  grid-template-columns: 1fr 48px;
  gap: 5px;
}

.endNowPair button {
  min-width: 0;
  padding: 6px 5px;
  color: var(--teal);
  border-color: #b8d9df !important;
  font-size: 0.72rem;
  font-weight: 900;
}

.workQuickActions {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, auto)) minmax(250px, 1fr) auto;
  gap: 8px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.workQuickActions button,
.workQuickActions input {
  min-height: 38px;
  border: 1px solid #d5ceca;
  border-radius: 8px;
  padding: 8px 10px;
  background: white;
}

.workQuickActions > button {
  font-weight: 900;
  cursor: pointer;
}

.workQuickActions label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
}

.workQuickActions label span {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) auto;
  gap: 6px;
}

.sealButton {
  color: white;
  border-color: var(--red) !important;
  background: var(--red) !important;
}

.dangerGhost {
  color: var(--red-dark);
  border-color: #ffb7b7 !important;
  background: #fff1f1 !important;
}

.sealedNotice {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid #d8c190;
  border-radius: 8px;
  background: #fff8e9;
}

.sealedNotice span {
  color: var(--muted);
  font-size: 0.82rem;
}

.sealConfirm {
  margin: 0;
}

.sealConfirm input {
  min-height: 38px;
  border: 1px solid #d5ceca;
  border-radius: 8px;
  padding: 8px 10px;
}

.autosaveState {
  color: var(--green);
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
}

.autosaveState.isSaving {
  color: var(--gold);
}

.deleteConfirm {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  margin-top: 2px;
  padding: 10px;
  border: 2px solid var(--red);
  border-radius: 8px;
  background: #fff1f1;
}

.deleteConfirm span {
  color: var(--muted);
  font-size: 0.78rem;
}

.deleteConfirm button {
  min-height: 34px;
  font-weight: 900;
}

.deleteConfirm .danger {
  border-color: var(--red);
  color: white;
  background: var(--red);
}

.addParticipants summary {
  margin: -12px -12px 8px;
  padding: 12px;
  border-radius: 8px 8px 0 0;
  color: white;
  background: var(--red);
  cursor: pointer;
  font-weight: 900;
}

.addParticipants[open] summary {
  margin-bottom: 10px;
  background: var(--header);
}

.memberPickList {
  display: grid;
  gap: 5px;
}

.memberPick {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid #eee8e4;
  border-radius: 8px;
  background: #fbf8f5;
}

.memberPick button {
  min-height: 32px;
  border: 1px solid #bfe2d5;
  border-radius: 8px;
  color: var(--green);
  background: #edf9f4;
  padding: 6px 10px;
  font-weight: 900;
  cursor: pointer;
}

.memberPick button:hover {
  color: white;
  background: var(--green);
}

.summaryPane {
  display: grid;
  gap: 12px;
  position: sticky;
  top: 14px;
}

.summaryCard {
  padding: 14px;
}

.summaryCard h2 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.pieWrap {
  display: grid;
  place-items: center;
  min-height: 230px;
}

.pieSvg {
  width: min(250px, 100%);
  height: auto;
  overflow: visible;
}

.pieLabel {
  fill: white;
  font-size: 0.72rem;
  font-weight: 900;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, 0.22);
  stroke-width: 3px;
  stroke-linejoin: round;
}

.chartLegend,
.typeRows {
  display: grid;
  gap: 7px;
}

.legendItem,
.typeRow {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 0.82rem;
}

.legendDot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.typeRow strong {
  font-size: 0.86rem;
}

.summaryTotal {
  border-top: 1px solid var(--line);
  margin-top: 2px;
  padding-top: 7px;
}

.summaryCard small {
  display: block;
  color: var(--muted);
  margin: -4px 0 10px;
}

.ageBars {
  display: grid;
  gap: 9px;
}

.ageBar {
  display: grid;
  gap: 4px;
}

.ageBarMeta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  color: var(--muted);
  font-size: 0.82rem;
}

.ageBarMeta strong {
  color: var(--ink);
}

.ageBarTrack {
  height: 8px;
  border-radius: 999px;
  background: #eee8e0;
  overflow: hidden;
}

.ageBarTrack span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.detailPage {
  display: grid;
  gap: 12px;
}

.backButton {
  width: fit-content;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 8px 12px;
  font-weight: 800;
  cursor: pointer;
}

.detail {
  padding: clamp(18px, 3vw, 30px);
}

.detailHero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.detailHero h2 {
  margin: 0 0 10px;
  font-size: clamp(1.7rem, 4vw, 2.65rem);
  line-height: 1.05;
}

.detailHero p {
  margin: 0;
  color: var(--muted);
}

.quickFacts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 16px;
}

.panel.wide {
  grid-column: 1 / -1;
}

.panel h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.membershipPanel {
  border-color: #e0c581;
  background: #fffaf0;
}

.membershipForm {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(150px, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.membershipForm label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.membershipForm select,
.membershipForm input {
  min-height: 38px;
  border: 1px solid #d9d2ca;
  border-radius: 7px;
  background: white;
  padding: 8px;
  color: var(--ink);
}

.membershipForm button {
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  color: white;
  background: var(--gold);
  padding: 8px 12px;
  font-weight: 900;
  cursor: pointer;
}

.membershipPanel p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.contactForm {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr)) auto;
  gap: 8px;
  align-items: end;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.contactForm h4 {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.9rem;
}

.contactForm label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.contactForm input {
  min-height: 38px;
  border: 1px solid #d9d2ca;
  border-radius: 7px;
  background: white;
  padding: 8px;
  color: var(--ink);
}

.contactForm button {
  min-height: 38px;
  white-space: nowrap;
}

.boardPill {
  border-color: #651f25 !important;
  color: white !important;
  background: #651f25 !important;
  font-weight: 900;
}

.groupMembershipCare {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e8d9af;
}

.groupMembershipCare h4 {
  margin: 0;
  font-size: 0.92rem;
}

.groupMembershipRows {
  display: grid;
  gap: 6px;
}

.groupMembershipRow {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) 90px 130px 150px auto;
  gap: 6px;
  align-items: center;
  padding: 7px;
  border: 1px solid #ecdcb5;
  border-radius: 8px;
  background: #fffdf8;
}

.groupMembershipRow span {
  color: var(--muted);
  font-size: 0.8rem;
}

.groupMembershipRow select,
.groupMembershipRow input {
  min-height: 34px;
  border: 1px solid #d9d2ca;
  border-radius: 7px;
  background: white;
  padding: 6px;
}

.groupMembershipRow button {
  min-height: 34px;
  border: 0;
  border-radius: 7px;
  color: white;
  background: var(--gold);
  padding: 6px 9px;
  font-weight: 900;
  cursor: pointer;
}

.contributionSuggestion {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  color: white;
  background: var(--header);
}

.dataRows {
  display: grid;
  gap: 9px;
}

.dataRow {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 12px;
  line-height: 1.35;
}

.dataRow span:first-child {
  color: var(--muted);
}

.personGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.personMini {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--paper);
}

.personMini button {
  border: 0;
  padding: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  font-weight: 800;
}

dialog {
  width: min(900px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.26);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

.dialogPanel {
  padding: 20px;
  background: var(--paper);
}

.dialogHead {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.dialogHead p {
  color: var(--red-dark);
  font-weight: 800;
}

.iconButton {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-size: 1.5rem;
}

.formGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 12px;
}

.formGrid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.84rem;
}

.uploadBox,
.privacyBox {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: white;
}

.uploadBox {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.uploadBox p,
.privacyBox p {
  margin: 4px 0 0;
  color: var(--muted);
}

.uploadBox button,
.dialogActions button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 9px 13px;
}

.dialogActions .primary {
  min-width: 190px;
  border-color: var(--red);
  background: var(--red);
  color: white;
  font-weight: 900;
}

.dialogActions .primary:hover {
  background: var(--red-dark);
  border-color: var(--red-dark);
}

.dialogActions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

@media (max-width: 1080px) {
  .overviewToolbar,
  .overviewGrid {
    grid-template-columns: 1fr;
  }

  .summaryPane {
    position: static;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
  }

  .membersHead,
  .memberRow {
    grid-template-columns: minmax(180px, 1.25fr) minmax(92px, 0.52fr) minmax(76px, 0.42fr) minmax(130px, 0.85fr) 34px;
  }

  .payersHead,
  .payerHead {
    grid-template-columns: minmax(170px, 1fr) minmax(120px, 0.65fr) 48px minmax(76px, 0.45fr) 38px;
  }

  .matchHead,
  .matchRow {
    grid-template-columns: minmax(180px, 1.2fr) 48px minmax(82px, 0.5fr) minmax(82px, 0.5fr) 34px 40px 40px minmax(80px, 0.5fr);
  }

  .workForm {
    grid-template-columns: minmax(220px, 1fr) minmax(112px, 0.55fr) minmax(112px, 0.55fr);
  }

  .workStats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .workHead,
  .workRow,
  .workEventHead,
  .workEventRow {
    grid-template-columns: minmax(160px, 1fr) 100px 72px 82px 72px;
  }

  .workEventEdit,
  .participantRow {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .workQuickActions {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .boardRoleCard {
    grid-template-columns: minmax(220px, 1fr) minmax(260px, 1.25fr);
  }

  .boardMeetingForm,
  .boardMeetingRow,
  .mailInviteForm,
  .meetingUploads {
    grid-template-columns: 1fr 1fr;
  }

  .meetingNoteWide {
    grid-column: 1 / -1;
  }

  .boardAssignForm {
    grid-template-columns: 1fr;
  }

  .rowContribution {
    justify-self: start;
  }
}

@media (max-width: 760px) {
  .detailHero,
  .mailInviteHero,
  .uploadBox {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    min-height: 78px;
    align-items: center;
    flex-direction: row;
    gap: 10px;
    padding: 10px 12px;
    position: sticky;
    top: 0;
  }

  .brand {
    gap: 10px;
  }

  .brand img {
    width: 52px;
    height: 52px;
    flex: 0 0 auto;
  }

  .brand h1 {
    font-size: 1.25rem;
  }

  .brand p {
    font-size: 0.76rem;
  }

  .mobileMenuButton {
    display: inline-grid;
    flex: 0 0 auto;
  }

  .logoutButton {
    padding: 8px 10px;
    font-size: 0.82rem;
  }

  .mobileMenuButton span {
    transition: transform 0.16s ease, opacity 0.16s ease;
  }

  body.mobileNavOpen .mobileMenuButton span:nth-child(1) {
    transform: translateY(4px) rotate(45deg);
  }

  body.mobileNavOpen .mobileMenuButton span:nth-child(2) {
    opacity: 0;
  }

  body.mobileNavOpen .mobileMenuButton span:nth-child(3) {
    transform: translateY(-4px) rotate(-45deg);
  }

  main {
    padding-top: 12px;
  }

  .compactControls,
  .summaryPane,
  .sections,
  .formGrid {
    grid-template-columns: 1fr;
  }

  .sectionNav {
    display: none;
    grid-template-columns: 1fr;
    gap: 6px;
    margin: -2px 0 10px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    box-shadow: 0 12px 30px rgba(17, 17, 17, 0.13);
  }

  body.mobileNavOpen .sectionNav {
    display: grid;
  }

  .sectionNav button {
    min-height: 54px;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    padding: 8px 10px;
  }

  .sectionIcon {
    width: 34px;
    height: 34px;
  }

  .sectionNav button strong {
    font-size: 0.95rem;
  }

  .sectionNav button small {
    font-size: 0.74rem;
  }

  .memberRow,
  .payerHead,
  .matchRow,
  .workRow,
  .workEventRow,
  .boardRoleCard,
  .relatedPerson {
    grid-template-columns: 1fr;
  }

  .boardAssignForm {
    grid-template-columns: 1fr;
  }

  .boardCreateForm {
    grid-template-columns: 1fr;
  }

  .workForm,
  .boardMeetingForm,
  .boardMeetingRow,
  .meetingDetailHero,
  .meetingUploads,
  .mailInviteForm,
  .mailInviteHero,
  .mailRecipientList span,
  .serviceEntry,
  .membershipForm,
  .contactForm,
  .groupMembershipRow,
  .workEventEdit,
  .workQuickActions,
  .workEventMeta {
    grid-template-columns: 1fr;
  }

  .participantRow {
    grid-template-columns: minmax(116px, 1fr) minmax(126px, 0.8fr) 70px 42px;
    column-gap: 8px;
  }

  .participantRow .trashButton {
    grid-column: 4;
  }

  .participantRow .checkoutButton {
    grid-column: 2 / 4;
  }

  .participantRow .durationCell {
    justify-self: end;
  }

  .participantRow .autosaveState {
    display: none;
  }

  .timePair {
    grid-template-columns: 1fr 1fr;
  }

  .workStats {
    grid-template-columns: 1fr;
  }

  .memberPick {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .workStats div {
    min-height: 62px;
  }

  .deleteConfirm {
    grid-template-columns: 1fr;
  }

  .tableHead {
    display: none;
  }

  .topNumbers {
    min-width: 0;
  }

  .dataRow {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}
