:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --ink: #16201c;
  --muted: #62706b;
  --paper: #f7f5ee;
  --surface: #ffffff;
  --line: #d9ded1;
  --green: #256f52;
  --green-dark: #174a38;
  --red: #b42318;
  --yellow: #f0c85a;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(247, 245, 238, 0.84), rgba(247, 245, 238, 0.92)),
    url("https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?auto=format&fit=crop&w=1800&q=80")
      center / cover fixed;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.25rem;
}

.topbar-actions {
  display: flex;
  align-items: end;
  gap: 0.75rem;
}

.session-panel {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.session-user {
  display: grid;
  gap: 0.1rem;
  min-width: 220px;
}

.session-user strong {
  font-size: 0.96rem;
}

.session-user span {
  color: var(--muted);
  font-size: 0.84rem;
}

.role-switcher {
  min-width: 230px;
  color: var(--muted);
  font-size: 0.86rem;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  line-height: 1.1;
}

h2 {
  font-size: clamp(1.45rem, 3vw, 2.2rem);
  line-height: 1.12;
}

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1rem 1.25rem 4rem;
}

.eyebrow {
  margin-bottom: 0.35rem;
  color: var(--green-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.dashboard {
  display: grid;
  gap: 1.5rem;
  padding-top: 1.5rem;
}

.auth-view {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  padding-top: 2.5rem;
}

.auth-card {
  display: grid;
  gap: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 20px 55px rgba(22, 32, 28, 0.12);
}

.auth-card-side {
  min-height: 100%;
}

.auth-form {
  display: grid;
  gap: 0.9rem;
}

.auth-toggle-button {
  justify-self: start;
}

.activation-panel {
  display: grid;
  gap: 1rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--line);
}

.auth-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.account-link {
  display: inline-block;
  margin-top: 0.35rem;
  color: var(--green-dark);
  word-break: break-all;
}

.request-actions,
.account-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.dashboard-copy {
  max-width: 760px;
}

.dashboard-copy p:last-child {
  max-width: 680px;
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.6;
}

.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.metric-card,
.event-card,
.event-dialog,
.detail-dialog,
.person-dialog {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 20px 55px rgba(22, 32, 28, 0.12);
}

.metric-card {
  width: 100%;
  min-height: 170px;
  display: grid;
  align-content: center;
  gap: 0.5rem;
  padding: 1.5rem;
  color: var(--ink);
  text-align: left;
  transition:
    transform 150ms ease,
    border-color 150ms ease;
}

.dashboard-tile {
  padding: 1rem;
}

.regular-card strong {
  color: #5a4a09;
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: var(--green);
}

.interactive-card {
  cursor: pointer;
}

.metric-card strong {
  color: var(--green-dark);
  font-size: clamp(2.7rem, 7vw, 4.5rem);
  line-height: 0.95;
}

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

.primary-button,
.secondary-button,
.danger-button,
.icon-button {
  min-height: 2.65rem;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.7rem 1rem;
  font-weight: 800;
}

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

.primary-button:hover {
  background: var(--green-dark);
}

.secondary-button {
  color: var(--green-dark);
  background: var(--surface);
  border-color: var(--line);
}

.danger-button {
  color: var(--red);
  background: #fff8f7;
  border-color: #f3c1bc;
}

.icon-button {
  width: 2.65rem;
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
  font-size: 1.5rem;
}

.section-heading,
.dialog-heading,
.dialog-actions,
.event-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.event-list-view,
.regular-activity-view {
  padding-top: 2rem;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.module-panel {
  display: grid;
  gap: 0.75rem;
  min-height: 190px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 20px 55px rgba(22, 32, 28, 0.1);
}

.module-tile {
  cursor: pointer;
  color: var(--ink);
  text-align: left;
}

.module-tile:hover {
  border-color: var(--green);
  transform: translateY(-2px);
}

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

.module-panel h3 {
  margin: 0;
  font-size: 1.2rem;
}

.module-panel p:last-child {
  color: var(--muted);
  line-height: 1.5;
}

.library-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}

.gallery-panel-heading {
  margin-bottom: 1rem;
}

.gallery-toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 280px));
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.gallery-list {
  display: grid;
  gap: 0.75rem;
}

.gallery-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  background: #fbfcf8;
}

