/* Firewall module — owned by M6. Builds on app.css tokens and classes. */

.fw-head-actions { display: flex; align-items: center; gap: 8px; }

/* ---------- notices ---------- */
.fw-notice {
  border: 1px solid var(--border-strong);
  border-left-width: 3px;
  border-radius: 8px;
  padding: 10px 13px;
  font-size: 13px;
  margin-bottom: 14px;
  background: var(--panel);
  color: var(--text);
}
.fw-notice[hidden] { display: none; }
.fw-notice.ok { border-left-color: var(--ok); background: rgba(99, 214, 143, .06); }
.fw-notice.warn { border-left-color: var(--warn); background: rgba(240, 182, 75, .06); }
.fw-notice.bad { border-left-color: var(--danger); background: rgba(239, 106, 102, .06); }

/* ---------- rollback countdown ---------- */
.fw-banner {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px 18px;
  margin-bottom: 16px;
  border: 1px solid rgba(240, 182, 75, .5);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(240, 182, 75, .12), rgba(240, 182, 75, .04));
}
.fw-banner[hidden] { display: none; }
.fw-banner-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}
.fw-banner-count {
  color: var(--warn);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.fw-banner-hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
.fw-banner-actions { display: flex; gap: 8px; flex-shrink: 0; }
.fw-banner-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: rgba(255, 255, 255, .06);
}
.fw-banner-bar > span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--warn);
  transition: width .9s linear;
}

/* ---------- live state strip ---------- */
.fw-meta {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.fw-meta-item {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}
.fw-meta-label {
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.fw-meta-value {
  font-family: var(--mono);
  font-size: 13px;
  overflow-wrap: anywhere;
}

/* ---------- rules table ---------- */
.fw-card { margin-bottom: 16px; }
.fw-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.fw-table-wrap { overflow-x: auto; }
.fw-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.fw-table th {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.fw-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.fw-table tbody tr:last-child td { border-bottom: 0; }
.fw-table td.mono { font-size: 12px; }
.fw-ops { text-align: right; width: 1%; white-space: nowrap; }
.fw-remove {
  padding: 4px 9px;
  font-size: 12px;
  color: var(--danger);
}
.fw-remove:hover { background: rgba(239, 106, 102, .08); }

/* ---------- add form ---------- */
.fw-form {
  display: grid;
  grid-template-columns: 130px 100px 1fr 1.2fr 1.2fr auto;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
}
.fw-form .field { gap: 4px; }
.fw-form .field > span { font-size: 11px; color: var(--muted); }
.fw-form-submit { display: flex; }
.fw-form-submit .btn { height: 39px; }

@media (max-width: 1100px) {
  .fw-meta { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fw-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fw-form-submit { grid-column: span 2; }
  .fw-form-submit .btn { width: 100%; }
}

@media (max-width: 700px) {
  .fw-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fw-form { grid-template-columns: 1fr; }
  .fw-form-submit { grid-column: auto; }
  .fw-banner { flex-direction: column; align-items: stretch; }
  .fw-banner-actions .btn { width: 100%; }
}
