/* scripts/cts-panel.css — flusso 018 §9 (Tool CTS UI styling) */

.cts-panel {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #fafbfc;
  border: 1px solid #d1d5da;
  border-radius: 6px;
  padding: 12px;
  margin: 8px 0;
}

.cts-panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e1e4e8;
  margin-bottom: 12px;
}

.cts-cr-id {
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.cts-status {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
}

.cts-status-modified { background: #fff3cd; color: #856404; }
.cts-status-released { background: #d1ecf1; color: #0c5460; }
.cts-status-validate { background: #d4edda; color: #155724; }
.cts-status-imported { background: #c3e6cb; color: #155724; }
.cts-status-aborted { background: #f8d7da; color: #721c24; }

.cts-description {
  color: #586069;
  font-size: 13px;
  flex: 1;
}

.cts-files {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cts-empty {
  color: #6a737d;
  font-style: italic;
  padding: 8px;
}

.cts-file-card {
  border: 1px solid #e1e4e8;
  border-radius: 4px;
  background: #fff;
}

.cts-file-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  cursor: pointer;
}

.cts-file-path {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  flex: 1;
}

.cts-file-source {
  font-size: 11px;
  color: #586069;
  text-transform: uppercase;
  background: #f6f8fa;
  padding: 2px 6px;
  border-radius: 3px;
}

.cts-file-stats {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  color: #28a745;
}

.cts-file-body {
  padding: 10px;
  border-top: 1px solid #e1e4e8;
}

.cts-sidebyside {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.cts-pane,
.twd-pane {
  border: 1px solid #e1e4e8;
  border-radius: 4px;
  background: #f6f8fa;
}

.cts-pane-label,
.twd-pane-label {
  font-size: 11px;
  font-weight: 600;
  color: #586069;
  padding: 4px 8px;
  background: #e1e4e8;
  text-transform: uppercase;
}

.cts-pane-content,
.twd-pane-content {
  padding: 8px;
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  white-space: pre-wrap;
  overflow-x: auto;
  max-height: 300px;
  overflow-y: auto;
}

.cts-progress {
  padding: 8px;
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 4px;
  font-size: 13px;
  color: #5d4037;
  margin: 10px 0;
}

.cts-panel-footer {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e1e4e8;
}

.cts-btn,
.twd-btn {
  padding: 6px 14px;
  border: 1px solid #d1d5da;
  border-radius: 4px;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}

.cts-btn-primary,
.twd-btn-primary {
  background: #28a745;
  color: #fff;
  border-color: #28a745;
}

.cts-btn-danger,
.twd-btn-danger {
  background: #fff;
  color: #d73a49;
  border-color: #d73a49;
}

/* Three-way diff */

.three-way-diff {
  background: #fff;
  border: 2px solid #d73a49;
  border-radius: 6px;
  padding: 12px;
  margin: 8px 0;
}

.twd-header {
  font-weight: 600;
  color: #d73a49;
  margin-bottom: 12px;
}

.twd-file {
  border: 1px solid #e1e4e8;
  border-radius: 4px;
  padding: 10px;
  margin-bottom: 12px;
}

.twd-file-header {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 600;
  margin-bottom: 8px;
}

.twd-cols {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  margin-bottom: 8px;
}

.twd-decisions {
  display: flex;
  gap: 6px;
}

.twd-btn-choice {
  flex: 1;
}

.twd-btn.twd-chosen {
  background: #0366d6;
  color: #fff;
  border-color: #0366d6;
}

.twd-footer {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e1e4e8;
}

/* Modalità badge canvas top-bar */

.frontinus-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.frontinus-mode-badge-scratchpad {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffe082;
}

.frontinus-mode-badge-attached {
  background: #d4edda;
  color: #155724;
  border: 1px solid #b1dfbb;
}

/* Stato indeterminato: il backend non ha risposto, non sappiamo se il repo
   e' agganciato. Neutro di proposito — non deve leggersi ne' come attached
   (verde) ne' come scratchpad (giallo). */
.frontinus-mode-badge-unknown {
  background: #eceff1;
  color: #546e7a;
  border: 1px solid #cfd8dc;
}

/* Flusso 020.AE #10 — bottone Crea CR, mount accanto a #frontinus-mode-badge.
   Visible solo in modalità attached (toggled da refreshModeBadge). */
.frontinus-create-cr-btn {
  margin-left: 8px;
  padding: 4px 10px;
  background: #007acc;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.frontinus-create-cr-btn:hover {
  background: #005f9e;
}

.frontinus-create-cr-btn.hidden {
  display: none;
}
