#tab-society-maintenance {
  --society-ink: #172033;
  --society-muted: #66758a;
  --society-line: #dfe5ec;
  --society-soft: #f5f7fa;
  --society-navy: #173f5f;
  --society-teal: #1c7c7d;
}

#tab-society-maintenance.active {
  display: block;
}

.society-shell {
  min-height: calc(100vh - 112px);
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  overflow: hidden;
  color: var(--society-ink);
  background: #f2f5f8;
  border: 1px solid #d9e0e8;
  border-radius: 22px;
}

.society-sidebar {
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  color: #f7fbff;
  background:
    radial-gradient(circle at 20% 4%, rgba(55, 172, 173, 0.24), transparent 34%),
    linear-gradient(165deg, #123652, #102a43 58%, #0c2237);
}

.society-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.society-brand > span {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(145deg, #2a9998, #187170);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.24);
}

.society-brand strong,
.society-brand small {
  display: block;
}

.society-brand strong {
  font-size: 17px;
}

.society-brand small {
  margin-top: 2px;
  color: #b9ccda;
}

.society-sidebar nav {
  display: grid;
  gap: 7px;
  margin-top: 24px;
}

.society-sidebar nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 13px;
  border: 0;
  border-radius: 11px;
  color: #c9d8e4;
  background: transparent;
  font: inherit;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}

.society-sidebar nav button:hover,
.society-sidebar nav button.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.society-sidebar nav button.active {
  box-shadow: inset 3px 0 #42b6b5;
}

.society-admin-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: #d7e5ef;
  background: rgba(255, 255, 255, 0.07);
}

.society-admin-note span,
.society-admin-note strong,
.society-admin-note small {
  display: block;
}

.society-admin-note small {
  margin-top: 2px;
  color: #9fb6c7;
}

.society-main {
  min-width: 0;
  padding: 30px;
}

.society-notice {
  margin-bottom: 18px;
  padding: 12px 15px;
  border: 1px solid #b8cfe1;
  border-radius: 11px;
  color: #244d6b;
  background: #edf6fc;
  font-weight: 650;
}

.society-notice[data-tone="success"] {
  border-color: #abd9c2;
  color: #19613c;
  background: #effaf4;
}

.society-notice[data-tone="error"] {
  border-color: #efb7b7;
  color: #9a2d2d;
  background: #fff2f2;
}

.society-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 28px;
  border-radius: 20px;
  color: #fff;
  background:
    radial-gradient(circle at 92% 20%, rgba(84, 203, 200, 0.34), transparent 28%),
    linear-gradient(128deg, #143b59, #1b6870);
  box-shadow: 0 18px 45px rgba(19, 52, 77, 0.18);
}

.society-kicker,
.society-card-head span,
.society-form-section-head span {
  display: block;
  margin-bottom: 7px;
  color: #6a7a8f;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.society-hero .society-kicker {
  color: #a7e4e1;
}

.society-hero h2,
.society-view-heading h2,
.society-card h3,
.society-form h3 {
  margin: 0;
}

.society-hero h2 {
  font-size: clamp(25px, 3vw, 38px);
}

.society-hero p,
.society-view-heading p {
  margin: 8px 0 0;
  color: #cce0e8;
}

.society-hero .primary-btn {
  color: #173f5f;
  background: #fff;
}

.society-stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin: 20px 0;
}

.society-stat-grid article {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 17px;
  border: 1px solid var(--society-line);
  border-radius: 16px;
  background: #fff;
}

.society-stat-grid article > span {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 13px;
  color: #1e668d;
  background: #e8f4fb;
}

.society-stat-grid article[data-tone="green"] > span {
  color: #267b50;
  background: #e9f7ef;
}

.society-stat-grid article[data-tone="orange"] > span {
  color: #b25d19;
  background: #fff2e7;
}

.society-stat-grid article[data-tone="violet"] > span {
  color: #6c50a7;
  background: #f0ecfb;
}

.society-stat-grid article[data-tone="cyan"] > span {
  color: #16787c;
  background: #e5f5f4;
}

.society-stat-grid small,
.society-stat-grid strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.society-stat-grid small {
  margin-bottom: 4px;
  color: var(--society-muted);
}

.society-stat-grid strong {
  font-size: 17px;
}

.society-overview-grid,
.society-split-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.society-split-layout {
  grid-template-columns: minmax(300px, 0.76fr) minmax(0, 1.5fr);
  align-items: start;
}

.society-card {
  min-width: 0;
  border: 1px solid var(--society-line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(29, 50, 74, 0.055);
}

.society-card-head,
.society-form-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 22px;
  border-bottom: 1px solid #e9edf2;
}

.society-link-btn {
  padding: 6px;
  border: 0;
  color: #176d79;
  background: transparent;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.society-activity-list > div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 15px 20px;
  border-bottom: 1px solid #edf0f4;
}