.gallery-card-main {
  display: grid;
  gap: 0.45rem;
}

.gallery-card h3,
.gallery-card p {
  margin: 0;
}

.gallery-card-date {
  color: var(--green-dark);
  font-weight: 700;
}

.gallery-card a {
  width: fit-content;
  color: var(--green-dark);
  font-weight: 800;
}

.gallery-card a:hover {
  text-decoration: underline;
}

.library-filters,
.library-results {
  display: grid;
  align-content: start;
  gap: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 20px 55px rgba(22, 32, 28, 0.1);
}

.library-filters h3,
.library-results h3 {
  margin: 0;
}

.template-list {
  display: grid;
  gap: 1rem;
}

.template-card {
  display: grid;
  gap: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  background: #fbfcf8;
}

.interactive-card:hover {
  border-color: var(--green);
  transform: translateY(-2px);
}

.template-card-compact {
  gap: 0.6rem;
}

.template-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.template-title-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--green-dark);
  cursor: pointer;
  font: inherit;
  font-size: 1.15rem;
  font-weight: 850;
  line-height: 1.25;
  text-align: left;
}

.template-title-button:hover {
  text-decoration: underline;
}

.template-card h4,
.template-detail-body h3 {
  margin: 0;
  font-size: 1.15rem;
}

.template-detail-body {
  display: grid;
  gap: 1rem;
}

.template-detail-body section {
  display: grid;
  gap: 0.35rem;
}

.template-detail-body p {
  margin: 0;
  line-height: 1.55;
}

.template-meta,
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.template-meta span,
.tag-list span {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.3rem 0.5rem;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.9rem;
}

.checkbox-fieldset {
  display: grid;
  gap: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.8rem;
}

.checkbox-fieldset legend {
  color: var(--green-dark);
  font-weight: 800;
}

.compact-fieldset {
  margin: 0 0 0.75rem;
}

.checkbox-label {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
  font-weight: 600;
}

.checkbox-label input {
  width: auto;
  min-height: auto;
}

.taxonomy-label {
  justify-content: flex-start;
}

.taxonomy-label span {
  flex: 1;
}

.inline-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
}

.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.event-card {
  display: grid;
  gap: 1rem;
  min-height: 230px;
  padding: 1.15rem;
}

.event-card h3 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.25;
}

.event-title-button {
  border: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-weight: 800;
  text-align: left;
}

.event-title-button:hover {
  color: var(--green-dark);
  text-decoration: underline;
}

.event-meta {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
}

.event-meta span {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
}

.event-meta strong {
  min-width: 3.5rem;
  color: var(--ink);
}

