.tp-warning-panel {
  margin-bottom: 1.25rem;
}

.tp-warning-filters {
  display: grid;
  grid-template-columns: minmax(190px, 1.6fr) repeat(3, minmax(130px, 1fr)) auto;
  gap: .7rem;
  align-items: end;
  margin-bottom: .9rem;
  padding: .8rem;
  border: 1px solid #eef2f8;
  border-radius: 11px;
  background: #fafcff;
}

.tp-warning-filters label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: .3rem;
  color: #64708c;
  font-size: 10px;
  font-weight: 800;
}

.tp-warning-filters input,
.tp-warning-filters select {
  width: 100%;
  min-height: 36px;
  padding: .5rem .62rem;
  border: 1px solid #dfe6f1;
  border-radius: 8px;
  outline: 0;
  background: #fff;
  color: #1c2b4a;
  font-size: 11px;
}

.tp-warning-filters input:focus,
.tp-warning-filters select:focus {
  border-color: #2f6ae6;
  box-shadow: 0 0 0 3px rgba(47, 106, 230, .1);
}

.tp-warning-filter-actions {
  display: flex;
  gap: .45rem;
}

.tp-warning-table {
  min-width: 1050px;
}

.tp-warning-condition {
  display: inline-flex;
  max-width: 360px;
  align-items: center;
  padding: .27rem .5rem;
  border-radius: 6px;
  background: #f1f4fa;
  color: #1c2b4a;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.45;
}

.tp-warning-condition--block {
  display: block;
  max-width: none;
  padding: .65rem .75rem;
}

.tp-warning-switch {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: .38rem;
  padding: .25rem .55rem .25rem .35rem;
  border: 1px solid #dfe6f1;
  border-radius: 999px;
  background: #fff;
  color: #64708c;
  font-size: 10px;
  font-weight: 800;
}

.tp-warning-switch > span {
  position: relative;
  width: 27px;
  height: 16px;
  border-radius: 999px;
  background: #cfd7e4;
  transition: background .16s ease;
}

.tp-warning-switch > span::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(28, 43, 74, .25);
  content: "";
  transition: transform .16s ease;
}

.tp-warning-switch.is-on > span { background: #2f6ae6; }
.tp-warning-switch.is-on > span::after { transform: translateX(11px); }
.tp-warning-switch:hover { border-color: #2f6ae6; color: #2f6ae6; }
.tp-warning-switch:disabled { cursor: wait; opacity: .55; }
.tp-warning-switch em { font-style: normal; }

.tp-warning-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  margin-top: .75rem;
  color: #64708c;
  font-size: 11px;
}

.tp-warning-pagination > div {
  display: flex;
  gap: .4rem;
}

.tp-warning-footnote {
  display: flex;
  align-items: flex-start;
  gap: .4rem;
  margin-top: .75rem;
  padding-top: .7rem;
  border-top: 1px solid #eef2f8;
  color: #7a859d;
  font-size: 10px;
  line-height: 1.6;
}

.tp-warning-access {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: 1rem;
  border: 1px solid #e1e7f0;
  border-radius: 10px;
  background: #f8fafc;
  color: #475470;
}

.tp-warning-access > i {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #eef2f8;
  color: #64708c;
}

.tp-warning-access strong { color: #1c2b4a; font-size: 12px; }
.tp-warning-access p { margin-top: .2rem; color: #7a859d; font-size: 11px; }

.tp-warning-form [hidden] { display: none !important; }

.tp-warning-roles {
  min-width: 0;
  padding: .75rem;
  border: 1px solid #dfe6f1;
  border-radius: 9px;
}

.tp-warning-roles legend {
  padding: 0 .25rem;
  color: #475470;
  font-size: 12px;
  font-weight: 800;
}

.tp-warning-roles > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .5rem;
}

.tp-warning-role {
  display: flex;
  align-items: center;
  gap: .48rem;
  min-width: 0;
  padding: .5rem .58rem;
  border: 1px solid #eef2f8;
  border-radius: 8px;
  background: #fafcff;
  color: #1c2b4a;
  font-size: 11px;
  font-weight: 800;
}

.tp-warning-role input {
  width: 16px;
  min-height: 16px;
  accent-color: #2f6ae6;
}

.tp-warning-role span { min-width: 0; }
.tp-warning-role small { display: block; color: #7a859d; font-size: 9px; font-weight: 500; }

.tp-warning-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
  margin-bottom: .85rem;
}

.tp-warning-detail-grid > div {
  min-width: 0;
  padding: .7rem .75rem;
  border: 1px solid #eef2f8;
  border-radius: 9px;
  background: #fafcff;
}

.tp-warning-detail-grid > div > span {
  display: block;
  margin-bottom: .25rem;
  color: #7a859d;
  font-size: 10px;
  font-weight: 700;
}

.tp-warning-detail-grid strong {
  color: #1c2b4a;
  font-size: 11px;
}

.tp-warning-detail-grid code {
  color: #1e50c4;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 10px;
  word-break: break-all;
}

.tp-warning-detail-kpis {
  margin-bottom: .9rem;
}

.tp-warning-detail-kpis .tp2-kpi__value {
  font-size: 18px;
}

.tp-warning-subtitle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: .3rem 0 .55rem;
  color: #1c2b4a;
  font-size: 13px;
  font-weight: 900;
}

.tp-warning-subtitle small { color: #7a859d; font-size: 10px; font-weight: 600; }
.tp-warning-log-table { min-width: 800px; }

.tp-warning-preview-notice {
  display: flex;
  align-items: flex-start;
  gap: .45rem;
  margin-bottom: .8rem;
  padding: .65rem .75rem;
  border: 1px solid rgba(34, 165, 88, .18);
  border-radius: 9px;
  background: rgba(34, 165, 88, .07);
  color: #168046;
  font-size: 11px;
  line-height: 1.55;
}

.tp-warning-preview-notice.is-warning {
  border-color: rgba(245, 166, 35, .25);
  background: rgba(245, 166, 35, .09);
  color: #a96606;
}

.tp-warning-kpi-text {
  overflow: hidden;
  font-size: 12px !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tp-warning-result-note {
  margin-top: .55rem;
  font-size: 10px;
  text-align: right;
}

@media (max-width: 1180px) {
  .tp-warning-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tp-warning-filter-actions { align-self: end; }
}

@media (max-width: 760px) {
  .tp-warning-filters,
  .tp-warning-detail-grid,
  .tp-warning-roles > div { grid-template-columns: 1fr; }
  .tp-warning-filter-actions { flex-wrap: wrap; }
  .tp-warning-pagination { align-items: flex-start; flex-direction: column; }
  .tp-warning-kpis,
  .tp-warning-detail-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