.society-activity-list > div:last-child {
  border-bottom: 0;
}

.society-activity-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  color: #236a86;
  background: #e9f3f8;
}

.society-activity-list p {
  min-width: 0;
  margin: 0;
}

.society-activity-list p strong,
.society-activity-list p small,
.society-activity-list > div > div > strong {
  display: block;
}

.society-activity-list p small {
  margin-top: 4px;
  overflow: hidden;
  color: var(--society-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.society-activity-list > div > div {
  text-align: right;
}

.society-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #536274;
  background: #edf1f5;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.society-status-pill[data-tone="cleared"],
.society-status-pill[data-tone="occupied"] {
  color: #21734a;
  background: #e7f5ed;
}

.society-status-pill[data-tone="pending_clearance"],
.society-status-pill[data-tone="due"] {
  color: #9d551b;
  background: #fff0e4;
}

.society-status-pill[data-tone="bounced"],
.society-status-pill[data-tone="cancelled"],
.society-status-pill[data-tone="inactive"] {
  color: #a23b3b;
  background: #fdecec;
}

.society-status-pill[data-tone="admin"] {
  color: #5b4b9a;
  background: #eeebfa;
}

.society-empty {
  display: grid;
  min-height: 190px;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 28px;
  color: var(--society-muted);
  text-align: center;
}

.society-empty > i {
  font-size: 30px;
  color: #93a3b5;
}

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

.society-view-heading {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

.society-view-heading > span {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  place-items: center;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(145deg, #1c7c7d, #165a68);
}

.society-view-heading p {
  color: var(--society-muted);
}

.society-form {
  padding-bottom: 20px;
}

.society-sticky-form {
  position: sticky;
  top: 16px;
}

.society-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px;
  padding: 22px;
}

.society-form-grid.compact {
  gap: 14px;
}

.society-form-grid .full {
  grid-column: 1 / -1;
}

.society-form label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.society-form label > span {
  color: #44546a;
  font-size: 12px;
  font-weight: 750;
}

.society-form input,
.society-form select,
.society-form textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 11px;
  border: 1px solid #cfd7e1;
  border-radius: 10px;
  color: var(--society-ink);
  background: #fff;
  font: inherit;
}

.society-form textarea {
  resize: vertical;
}

.society-form input:focus,
.society-form select:focus,
.society-form textarea:focus {
  border-color: #238b8c;
  outline: 3px solid rgba(35, 139, 140, 0.12);
}

.society-form-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0 22px;
}

.society-instrument-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 14px;
  border: 1px dashed #cad4df;
  border-radius: 12px;
  background: #f7f9fb;
}

.society-instrument-fields[hidden] {
  display: none;
}

.society-demand-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 12px;
  color: #fff;
  background: #173f5f;
}

.society-demand-total strong {
  font-size: 20px;
}

.society-table-wrap {
  overflow: auto;
}

.society-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.society-table th,
.society-table td {
  padding: 13px 14px;
  border-bottom: 1px solid #edf0f4;
  text-align: left;
  vertical-align: middle;
}

.society-table th {
  position: sticky;
  top: 0;
  color: #637287;
  background: #f8fafc;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.society-table td strong,
.society-table td small {
  display: block;
}

.society-table td small {
  margin-top: 4px;
  color: var(--society-muted);
}

.society-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.society-icon-btn,
.society-small-btn {
  border: 1px solid #cdd7e1;
  border-radius: 8px;
  color: #285a73;
  background: #fff;
  cursor: pointer;
}

.society-icon-btn {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
}

.society-small-btn {
  padding: 6px 8px;
  font-size: 10px;
  font-weight: 800;
}

.society-small-btn.danger {
  color: #a33c3c;
}

@media (max-width: 1180px) {
  .society-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .society-split-layout {
    grid-template-columns: 1fr;
  }

  .society-sticky-form {
    position: static;
  }
}

@media (max-width: 800px) {
  .society-shell {
    grid-template-columns: 1fr;
  }

  .society-sidebar {
    padding: 14px;
  }

  .society-brand,
  .society-admin-note {
    display: none;
  }

  .society-sidebar nav {
    grid-template-columns: repeat(5, minmax(110px, 1fr));
    margin: 0;
    overflow-x: auto;
  }

  .society-sidebar nav button {
    justify-content: center;
    padding: 10px;
  }

  .society-main {
    padding: 18px;
  }

  .society-hero,
  .society-overview-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .society-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .society-main {
    padding: 12px;
  }

  .society-sidebar nav button span {
    display: none;
  }

  .society-stat-grid,
  .society-form-grid,
  .society-instrument-fields {
    grid-template-columns: 1fr;
  }

  .society-form-grid .full {
    grid-column: auto;
  }
}