.event-actions {
  align-self: end;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.empty-state {
  margin-top: 1.5rem;
  padding: 1rem;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
}

.event-dialog {
  width: min(92vw, 560px);
  padding: 0;
}

.detail-dialog {
  width: min(94vw, 1040px);
  max-height: 92vh;
  padding: 0;
  overflow: hidden;
}

.person-dialog {
  width: min(92vw, 680px);
  padding: 0;
}

.event-dialog::backdrop,
.detail-dialog::backdrop,
.person-dialog::backdrop {
  background: rgba(22, 32, 28, 0.48);
}

.event-form {
  display: grid;
  gap: 1rem;
  padding: 1.25rem;
}

label {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
  color: var(--ink);
  background: var(--surface);
}

input {
  min-height: 2.8rem;
}

textarea {
  min-height: 12rem;
  resize: vertical;
  line-height: 1.5;
}

select {
  width: 100%;
  min-height: 2.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
  color: var(--ink);
  background: var(--surface);
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(37, 111, 82, 0.2);
  border-color: var(--green);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-error {
  color: var(--red);
  font-weight: 800;
}

.event-detail {
  display: grid;
  grid-template-rows: auto auto auto minmax(320px, 1fr);
  max-height: 92vh;
  overflow: auto;
}

.detail-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.25rem 0.75rem;
}

.detail-top-actions {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.detail-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  padding: 0 1.25rem 1rem;
}

.detail-summary span {
  display: grid;
  gap: 0.25rem;
  min-height: 4.4rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.75rem;
  background: #fbfcf8;
}

.detail-summary strong {
  color: var(--green-dark);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.detail-summary small {
  color: var(--ink);
  font-size: 0.96rem;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.tab-button {
  min-height: 2.7rem;
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 0.65rem 0.85rem;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
  white-space: nowrap;
}

.tab-button.active {
  color: var(--green-dark);
  border-color: var(--yellow);
}

.tab-panel {
  display: grid;
  align-content: start;
  gap: 1rem;
  padding: 1.25rem;
  min-height: 320px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.panel-heading h3 {
  margin: 0;
  font-size: 1.25rem;
}

.panel-heading p {
  margin-top: 0.25rem;
  color: var(--muted);
}

.people-list {
  display: grid;
  gap: 0.75rem;
}

.plan-list,
.activity-list,
.equipment-list {
  display: grid;
  gap: 0.75rem;
}

.plan-day {
  display: grid;
  gap: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  background: #fbfcf8;
}

.plan-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.plan-day-header span {
  color: var(--muted);
}

.plan-day-title-button {
  display: grid;
  gap: 0.2rem;
  border: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
  text-align: left;
}

.plan-day-title-button:hover strong {
  color: var(--green-dark);
  text-decoration: underline;
}

.activity-row {
  display: grid;
  gap: 0.75rem;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.9rem;
  background: var(--surface);
}

.activity-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.9rem;
  align-items: start;
}

.activity-time {
  min-width: 7.8rem;
  border-radius: 8px;
  padding: 0.35rem 0.55rem;
  color: var(--green-dark);
  background: #eef6ef;
  font-weight: 800;
}

.activity-row h4 {
  margin: 0;
  font-size: 1.08rem;
}

.activity-title-button {
  border: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-weight: 800;
  text-align: left;
}

.activity-title-button:hover {
  color: var(--green-dark);
  text-decoration: underline;
}

.activity-details {
  display: grid;
  gap: 0.65rem;
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
}

.activity-rules {
  color: var(--muted);
  line-height: 1.5;
  white-space: pre-wrap;
}

.activity-equipment {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.activity-equipment li {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.35rem 0.55rem;
  background: #f7f5ee;
}

.equipment-editor {
  display: grid;
  gap: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  background: #fbfcf8;
}

.equipment-editor h3 {
  margin: 0;
  font-size: 1.08rem;
}

.equipment-editor p {
  margin-top: 0.2rem;
  color: var(--muted);
}

.equipment-form-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 110px auto;
  gap: 0.6rem;
  align-items: center;
}

.equipment-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 90px auto;
  gap: 0.75rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.65rem;
  background: var(--surface);
}

.equipment-summary {
  display: grid;
  gap: 1rem;
}

.equipment-summary-group {
  display: grid;
  gap: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  background: #fbfcf8;
}

.equipment-summary-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.equipment-summary-heading h4 {
  margin: 0;
  font-size: 1.12rem;
}

.equipment-summary-heading span {
  color: var(--muted);
}

.finance-prices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1rem;
}

.finance-list,
.finance-group,
.finance-rows,
.payment-list {
  display: grid;
  gap: 0.75rem;
}

.finance-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  background: #fbfcf8;
}

.finance-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.finance-group-heading h4 {
  margin: 0;
  color: var(--green-dark);
}

.finance-group-heading span {
  color: var(--muted);
  font-weight: 800;
}

.finance-row {
  display: grid;
  grid-template-columns: minmax(170px, 0.9fr) minmax(280px, 1.2fr) auto;
  gap: 1rem;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.85rem;
  background: var(--surface);
}

.finance-row small {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
}

.finance-numbers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.finance-numbers span {
  display: grid;
  gap: 0.15rem;
  color: var(--ink);
}

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

.payment-list {
  grid-column: 1 / -1;
}

.payment-row {
  display: grid;
  grid-template-columns: 150px 120px minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 0.55rem;
}

.finance-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.finance-summary-card {
  display: grid;
  gap: 0.3rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.85rem;
  background: #fbfcf8;
}

.finance-summary-card span {
  color: var(--muted);
  font-weight: 800;
}

.finance-summary-card strong {
  color: var(--green-dark);
  font-size: 1.4rem;
}

.finance-summary-card.negative strong {
  color: var(--red);
}

.expense-form {
  display: grid;
  gap: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  background: #fbfcf8;
  margin-bottom: 1rem;
}

