body {
  background: #f6f7f2;
  color: #243e32;
  font:
    14px -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
.shell {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  min-height: 100vh;
}
.side {
  background: #173e35;
  color: #eef2e6;
  padding: 30px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}
.brand-local {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 19px;
  margin: 0 0 32px;
}
.brand-local img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}
.brand-local small {
  display: block;
  font-size: 9px;
  letter-spacing: 1.5px;
  margin-top: 5px;
  color: #cbbd91;
}
.side nav {
  display: grid;
  gap: 5px;
}
.side nav a {
  padding: 10px 13px;
  color: #d1dbcc;
  text-decoration: none;
  border-radius: 7px;
  font-size: 13px;
}
.side nav a.active,
.side nav a:hover {
  background: #305748;
  color: #fff;
}
.side nav a.active {
  box-shadow: inset 3px 0 #c9af70;
}
.side-tools > summary {
  padding: 10px 13px;
  color: #d1dbcc;
  font-size: 13px;
  cursor: pointer;
}
.side-tools > div {
  display: grid;
  margin: 2px 0 6px 13px;
  padding-left: 7px;
  border-left: 1px solid #456959;
}
.settings-link {
  min-width: 39px;
  padding-inline: 10px;
}
.settings-link[aria-current] {
  background: #f3eedf;
  border-color: #cbbd91;
}
.side-bottom {
  margin-top: auto;
  font-size: 11px;
  line-height: 1.8;
  color: #c3ceb9;
}
.workspace {
  min-width: 0;
}
.top-local {
  height: 66px;
  border-bottom: 1px solid #e1e6da;
  background: #fff;
  padding: 0 34px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #71806b;
  font-size: 12px;
}
.main-local {
  padding: 34px;
  max-width: 1600px;
  margin: auto;
}
.page-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 4px 0 24px;
}
.page-title h1 {
  font-size: 26px;
  font-weight: 500;
  margin-bottom: 8px;
}
.page-title p {
  font-size: 12px;
  color: #7f8d77;
}
.local-banner {
  background: #f3eedf;
  color: #8d7746;
  padding: 9px 16px;
  border-radius: 6px;
  margin-bottom: 22px;
  font-size: 12px;
}
.local-error {
  background: #fff0e9;
  color: #9b412a;
  padding: 14px;
  border: 1px solid #e3baaa;
  border-radius: 6px;
  white-space: pre-wrap;
}
.btn {
  cursor: pointer;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
input,
select,
textarea {
  font: inherit;
  padding: 10px;
  border: 1px solid #dbe2d2;
  border-radius: 6px;
  background: white;
  color: inherit;
  max-width: 100%;
}
textarea {
  min-height: 94px;
  resize: vertical;
}
label.field-local {
  display: grid;
  gap: 8px;
  font-size: 12px;
}
.form-local {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.wide {
  grid-column: 1/-1;
}
.form-local footer {
  grid-column: 1/-1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}
.panel-pad {
  padding: 24px;
}
.grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.local-list {
  display: grid;
  gap: 12px;
}
.local-row {
  padding: 17px 20px;
  border: 1px solid #e0e5d8;
  border-radius: 8px;
  background: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}
.local-row p {
  font-size: 12px;
  color: #7c8875;
  line-height: 1.8;
  margin-top: 5px;
}
.text-btn {
  border: 0;
  background: transparent;
  color: #356047;
  cursor: pointer;
  text-decoration: underline;
}
.login-local {
  max-width: 460px;
  margin: 12vh auto;
  padding: 40px;
}
.login-local img {
  width: 65px;
  margin-bottom: 18px;
}
.login-local h1 {
  font-size: 28px;
}
.login-local p {
  line-height: 1.9;
  margin: 16px 0;
  color: #71806b;
}
dialog {
  width: min(900px, 94vw);
  max-height: 90vh;
  border: 1px solid #dce3d5;
  border-radius: 12px;
  padding: 30px;
  color: #243e32;
  box-shadow: 0 24px 90px #173e3533;
}
dialog::backdrop {
  background: #102d2566;
}
dialog h2 {
  font-size: 23px;
  margin-bottom: 24px;
}
dialog .error-slot {
  margin: 12px 0;
}
.calendar-layout {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 20px;
}
.calendar-controls {
  display: grid;
  align-content: start;
  gap: 15px;
}
.calendar-controls label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
}
.calendar-controls input[type="checkbox"] {
  accent-color: #36604c;
}
.cal-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-left: 1px solid #e0e5d8;
  border-top: 1px solid #e0e5d8;
  background: white;
}
.cal-cell {
  min-height: 112px;
  border-right: 1px solid #e0e5d8;
  border-bottom: 1px solid #e0e5d8;
  padding: 8px;
  overflow: hidden;
}
.cal-cell.today .date-number {
  background: #173e35;
  color: white;
  border-radius: 50%;
  padding: 4px;
}
.weekday-local {
  text-align: center;
  padding: 10px;
  font-size: 11px;
  background: #f0f3e9;
}
.event {
  display: block;
  width: 100%;
  text-align: left;
  font-size: 11px;
  line-height: 1.5;
  padding: 4px 6px;
  border: 0;
  border-radius: 4px;
  background: #e4eee0;
  color: #385e38;
  cursor: pointer;
  margin: 5px 0;
  overflow-wrap: anywhere;
}
.event.birthday {
  background: #f3e9cf;
  color: #8c7135;
}
.event.meeting {
  background: #dceaf0;
  color: #366776;
}
.event.premium_due {
  background: #eee3de;
  color: #995f47;
}
.event.case_task {
  background: #e7e2ef;
  color: #735a91;
}
.event-with-client {
  cursor: auto;
}
.event-with-client button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  overflow-wrap: anywhere;
}
.event-with-client a {
  color: inherit;
}
.agenda-grid {
  max-height: 750px;
  display: grid;
  grid-template-columns: 48px repeat(var(--days), minmax(90px, 1fr));
  background: white;
  border: 1px solid #dfe5d6;
  overflow: auto;
}
.day-agenda {
  min-width: 0;
  border-left: 1px solid #dfe5d6;
}
.day-agenda header {
  text-align: center;
  padding: 12px;
  border-bottom: 1px solid #e1e5db;
  font-size: 12px;
}
.all-day {
  min-height: 100px;
  border-bottom: 1px solid #dfe5d6;
  padding: 6px;
}
.time-column {
  height: 1440px;
  position: relative;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 59px,
    #ecf0e7 59px,
    #ecf0e7 60px
  );
}
.time-column .event {
  position: absolute;
  left: 3px;
  width: calc(100% - 6px);
  overflow: auto;
  margin: 0;
  border-left: 3px solid #5a8997;
  min-height: 24px;
}
.hours {
  font-size: 10px;
  color: #87927f;
}
.hours span {
  display: block;
  height: 60px;
  padding: 3px;
}
.pager {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  align-items: center;
  font-size: 12px;
  color: #7b8971;
}
.summary-tags {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.preview-box {
  border: 1px solid #dbe2d2;
  padding: 15px;
  border-radius: 6px;
}
.preview-box p {
  line-height: 1.8;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
}
#toast.visible {
  display: block;
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  padding: 14px 24px;
  background: #173e35;
  color: white;
  border-radius: 8px;
  z-index: 10;
}
.mobile-links {
  display: none;
}
@media (max-width: 800px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .side {
    display: none;
  }
  .top-local {
    padding: 0 16px;
  }
  .main-local {
    padding: 20px 14px 90px;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .grid-two,
  .form-local,
  .calendar-layout {
    grid-template-columns: 1fr;
  }
  .calendar-controls {
    display: flex;
    flex-wrap: wrap;
  }
  .calendar-controls input[type="date"] {
    max-width: 160px;
  }
  .page-title {
    align-items: start;
  }
  .page-title h1 {
    font-size: 23px;
  }
  .cal-cell {
    min-height: 90px;
    padding: 3px;
  }
  .cal-cell .event {
    font-size: 9px;
    padding: 2px;
  }
  .mobile-links {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    justify-content: space-around;
    padding: 16px;
    background: #173e35;
    z-index: 3;
  }
  .mobile-links a {
    color: white;
    text-decoration: none;
  }
  .preview-grid {
    grid-template-columns: 1fr;
  }
  .agenda-grid {
    display: block;
  }
  .hours {
    display: none;
  }
  .day-agenda {
    border-bottom: 1px solid #dfe5d6;
  }
  .day-agenda .time-column {
    height: auto;
    background: none;
    padding: 8px;
  }
  .time-column .event {
    position: static;
    height: auto !important;
    width: 100% !important;
    margin: 6px 0;
  }
  .all-day {
    min-height: 0;
  }
  .form-local .wide {
    grid-column: auto;
  }
}

@media (max-width: 800px) {
  .agenda-grid {
    max-height: none;
  }
}
.picker-scroll {
  max-height: 220px;
  overflow: auto;
  display: grid;
  gap: 8px;
  padding: 12px 0;
}
.picker-scroll label {
  display: block;
}
.history-entry {
  border-bottom: 1px solid var(--border, #ddd);
  padding: 14px 0;
}
.history-entry pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
}
.form-local details {
  margin: 8px 0;
  padding: 10px;
  border: 1px solid #dbe3dc;
  border-radius: 10px;
}
.form-local summary {
  cursor: pointer;
  font-weight: 600;
}
.form-local textarea[name="clientJson"] {
  min-height: 250px;
  font-family: monospace;
}
.record-filters {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 12px;
  padding: 18px;
  margin-bottom: 20px;
}
.record-filters .field-local {
  flex: 1;
  min-width: 140px;
}
.sales-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.sales-cards article {
  padding: 16px;
  background: #f6f7f1;
  border-radius: 12px;
}
.summary-chip {
  display: inline-block;
  margin: 5px;
  padding: 9px 14px;
  background: #edf2e8;
  border-radius: 16px;
  color: #315145;
}
.audit-entry {
  padding: 12px;
  border-bottom: 1px solid #e1e7dc;
}
.audit-entry summary {
  cursor: pointer;
}
.audit-entry pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
}
.agenda-grid .day-agenda header {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #fff;
}
.agenda-grid .all-day {
  position: sticky;
  top: 44px;
  z-index: 2;
  background: #fff;
}
.upload-progress {
  padding: 8px;
  color: #315145;
}
@media (max-width: 800px) {
  .sales-cards {
    grid-template-columns: 1fr;
  }
  .record-filters .field-local {
    min-width: 120px;
  }
}
.full-record {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
  max-height: 60vh;
  overflow: auto;
}
.agenda-grid .day-agenda header {
  height: 44px;
  box-sizing: border-box;
}
.agenda-grid .all-day {
  top: 44px;
  height: 112px;
  min-height: 112px;
  box-sizing: border-box;
  overflow: auto;
}
.hour-heading {
  position: sticky;
  top: 0;
  z-index: 3;
  height: 156px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #dfe5d6;
}
@media (max-width: 800px) {
  .agenda-grid .all-day {
    position: static;
    height: auto;
    min-height: 0;
  }
}

