/* Shared page patterns for the performance contract, action tracker and events modules. */
.module-page {
  max-width: 1440px;
  margin: 0 auto;
  padding: 26px 28px 44px;
}

.module-page-head,
.module-toolbar,
.module-toolbar-group,
.module-page-actions,
.module-tabs,
.module-table-actions,
.pc-modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.module-page-head {
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.module-page-title {
  margin: 0;
  color: #102c53;
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  line-height: 1.25;
  font-weight: 800;
}

.module-page-description {
  margin: 6px 0 0;
  color: #66758b;
  font-size: 0.9rem;
  line-height: 1.55;
}

.module-page-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.module-btn {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: #29415f;
  padding: 8px 13px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease, transform .16s ease;
}

.module-btn:hover {
  border-color: #8db5e9;
  background: #f2f7ff;
  transform: translateY(-1px);
}

.module-btn-primary {
  border-color: #1256ab;
  background: #1256ab;
  color: #fff;
}

.module-btn-primary:hover {
  border-color: #0b438c;
  background: #0b438c;
  color: #fff;
}

.module-btn-danger {
  color: #b42335;
}

.module-btn-small {
  min-height: 31px;
  padding: 5px 9px;
  font-size: 0.76rem;
}

.module-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  margin: 0 0 18px;
}

.module-summary-card {
  min-height: 91px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  padding: 15px 17px;
  box-shadow: 0 2px 7px rgba(16, 44, 83, .04);
}

.module-summary-label {
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .055em;
}

.module-summary-value {
  margin-top: 8px;
  color: #102c53;
  font-size: 1.45rem;
  font-weight: 800;
}

.module-panel {
  overflow: hidden;
  border: 1px solid #e1e8f0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(16, 44, 83, .04);
}

.module-toolbar {
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-bottom: 1px solid #e7edf4;
}

.module-toolbar-group {
  flex-wrap: wrap;
}

.module-search,
.module-select,
.module-input,
.module-textarea {
  min-height: 38px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: #1e293b;
  padding: 8px 11px;
  font: inherit;
  font-size: 0.84rem;
}

.module-search {
  width: min(340px, 75vw);
}

.module-select {
  min-width: 160px;
}

.module-input,
.module-textarea {
  width: 100%;
}

.module-textarea {
  min-height: 88px;
  resize: vertical;
}

.module-table-wrap {
  overflow-x: auto;
}

.module-table {
  width: 100%;
  min-width: 1020px;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.module-table th {
  padding: 12px 13px;
  background: #f3f6fa;
  color: #53657b;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: .045em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.module-table td {
  padding: 12px 13px;
  border-top: 1px solid #edf1f6;
  color: #334155;
  vertical-align: middle;
}

.module-table tbody tr:hover {
  background: #f8fbff;
}

.module-table-actions {
  flex-wrap: nowrap;
}

.module-empty {
  padding: 32px 18px;
  color: #718096;
  text-align: center;
}

.module-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: .71rem;
  font-weight: 800;
  white-space: nowrap;
}

.module-status.is-done {
  background: #ecfdf3;
  color: #067647;
}

.module-status.is-risk {
  background: #fff1f0;
  color: #b42335;
}

.pc-category-filter {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 15px;
  border-bottom: 1px solid #e7edf4;
}

.pc-category-button {
  flex: 0 0 auto;
  border: 1px solid #d7e0eb;
  border-radius: 999px;
  background: #fff;
  color: #4f627a;
  padding: 8px 13px;
  font: inherit;
  font-size: .78rem;
  font-weight: 750;
  cursor: pointer;
}

.pc-category-button:hover,
.pc-category-button.active {
  border-color: #1256ab;
  background: #1256ab;
  color: #fff;
}

.pc-code {
  color: #1256ab;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 800;
}

.pc-kpi-title {
  max-width: 360px;
  color: #142b4a;
  font-weight: 750;
  line-height: 1.4;
}

.pc-progress {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pc-progress-track {
  width: 78px;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6edf4;
}

.pc-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: #2474d2;
}

.pc-gantt {
  display: none;
  padding: 16px;
}

