.exception-rule-dialog {
  width: min(1040px, calc(100vw - 32px));
  max-height: min(860px, calc(100vh - 32px));
  padding: 0;
  color: #111a55;
  border: 1px solid #d8deef;
  border-radius: 6px;
  box-shadow: 0 28px 80px rgba(9, 17, 62, 0.24);
}

.exception-rule-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  min-height: 520px;
}

.exception-rule-list-panel,
.exception-rule-editor-panel {
  min-width: 0;
  padding: 18px;
}

.exception-rule-list-panel {
  border-right: 1px solid #dfe4f1;
}

.exception-rule-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.exception-rule-list {
  max-height: 350px;
  display: grid;
  gap: 8px;
  overflow: auto;
  padding-right: 4px;
}

.exception-rule-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.exception-rule-summary article {
  min-width: 0;
  padding: 10px;
  border: 1px solid #dfe4f1;
  background: #f7f9fd;
}

.exception-rule-summary span,
.exception-rule-summary small {
  display: block;
  color: #5b658d;
  font-size: 10px;
}

.exception-rule-summary strong {
  display: block;
  margin: 4px 0 2px;
  font-size: 15px;
}

.exception-rule-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px;
  border: 1px solid #dfe4f1;
  background: #fff;
}

.exception-rule-row.is-disabled {
  opacity: 0.58;
}

.exception-rule-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.exception-rule-main strong,
.exception-rule-main small {
  display: block;
  overflow-wrap: anywhere;
}

.exception-rule-main small {
  margin-top: 3px;
  color: #5b658d;
  font-size: 11px;
}

.exception-rule-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 7px;
  color: #5b658d;
  font-size: 10px;
}

.exception-rule-meta b {
  padding: 3px 6px;
  color: #111a55;
  background: #eef2ff;
  border: 1px solid #dfe4f1;
  font-size: 10px;
}

.exception-rule-meta em {
  font-style: normal;
  line-height: 20px;
}

.exception-rule-actions {
  display: flex;
  gap: 5px;
}

.danger-icon:not(:disabled) {
  color: #cc334f;
}

.exception-rule-audit {
  margin: 16px 0 0;
  padding: 12px 0 0;
  border-top: 1px solid #e5e9f4;
  list-style: none;
}

.exception-rule-audit li {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 8px;
  padding: 5px 0;
  font-size: 11px;
}

.exception-rule-audit span {
  color: #5b658d;
  overflow-wrap: anywhere;
}

.exception-rule-form {
  display: grid;
  gap: 12px;
}

.exception-rule-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.exception-rule-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: Inter, sans-serif;
  font-size: 12px;
  color: #25305f;
}

.exception-rule-metric-hint {
  color: #5b658d;
  font-size: 11px;
}

.table-tools {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.public-demo-mode #uploadButton,
.public-demo-mode #downloadButton,
.public-demo-mode #manageExceptionRules {
  display: none !important;
}

@media (max-width: 760px) {
  .exception-rule-layout {
    grid-template-columns: 1fr;
  }

  .exception-rule-list-panel {
    border-right: 0;
    border-bottom: 1px solid #dfe4f1;
  }

  .exception-rule-grid {
    grid-template-columns: 1fr;
  }

  .exception-rule-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .exception-rule-row {
    grid-template-columns: 1fr;
  }

  .exception-rule-actions {
    justify-content: flex-end;
  }
}