.expense-list {
  display: grid;
  gap: 0.75rem;
}

.expense-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 120px minmax(0, 1fr) minmax(120px, auto) auto;
  gap: 0.75rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.85rem;
  background: var(--surface);
}

.expense-row small {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
}

.print-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

.print-table th,
.print-table td {
  border: 1px solid var(--line);
  padding: 0.65rem;
  text-align: left;
  vertical-align: top;
}

.print-table th {
  color: var(--green-dark);
  background: #eef6ef;
}

.all-people-print {
  display: none;
  padding: 0 1.25rem 1.25rem;
}

.print-people-group {
  display: block;
  clear: both;
  margin-bottom: 1.25rem;
}

.print-people-group h3 {
  display: block;
  clear: both;
  margin: 0 0 0.4rem;
  color: var(--green-dark);
  line-height: 1.25;
}

.people-print-table {
  width: 100%;
}

.person-row {
  display: grid;
  grid-template-columns: minmax(170px, 0.8fr) minmax(220px, 1fr) auto;
  gap: 1rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.85rem;
  background: #fbfcf8;
}

.regular-child-row {
  grid-template-columns: minmax(170px, 0.75fr) minmax(220px, 1fr) minmax(180px, 0.85fr) auto;
}

.daily-record-list,
.gallery-list,
.attendance-list,
.daily-activity-list {
  display: grid;
  gap: 0.75rem;
}

.daily-record-card,
.gallery-card,
.daily-activity-row,
.attendance-row {
  display: grid;
  gap: 0.75rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.85rem;
  background: #fbfcf8;
}

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

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

.daily-record-card h3 {
  margin: 0;
}

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

.attendance-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.attendance-options label {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.3rem 0.45rem;
  background: var(--surface);
  font-weight: 800;
}

.attendance-options input {
  width: auto;
  min-height: auto;
}

.daily-activity-editor {
  display: grid;
  gap: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  background: #fbfcf8;
}

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

.daily-activity-row small {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
}

.hint-text {
  color: var(--muted);
  font-size: 0.92rem;
}

.person-row div {
  display: grid;
  gap: 0.2rem;
}

.person-row small,
.person-row span {
  color: var(--muted);
}

.person-actions {
  display: flex !important;
  flex-direction: row;
  gap: 0.4rem;
}

.status-pill {
  width: fit-content;
  border-radius: 8px;
  padding: 0.25rem 0.5rem;
  font-size: 0.82rem;
  font-weight: 800;
}

.status-active {
  color: var(--green-dark);
  background: #eef6ef;
}

.status-inactive {
  color: var(--red);
  background: #fff8f7;
}

.small-icon-button {
  width: 2.2rem;
  min-height: 2.2rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--green-dark);
  background: var(--surface);
  font-weight: 900;
}

.danger-icon {
  color: var(--red);
  background: #fff8f7;
  border-color: #f3c1bc;
}

.align-start {
  justify-self: start;
}

.hidden {
  display: none !important;
}