.pc-gantt.active {
  display: block;
}

.pc-gantt-category {
  margin: 0 0 14px;
  border: 1px solid #e1e8f0;
  border-radius: 9px;
  background: #fff;
}

.pc-gantt-heading {
  padding: 12px 14px;
  border-bottom: 1px solid #e7edf4;
  color: #102c53;
  font-size: .9rem;
  font-weight: 800;
}

.pc-gantt-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) minmax(260px, 2fr) 130px;
  gap: 14px;
  align-items: center;
  padding: 11px 14px;
  border-top: 1px solid #f0f3f7;
  font-size: .78rem;
}

.pc-quarter-bars {
  display: grid;
  grid-template-columns: repeat(4, minmax(42px, 1fr));
  gap: 8px;
}

.pc-quarter {
  color: #64748b;
  font-size: .66rem;
}

.pc-quarter-track {
  height: 7px;
  margin-top: 4px;
  overflow: hidden;
  border-radius: 99px;
  background: #e9eff6;
}

.pc-quarter-fill {
  height: 100%;
  border-radius: inherit;
  background: #2878d0;
}

.module-modal-overlay {
  position: fixed;
  z-index: 1200;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 20px;
  background: rgba(8, 23, 43, .62);
}

.module-modal-overlay.active {
  display: flex;
}

.module-modal-card {
  width: min(900px, 100%);
  max-height: min(92vh, 1000px);
  overflow-y: auto;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .26);
}

.module-modal-head {
  position: sticky;
  z-index: 1;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 20px;
  border-bottom: 1px solid #e5eaf1;
  background: #fff;
}

.module-modal-head h3 {
  margin: 0;
  color: #102c53;
  font-size: 1.05rem;
}

.module-modal-body {
  padding: 20px;
}

.module-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.module-form-field label {
  display: block;
  margin-bottom: 5px;
  color: #53657b;
  font-size: .74rem;
  font-weight: 750;
}

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

.module-form-field .module-input,
.module-form-field .module-select,
.module-form-field .module-textarea {
  box-sizing: border-box;
}

.module-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 14px 20px;
  border-top: 1px solid #e5eaf1;
}

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

.pc-detail-item {
  padding: 11px 12px;
  border: 1px solid #e8edf3;
  border-radius: 8px;
  background: #f9fbfd;
}

.pc-detail-label {
  color: #68798e;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.pc-detail-value {
  margin-top: 5px;
  color: #223b5b;
  font-size: .85rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.event-view-toggle {
  display: inline-flex;
  gap: 3px;
  border: 1px solid #d8e1ec;
  border-radius: 8px;
  background: #f5f8fc;
  padding: 3px;
}

.event-view-toggle button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #596d85;
  padding: 7px 10px;
  font: inherit;
  font-size: .77rem;
  font-weight: 750;
  cursor: pointer;
}

.event-view-toggle button.active {
  background: #fff;
  color: #1256ab;
  box-shadow: 0 1px 4px rgba(15, 23, 42, .12);
}

.event-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 16px;
}

.event-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 13px;
  min-height: 175px;
  padding: 15px;
  border: 1px solid #e0e7ef;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(16, 44, 83, .035);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.event-card:hover {
  transform: translateY(-2px);
  border-color: #bfd4ef;
  box-shadow: 0 8px 18px rgba(16, 44, 83, .09);
}

.event-date-block {
  align-self: start;
  overflow: hidden;
  border: 1px solid #d8e5f3;
  border-radius: 8px;
  background: #f2f7fd;
  text-align: center;
}

.event-date-month {
  display: block;
  padding: 4px 2px;
  background: #1256ab;
  color: #fff;
  font-size: .62rem;
  font-weight: 800;
  text-transform: uppercase;
}

.event-date-day {
  display: block;
  padding: 5px 2px 6px;
  color: #163c6e;
  font-size: 1.25rem;
  font-weight: 850;
}

.event-card-title {
  margin: 7px 0 5px;
  color: #152e50;
  font-size: .94rem;
  font-weight: 800;
  line-height: 1.38;
}

