.failed-layout {
  margin-top: 24px;
  display: grid;
  gap: 20px;
}

.failed-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.coverage-fraud-block {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
}

.refresh-stack {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.fraud-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.compact-signal-stack {
  gap: 10px;
}

.failed-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1180px;
}

.failed-table th,
.failed-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  font-size: 13px;
  text-align: right;
  white-space: nowrap;
  background: rgba(248, 246, 241, 0.96);
}

.failed-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #edf2e8;
}

.failed-table .sticky-col {
  position: sticky;
  left: 0;
  z-index: 3;
  text-align: left;
  background: #f3f5ee;
}

.failed-table tbody .sticky-col,
.failed-table tfoot .sticky-col {
  background: rgba(248, 246, 241, 1);
}

.failed-table tbody tr.cohort-row-new_customer td {
  background: rgba(244, 246, 239, 0.98);
}

.failed-table tbody tr.cohort-row-topup td {
  background: rgba(234, 241, 248, 0.98);
}

.failed-table tbody tr.cohort-row-flexidraw td {
  background: rgba(249, 240, 228, 0.98);
}

.failed-table tbody tr.cohort-row-new_customer .sticky-col {
  background: rgba(239, 242, 232, 0.99);
}

.failed-table tbody tr.cohort-row-topup .sticky-col {
  background: rgba(228, 236, 244, 0.99);
}

.failed-table tbody tr.cohort-row-flexidraw .sticky-col {
  background: rgba(244, 233, 218, 0.99);
}

.failed-table th:first-child,
.failed-table td:first-child {
  border-left: 1px solid var(--line);
}

.failed-table tbody td.month-group-cell {
  background: rgba(248, 246, 241, 1);
}

.failed-table tbody td.month-group-cell.alert-group {
  background: rgba(255, 230, 230, 0.98);
}

.failed-table tbody tr.interactive-row {
  cursor: pointer;
}

.failed-table tbody tr.cohort-row-new_customer.interactive-row:hover td {
  background: rgba(232, 238, 225, 0.98);
}

.failed-table tbody tr.cohort-row-topup.interactive-row:hover td {
  background: rgba(223, 232, 241, 0.98);
}

.failed-table tbody tr.cohort-row-flexidraw.interactive-row:hover td {
  background: rgba(242, 229, 211, 0.98);
}

.failed-table tbody tr.cohort-row-new_customer.selected-row td {
  background: rgba(221, 231, 212, 0.98);
}

.failed-table tbody tr.cohort-row-topup.selected-row td {
  background: rgba(214, 226, 238, 0.98);
}

.failed-table tbody tr.cohort-row-flexidraw.selected-row td {
  background: rgba(237, 223, 202, 0.98);
}

.failed-table tbody td.month-group-cell.selected-group {
  background: rgba(248, 246, 241, 1);
}

.failed-table tbody td.month-group-cell.alert-group.selected-group {
  background: rgba(255, 230, 230, 0.98);
}

.failed-table tfoot td {
  background: #edf2e8;
  font-weight: 700;
}

.failed-table td.alert-cell {
  color: #991b1b;
  font-weight: 700;
}

.month-cell {
  display: grid;
  gap: 4px;
}

.row-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(153, 27, 27, 0.12);
  color: #991b1b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.table-note {
  color: var(--muted);
  font-size: 11px;
}

.ai-summary-stack,
.signal-stack {
  display: grid;
  gap: 12px;
}

.summary-callout,
.summary-card,
.signal-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}

.summary-callout p,
.summary-card p,
.signal-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.summary-card-head,
.signal-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.summary-pill,
.signal-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
  color: #0f766e;
  font-size: 11px;
  font-weight: 700;
}

.summary-list {
  gap: 8px;
}

.summary-list li {
  list-style: none;
  color: var(--muted);
  line-height: 1.5;
}

.compact-callout {
  background: #f6faf8;
}

.signal-card p + p {
  margin-top: 6px;
}

.compact-signal-card {
  padding: 12px;
}

.fraud-note-wrap {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.fraud-note-wrap .manager-note-input {
  min-height: 64px;
}

.historic-fraud-grid {
  display: grid;
  gap: 12px;
}

.historic-fraud-group {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  padding: 14px;
}

.historic-fraud-group h4 {
  margin: 0 0 10px;
}

.historic-fraud-group .signal-stack {
  gap: 10px;
}

.month-detail-section {
  display: grid;
  gap: 16px;
}

.detail-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1560px;
}

.detail-table th,
.detail-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  font-size: 13px;
  text-align: left;
  vertical-align: top;
  background: rgba(248, 246, 241, 0.96);
}

.detail-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #edf2e8;
}

.detail-table .sticky-col {
  position: sticky;
  left: 0;
  z-index: 3;
  background: #f3f5ee;
}

.detail-table th:first-child,
.detail-table td:first-child {
  border-left: 1px solid var(--line);
}

.detail-cell {
  display: grid;
  gap: 4px;
}

.detail-cell span {
  color: var(--muted);
}

.tag-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.detail-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(20, 35, 31, 0.08);
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
}

.note-cell {
  display: grid;
  gap: 8px;
  min-width: 240px;
}

.manager-note-input {
  width: 100%;
  min-height: 72px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
}

.note-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}

.note-save-btn {
  padding: 6px 10px;
}

.note-status {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

@media (max-width: 1100px) {
  .failed-summary-grid {
    grid-template-columns: 1fr;
  }
}
