/* Threat Model Builder – tool-specific styles (no inline CSS) */

.tm-root{ margin-top: 16px; }

/* Sticky action bar (keeps existing button placement at top of the table area) */
.tm-sticky{
  position: sticky;
  top: 0;
  z-index: 20;
  margin-bottom: 14px;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  background: rgba(10, 14, 39, 0.92);
  backdrop-filter: blur(8px);
}

.tm-sticky-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  flex-wrap: wrap;
}

.tm-actions{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* Summary cards */
.tm-summary{
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
@media (max-width: 980px){
  .tm-summary{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.tm-summary-card{
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255,255,255,0.02);
}
.tm-summary-label{
  font-size: .85rem;
  color: var(--text-secondary);
}
.tm-summary-value{
  margin-top: 6px;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--accent);
}

/* Table shell */
.tm-table-wrap{
  border: 1px solid var(--border-color);
  border-radius: 18px;
  background: rgba(255,255,255,0.02);
  overflow: auto;
}

.tm-table{
  width: 100%;
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.92rem;
}
.tm-table thead th{
  position: sticky;
  top: 0px; /* below sticky bar */
  z-index: 10;
  background: rgba(19, 26, 49, 0.98);
  color: rgba(231,236,255,0.92);
  text-align: left;
  font-weight: 700;
  padding: 10px 10px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}
@media (max-width: 980px){
  .tm-table thead th{ top: 0; }
}

.tm-table tbody td{
  padding: 10px 10px;
  border-bottom: 1px solid rgba(31, 42, 68, 0.7);
  vertical-align: top;
}
.tm-table tbody tr:last-child td{ border-bottom: 0; }

.tm-input, .tm-select{
  width: 100%;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: rgba(255,255,255,0.03);
  color: var(--text-primary);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}
.tm-date{
  width: 160px;
}

.tm-mini-link{
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: transparent;
  border: 0;
  cursor: pointer;
}
.tm-mini-link:hover{ color: var(--text-primary); }

.tm-remove{
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: transparent;
  border: 0;
  cursor: pointer;
}
.tm-remove:hover{ color: #f87171; }

.tm-heat{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.75rem;
  border: 1px solid var(--border-color);
  background: rgba(255,255,255,0.02);
}
.tm-heat.high{ border-color: rgba(239,68,68,.55); color: #fecaca; background: rgba(239,68,68,.10); }
.tm-heat.medium{ border-color: rgba(245,158,11,.55); color: #fde68a; background: rgba(245,158,11,.10); }
.tm-heat.low{ border-color: rgba(16,185,129,.55); color: #a7f3d0; background: rgba(16,185,129,.10); }

@media print{
  .no-print, .tool-header, .legal-disclaimer, .footer{ display:none !important; }
  body{ background: #fff !important; color:#000 !important; }
  .tm-table-wrap{ border: 0; }
  .tm-table thead th{ position: static; background:#f3f4f6; color:#111; border-color:#ddd; }
  .tm-table tbody td{ border-color:#ddd; }
  .tm-input, .tm-select{ border-color:#ccc; background:#fff; color:#000; }
}
.tm-title{
  margin: 0;
}

.tm-note{
  margin-bottom: 10px;
}

.tm-empty{
  padding: 18px;
}

.tm-td-id{ font-weight: 700; }
.tm-td-score{ font-weight: 800; }

.tm-col-asset, .tm-col-threat, .tm-col-fix{ min-width: 240px; }
.tm-col-owner{ min-width: 160px; }
.tm-col-like, .tm-col-impact{ width: 140px; }
.tm-col-due{ width: 180px; }
.tm-col-status{ width: 160px; }
.tm-col-actions{ text-align: right; }

.tm-spacer-top{ margin-top: 12px; }

.tm-flex-row{ display:flex; gap:8px; align-items:center; }