.discard-prompt {
  border: 1px solid #c5aa65;
  background: #f8f3e4;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 18px;
}
.discard-prompt p,
.conflict-comparison p {
  margin: 10px 0;
  line-height: 1.6;
}
.conflict-comparison {
  margin-top: 12px;
  border: 1px solid #dbe2d2;
  border-radius: 6px;
  padding: 14px;
  overflow-wrap: anywhere;
}
.conflict-comparison article {
  border-top: 1px solid #dbe2d2;
  padding-top: 12px;
  margin-top: 12px;
}
@media (max-width: 800px) {
  #toast.visible {
    bottom: 76px;
    width: calc(100% - 32px);
    text-align: center;
  }
}
.side-tools > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 5px 0 8px 13px;
}
.side-tools > summary {
  cursor: pointer;
  padding: 10px 12px;
  border-radius: 8px;
}
.side-tools a {
  font-size: 13px;
}
.side-tools a[href="#statistics"] {
  border-top: 1px solid #dce5df;
  margin-top: 6px;
  padding-top: 12px;
}
.mobile-category {
  margin: 12px 0;
  background: white;
  border: 1px solid #dce5df;
  border-radius: 10px;
}
.mobile-category a {
  display: block;
  padding: 10px;
  color: #173e35;
  text-decoration: none;
}
.mobile-category a.active {
  background: #e8f2ed;
  font-weight: 600;
}
/* Same policy draft, two reading/entry orders. */
.policy-toolbar {
  border-bottom: 1px solid var(--line, #dce3de);
  padding-bottom: 12px;
}
.policy-modes,
.policy-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.policy-steps [aria-current="step"] {
  font-weight: 700;
  color: var(--green, #173e35);
  text-decoration: underline;
}
.policy-section h3 {
  margin: 8px 0 14px;
  font-size: 16px;
}
.policy-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.policy-fields > .wide {
  grid-column: 1/-1;
}
.policy-fields label {
  min-width: 0;
}
.policy-more {
  border-top: 1px solid #dce3de;
  padding-top: 12px;
}
.policy-more summary {
  cursor: pointer;
  margin-bottom: 12px;
}
.policy-section[hidden],
.policy-steps[hidden],
.policy-more[hidden],
.form-local button[hidden] {
  display: none;
}
@media (max-width: 600px) {
  .policy-fields {
    grid-template-columns: 1fr;
  }
}
.stat-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.stat-link:hover,
.stat-link:focus-visible {
  outline: 2px solid #b59a5d;
  outline-offset: 2px;
}
.account-title {
  border: 0;
  padding: 0;
  background: none;
  color: #173e35;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.account-title:hover {
  color: #947a39;
}
.account-amount {
  font-weight: 600;
}
.account-contribution {
  border-top: 1px solid #e0e7e2;
  padding: 12px 0;
}

/* Keep controls aligned even when a field has an explanatory currency hint. */
.policy-fields {
  align-items: start;
}
.policy-fields .field-local {
  align-content: start;
}
.client-filter-options .filters {
  align-items: start;
}
.client-filter-options .field-local {
  flex: 1 1 150px;
  min-width: 140px;
}
.client-filter-options .field-local > :is(input, select) {
  width: 100%;
  min-height: 40px;
}
/* Wrapping these existing inputs in labels must not shrink their text. */
.client-filter-options input[name="institution"],
.client-filter-options input[name="tag"] {
  font-size: 14px;
}
.directory-panel > .filters > .pager {
  margin-left: auto;
  padding: 0;
  flex-wrap: wrap;
  gap: 8px;
}
.pager .actions {
  flex-wrap: wrap;
  gap: 5px;
}
.pager [aria-current="page"] {
  background: #e7eddf;
  color: #173e35;
  opacity: 1;
}
.payment-missing {
  font-size: 11px;
  color: #786947;
  max-width: 230px;
  text-align: left;
}

.policy-fields .field-local > :is(input:not([type="checkbox"]), select) {
  height: 42px;
  box-sizing: border-box;
}
