.exception-ledger-panel {
  display: grid;
  gap: 14px;
}

.exception-ledger-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #cfe0f4;
  background: #f7fbff;
  color: #0b315f;
  font-size: 13px;
}

.exception-ledger-summary span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #d6e4f5;
  background: #fff;
}

.exception-ledger-summary strong {
  font-size: 18px;
  line-height: 1;
}

.exception-ledger-summary .danger {
  color: #c62828;
  border-color: #ffd0d0;
  background: #fff8f8;
}

.exception-ledger-summary .warning {
  color: #9a6500;
  border-color: #ffe3a4;
  background: #fffaf0;
}

.exception-table-wrap {
  overflow: auto;
  padding: 8px;
  border: 1px solid #cfe0f4;
  background: #fff;
}

.exception-ledger-table {
  width: 100%;
  min-width: 1100px;
  border-collapse: collapse;
  color: #162235;
  font-size: 13px;
  table-layout: fixed;
}

.exception-ledger-table th,
.exception-ledger-table td {
  height: 38px;
  padding: 8px 10px;
  border: 1px solid #d5e3f4;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.exception-ledger-table th:nth-child(1),
.exception-ledger-table td:nth-child(1) {
  width: 54px;
  text-align: center;
}

.exception-ledger-table th:nth-child(2),
.exception-ledger-table td:nth-child(2) {
  width: 82px;
}

.exception-ledger-table th:nth-child(3),
.exception-ledger-table td:nth-child(3) {
  width: 128px;
}

.exception-ledger-table th:nth-child(4),
.exception-ledger-table td:nth-child(4) {
  width: 180px;
}

.exception-ledger-table th:nth-child(5),
.exception-ledger-table td:nth-child(5) {
  width: 132px;
}

.exception-ledger-table th:nth-child(6),
.exception-ledger-table td:nth-child(6) {
  width: 86px;
}

.exception-ledger-table th:nth-child(7),
.exception-ledger-table td:nth-child(7) {
  width: 110px;
}

.exception-ledger-table th:nth-child(8),
.exception-ledger-table td:nth-child(8) {
  width: 230px;
}

.exception-ledger-table th:nth-child(9),
.exception-ledger-table td:nth-child(9) {
  width: 132px;
}

.exception-ledger-table th:nth-child(10),
.exception-ledger-table td:nth-child(10) {
  width: 92px;
  text-align: center;
}

.exception-ledger-table td {
  overflow: hidden;
  text-overflow: ellipsis;
}

.exception-ledger-table th {
  background: #eaf4ff;
  color: #07315f;
  font-weight: 700;
}

.exception-ledger-table tbody tr:nth-child(even) {
  background: #f7fbff;
}

.exception-ledger-row {
  cursor: pointer;
}

.exception-ledger-row:hover,
.exception-ledger-row.selected {
  background: #eaf4ff;
}

.exception-ledger-row.danger td:first-child {
  color: #c62828;
  font-weight: 800;
}

.exception-title-cell {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.exception-severity {
  display: inline-flex;
  min-width: 52px;
  justify-content: center;
  padding: 3px 8px;
  border: 1px solid #cfe0f4;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
}

.exception-severity.red {
  color: #c62828;
  border-color: #ffb8b8;
  background: #fff2f2;
}

.exception-severity.yellow {
  color: #9a6500;
  border-color: #ffd98a;
  background: #fff7e3;
}

.exception-row-action {
  min-height: 30px;
  padding: 0 12px;
  font-size: 13px;
}

.exception-pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  color: #5f718b;
  font-size: 13px;
}

.exception-pagination.compact {
  justify-content: flex-start;
}

.exception-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(6, 22, 44, 0.28);
}

.exception-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 81;
  width: min(520px, calc(100vw - 24px));
  height: 100vh;
  overflow-y: auto;
  padding: 18px;
  border-left: 1px solid #9fc3ee;
  background: #fff;
  box-shadow: -18px 0 38px rgba(5, 28, 59, 0.18);
}

.exception-drawer-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding-bottom: 14px;
  border-bottom: 1px solid #cfe0f4;
}

.exception-drawer-header h3 {
  margin: 4px 0 0;
  color: #07315f;
  font-size: 20px;
}

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

.exception-drawer-field {
  min-width: 0;
  padding: 10px;
  border: 1px solid #d5e3f4;
  background: #f8fbff;
}

.exception-drawer-field.wide {
  grid-column: 1 / -1;
}

.exception-drawer-field span {
  display: block;
  margin-bottom: 6px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.exception-drawer-field strong {
  display: block;
  color: #162235;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.exception-resolution-drawer-form,
.exception-resolution-readonly {
  display: grid;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid #cfe0f4;
}

.exception-resolution-drawer-form label {
  display: grid;
  gap: 8px;
  color: #07315f;
  font-weight: 700;
}

.exception-resolution-drawer-form textarea {
  min-height: 110px;
  resize: vertical;
  padding: 10px;
  border: 1px solid #b8cce5;
  color: #162235;
  font: inherit;
}

.exception-drawer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.exception-resolution-readonly h4 {
  margin: 0;
  color: #07315f;
}

.exception-resolution-readonly p {
  margin: 0;
  padding: 12px;
  border: 1px solid #d5e3f4;
  background: #f8fbff;
}

.exception-resolution-readonly div {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: #64748b;
  font-size: 13px;
}

@media (max-width: 760px) {
  .exception-ledger-summary {
    align-items: stretch;
  }

  .exception-ledger-summary span {
    flex: 1 1 100%;
  }

  .exception-drawer {
    width: 100vw;
    max-width: none;
  }

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