.event-card-description {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 10px;
  color: #66758b;
  font-size: .77rem;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.event-card-meta {
  display: grid;
  gap: 5px;
  color: #53657b;
  font-size: .72rem;
  line-height: 1.4;
}

.event-card-meta strong {
  color: #334b69;
}

.event-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.event-agenda {
  display: none;
  padding: 7px 16px 16px;
}

.event-agenda.active {
  display: block;
}

.event-agenda-row {
  display: grid;
  grid-template-columns: 135px minmax(0, 1fr) auto;
  gap: 15px;
  align-items: center;
  padding: 13px 4px;
  border-top: 1px solid #edf1f6;
}

.event-agenda-date {
  color: #53657b;
  font-size: .8rem;
  font-weight: 700;
}

.event-agenda-title {
  color: #173354;
  font-weight: 800;
}

.event-agenda-location {
  margin-top: 3px;
  color: #75849a;
  font-size: .75rem;
}

.module-inline-note {
  padding: 11px 16px;
  color: #64748b;
  font-size: .77rem;
}

.module-notice {
  margin: 0 0 16px;
  padding: 11px 14px;
  border: 1px solid #b8e5cd;
  border-radius: 8px;
  background: #effaf4;
  color: #17623a;
  font-size: .84rem;
  font-weight: 700;
}

.module-error {
  margin: 0 0 16px;
  padding: 11px 14px;
  border: 1px solid #f3bdc3;
  border-radius: 8px;
  background: #fff4f4;
  color: #9f2638;
  font-size: .84rem;
  font-weight: 700;
}

.event-month-label {
  align-self: center;
  color: #596d85;
  font-size: .75rem;
  font-weight: 750;
}

.event-modal-card {
  width: min(760px, 100%);
}

.audit-filter-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-items: end;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid #e5eaf1;
}

.audit-filter-form .module-form-field {
  min-width: 0;
}

.audit-filter-form .module-search,
.audit-filter-form .module-input,
.audit-filter-form .module-select {
  width: 100%;
}

.audit-search-field {
  grid-column: span 2;
}

.audit-filter-actions,
.audit-pagination > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.audit-filter-actions {
  grid-column: span 2;
  flex-wrap: wrap;
}

.audit-table-wrap {
  margin: 16px;
  width: calc(100% - 32px);
}

.audit-table {
  min-width: 1050px;
}

.audit-time,
.audit-ip {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: nowrap;
  font-size: .76rem;
}

.audit-user-id {
  display: block;
  margin-top: 3px;
  color: #8290a3;
  font-size: .65rem;
  font-weight: 600;
}

.audit-description {
  min-width: 260px;
  max-width: 460px;
  white-space: normal;
  line-height: 1.5;
}

.audit-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 16px 12px;
  color: #64748b;
  font-size: .76rem;
}

.audit-privacy-note {
  margin: 0 16px 16px;
  color: #718096;
  font-size: .72rem;
  line-height: 1.5;
}

@media (max-width: 700px) {
  .audit-search-field,
  .audit-filter-actions {
    grid-column: 1 / -1;
  }
}

.action-issue {
  max-width: 260px;
  line-height: 1.5;
}

.action-delete-form {
  display: inline;
  margin: 0;
}

.action-modal-card {
  width: min(860px, 100%);
}

@media (max-width: 980px) {
  .event-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .module-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .module-page { padding: 18px 12px 32px; }
  .module-page-head { align-items: flex-start; flex-direction: column; }
  .module-page-actions { justify-content: flex-start; }
  .module-toolbar { align-items: stretch; }
  .module-toolbar-group { width: 100%; }
  .module-search { width: 100%; }
  .module-select { flex: 1; min-width: 135px; }
  .event-grid { grid-template-columns: 1fr; }
  .pc-gantt-row { grid-template-columns: 1fr; gap: 9px; }
  .pc-detail-grid,
  .module-form-grid { grid-template-columns: 1fr; }
  .module-form-field.full { grid-column: auto; }
  .event-agenda-row { grid-template-columns: 1fr; gap: 5px; }
  .event-agenda-row .module-status { justify-self: start; }
}