@media (max-width: 760px) {
  .topbar,
  .section-heading,
  .dialog-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard {
    min-height: auto;
    grid-template-rows: auto;
    padding-top: 2rem;
  }

  .auth-view {
    grid-template-columns: 1fr;
  }

  .dashboard-cards {
    grid-template-columns: 1fr;
  }

  .metric-card {
    width: 100%;
    justify-self: stretch;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .detail-summary,
  .person-row,
  .regular-child-row,
  .daily-record-card,
  .gallery-card,
  .daily-activity-row,
  .attendance-row,
  .activity-row,
  .finance-prices,
  .finance-overview,
  .finance-row,
  .finance-numbers,
  .payment-row,
  .expense-row,
  .equipment-form-row,
  .inline-add-row,
  .equipment-row,
  .library-layout {
    grid-template-columns: 1fr;
  }

  .plan-day-header,
  .activity-summary {
    grid-template-columns: 1fr;
  }

  .plan-day-header {
    align-items: stretch;
    flex-direction: column;
  }

  .panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .panel-actions {
    flex-direction: column;
  }

  .gallery-toolbar {
    grid-template-columns: 1fr;
  }

  .detail-dialog {
    width: 96vw;
  }
}

@media print {
  body {
    background: white;
  }

  html,
  body {
    height: auto;
  }

  .topbar,
  main,
  .tabs,
  .icon-button,
  .detail-top-actions,
  .panel-actions,
  .event-actions,
  .person-actions,
  .dialog-actions,
  .small-icon-button,
  .secondary-button,
  .primary-button,
  .danger-button {
    display: none !important;
  }

  .detail-dialog {
    position: absolute;
    inset: 0 auto auto 0;
    display: block;
    width: 100%;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
    overflow: visible;
  }

  .event-detail {
    display: block;
    max-height: none;
    overflow: visible;
  }

  .detail-top,
  .detail-summary,
  .tab-panel {
    padding-left: 0;
    padding-right: 0;
  }

  .detail-summary {
    grid-template-columns: repeat(5, 1fr);
  }

  .tab-panel.hidden {
    display: none !important;
  }

  body[data-print-tab="people"] .tab-panel {
    display: none !important;
  }

  body[data-print-tab="people"] .all-people-print.hidden,
  body[data-print-tab="people"] .all-people-print {
    display: block !important;
    padding-left: 0;
    padding-right: 0;
    font-size: 12px;
    text-align: left;
  }

  body[data-print-tab="people"] .print-people-group {
    display: block;
    clear: both;
    width: 100%;
    margin: 0 0 14px;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body[data-print-tab="people"] .print-people-group h3 {
    display: block;
    clear: both;
    width: 100%;
    margin: 0 0 4px;
    padding: 0;
    font-size: 12px;
    line-height: 1.25;
    text-align: left;
    break-after: avoid;
    page-break-after: avoid;
  }

  body[data-print-tab="people"] .people-print-table {
    width: 100%;
    table-layout: fixed;
    font-size: 12px;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body[data-print-tab="people"] .people-print-table th,
  body[data-print-tab="people"] .people-print-table td {
    border: 0;
    padding: 3px 5px;
    text-align: left;
  }

  body[data-print-tab="people"] .people-print-table tbody tr:nth-child(odd) td {
    background: #f2f2f2;
  }

  body[data-print-tab="people"] .people-print-table tbody tr:nth-child(even) td {
    background: #ffffff;
  }

  body[data-print-tab="people"] .people-print-table th:nth-child(1),
  body[data-print-tab="people"] .people-print-table td:nth-child(1) {
    width: 12ch;
  }

  body[data-print-tab="people"] .people-print-table th:nth-child(2),
  body[data-print-tab="people"] .people-print-table td:nth-child(2) {
    width: 14ch;
  }

  body[data-print-tab="people"] .people-print-table th:nth-child(3),
  body[data-print-tab="people"] .people-print-table td:nth-child(3) {
    width: 9ch;
    white-space: nowrap;
  }

  body[data-print-tab="people"] .people-print-table th:nth-child(4),
  body[data-print-tab="people"] .people-print-table td:nth-child(4) {
    width: auto;
  }

  body[data-print-tab="plan"] .activity-list.hidden,
  body[data-print-tab="plan"] .activity-details.hidden {
    display: block !important;
  }

  .person-row,
  .equipment-summary-group {
    break-inside: avoid;
    box-shadow: none;
  }

  body[data-print-tab="plan"] .plan-day {
    display: block;
    break-before: auto;
    page-break-before: auto;
    margin: 0 0 1rem;
    box-shadow: none;
  }

  body[data-print-tab="plan"] .plan-day + .plan-day {
    break-before: page;
    page-break-before: always;
  }

  body[data-print-tab="plan"] .plan-day-header {
    display: flex;
    break-after: avoid;
    page-break-after: avoid;
    margin-bottom: 0.75rem;
  }

  body[data-print-tab="plan"] .activity-list {
    display: block;
    break-before: avoid;
    page-break-before: avoid;
  }

  body[data-print-tab="plan"] .activity-row {
    display: block;
    break-inside: auto;
    page-break-inside: auto;
    margin-bottom: 0.75rem;
    box-shadow: none;
  }

  body[data-print-tab="plan"] .activity-summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
  }

  body[data-print-tab="plan"] .activity-details {
    display: block;
  }

  body[data-print-tab="plan"] .activity-equipment {
    display: flex;
  }

  textarea,
  input,
  select {
    border: 0;
  }
}
