/* Trello-Integration – nutzt ausschließlich die Farbvariablen des Panels, damit helle und dunkle Themes passen. */

.trello-page { display: grid; gap: 20px; }
.trello-page .field { align-content: start; }
.trello-page .page-heading { margin-bottom: 4px; }
.trello-page .compact { min-height: 34px; padding: 0 12px; font-size: 12px; }

.trello-page input[type="password"],
.trello-page input[type="number"],
.trello-page input[type="url"] {
  width: 100%;
  height: 47px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  outline: none;
  color: var(--text);
  background: var(--input);
}
.trello-page input[type="password"]:focus,
.trello-page input[type="number"]:focus,
.trello-page input[type="url"]:focus { border-color: var(--primary); }
.trello-page input::placeholder, .trello-page textarea::placeholder { color: var(--muted-2); }
.trello-page textarea { min-height: 190px; line-height: 1.55; resize: vertical; }

/* Statuskarten */
.trello-status-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.trello-status-card {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--muted-2);
  border-radius: 12px;
  background: var(--surface);
}
.trello-status-card small { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.trello-status-card strong { color: var(--text); font-size: 17px; }
.trello-status-card span { overflow: hidden; color: var(--muted); font-size: 12px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.trello-status-card.ok { border-left-color: var(--green); }
.trello-status-card.warn { border-left-color: var(--amber); }

/* Reiter */
.trello-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 5px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.trello-tab {
  min-height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.trello-tab:hover { color: var(--text); background: var(--surface-2); }
.trello-tab.active { color: var(--text); background: var(--surface-3); box-shadow: inset 0 -2px 0 var(--primary); }

.trello-two-col { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: 20px; align-items: start; }
.trello-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.trello-link { color: var(--primary); font-size: 12px; font-weight: 700; }
.trello-link:hover { text-decoration: underline; }
.trello-inline-status { margin: 14px 0 0; padding: 10px 12px; border-radius: 9px; background: var(--surface-2); color: var(--text); font-size: 13px; line-height: 1.5; }
.trello-inline-status.ok { box-shadow: inset 3px 0 0 var(--green); }
.trello-inline-status.warn { box-shadow: inset 3px 0 0 var(--amber); }
.trello-page .diagnostics-list dd a { color: var(--primary); }
.trello-empty { margin: 18px 0 4px; color: var(--muted); font-size: 13px; line-height: 1.6; }

/* Scripts */
.trello-filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.trello-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.trello-filter span { min-width: 20px; padding: 1px 6px; border-radius: 999px; color: var(--text); background: var(--surface-3); font-size: 11px; text-align: center; }
.trello-filter.active { border-color: var(--primary); color: var(--text); }
.trello-script-list { display: grid; gap: 10px; margin-top: 16px; }
.trello-script-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 14px 16px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: var(--surface-2);
}
.trello-script-row.is-ignored { opacity: .62; }
.trello-script-main { display: grid; gap: 4px; min-width: 0; }
.trello-script-title { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.trello-script-title strong { color: var(--text); font-size: 15px; }
.trello-script-main small { color: var(--muted); font-size: 12px; line-height: 1.45; }
.trello-script-main .trello-script-ids { color: var(--muted-2); font-size: 11px; overflow-wrap: anywhere; }
.trello-script-task { margin: 2px 0 0; color: var(--text); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.trello-row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; flex-shrink: 0; }
.trello-status-pill { display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px; border: 1px solid var(--border); border-radius: 999px; color: var(--text); background: var(--surface); font-size: 11px; font-weight: 750; white-space: nowrap; }
.trello-status-pill.is-scripts { border-color: color-mix(in srgb, var(--muted) 40%, transparent); }
.trello-status-pill.is-progress { border-color: color-mix(in srgb, #C2FF55 55%, transparent); }
.trello-status-pill.is-testing { border-color: color-mix(in srgb, var(--amber) 55%, transparent); }
.trello-status-pill.is-done { border-color: color-mix(in srgb, #8DDC3F 65%, transparent); }
.trello-status-pill.is-other { color: var(--muted); }

/* Bridge-Token */
.trello-token-box { margin-top: 14px; padding: 12px; border: 1px dashed var(--amber); border-radius: 10px; background: var(--surface-2); }
.trello-token-box p { margin: 0 0 8px; color: var(--text); font-size: 12px; }
.trello-copy-row { display: flex; gap: 8px; }
.trello-copy-row input { flex: 1; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }

/* Benachrichtigungen */
.trello-switch-list { display: grid; gap: 10px; margin-top: 20px; }
.trello-switch-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 14px; border: 1px solid var(--border-soft); border-radius: 10px; background: var(--surface-2); cursor: pointer; }
.trello-switch-row > span:first-child { display: grid; gap: 3px; }
.trello-switch-row strong { color: var(--text); font-size: 13px; }
.trello-switch-row small { color: var(--muted); font-size: 12px; line-height: 1.45; }
.trello-event-grid { display: grid; gap: 8px; margin-top: 16px; }
.trello-event-toggle { position: relative; display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--border-soft); border-radius: 10px; background: var(--surface-2); cursor: pointer; }
.trello-event-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.trello-check { flex: 0 0 18px; width: 18px; height: 18px; margin-top: 1px; border: 1px solid var(--border); border-radius: 5px; background: var(--input); }
.trello-event-toggle input:checked + .trello-check { border-color: var(--primary); background: var(--primary); box-shadow: inset 0 0 0 3px var(--input); }
.trello-event-toggle input:focus-visible + .trello-check { outline: 2px solid var(--primary); outline-offset: 2px; }
.trello-event-copy { display: grid; gap: 2px; }
.trello-event-copy strong { color: var(--text); font-size: 13px; }
.trello-event-copy small { color: var(--muted); font-size: 11px; line-height: 1.45; }

/* Vorlagen */
.trello-template-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr) minmax(300px, 420px); gap: 20px; align-items: start; }
.trello-template-list { display: grid; gap: 4px; padding: 10px; }
.trello-template-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 9px; color: var(--text); background: transparent; text-align: left; cursor: pointer; }
.trello-template-item:hover { background: var(--surface-2); }
.trello-template-item.active { background: var(--surface-3); box-shadow: inset 3px 0 0 var(--primary); }
.trello-template-copy { display: grid; gap: 1px; min-width: 0; }
.trello-template-copy strong { font-size: 13px; }
.trello-template-copy small { color: var(--muted); font-size: 11px; }
.trello-dot { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--muted-2); }
.trello-dot.on { background: var(--green); }
.trello-placeholder-list { display: flex; flex-wrap: wrap; gap: 6px; }
.trello-placeholder { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); background: var(--surface-2); font-size: 11px; cursor: pointer; }
.trello-placeholder:hover { border-color: var(--primary); color: var(--text); }
.trello-placeholder code { border: 0; padding: 0; background: transparent; }
.trello-embed-preview { min-height: 120px; margin: 0; }
.trello-embed-preview p { white-space: normal; overflow-wrap: anywhere; }
.trello-embed-preview p strong { display: inline; font-size: inherit; color: var(--text); }
.trello-embed-preview p code { font-size: 11px; }
.trello-md-link { color: #00a8fc; }
.trello-preview-footer { display: flex; align-items: center; gap: 8px; margin-top: 12px; color: var(--muted); font-size: 11px; }
.trello-preview-footer img { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; }

/* Protokoll */
.trello-log-list { display: grid; gap: 6px; max-height: 560px; margin-top: 16px; overflow: auto; }
.trello-log-entry { display: grid; grid-template-columns: 130px 64px minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); font-size: 12px; }
.trello-log-entry time { color: var(--muted); }
.trello-log-entry p { margin: 0; color: var(--text); line-height: 1.45; overflow-wrap: anywhere; }
.trello-log-level { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.trello-log-entry.is-warn .trello-log-level { color: var(--amber); }
.trello-log-entry.is-error .trello-log-level { color: var(--danger); }

body.trello-busy .trello-page .button { cursor: progress; }

/* Bugreport-System */
.bug-user-list { display: grid; gap: 8px; margin-top: 16px; }
.bug-user-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--border-soft); border-radius: 10px; background: var(--surface-2); }
.bug-user-row > span { display: grid; gap: 2px; min-width: 0; }
.bug-user-row strong { color: var(--text); font-size: 14px; }
.bug-user-row small { color: var(--muted); font-size: 12px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.bug-user-row.is-owner { box-shadow: inset 3px 0 0 var(--green); }
.bug-user-row.is-unknown { box-shadow: inset 3px 0 0 var(--amber); }
.bug-summary { margin-top: 4px; color: var(--muted); font-size: 12px; }
.bug-summary summary { cursor: pointer; color: var(--text); font-weight: 700; }
.bug-summary p { margin: 6px 0 0; color: var(--text); line-height: 1.5; white-space: pre-wrap; }

@media (max-width: 1400px) {
  .trello-template-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .trello-template-layout .preview-column { grid-column: 2; }
}
@media (max-width: 1100px) {
  .trello-status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trello-two-col { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .trello-status-grid, .trello-template-layout { grid-template-columns: minmax(0, 1fr); }
  .trello-template-layout .preview-column { grid-column: auto; }
  .trello-script-row { flex-direction: column; align-items: stretch; }
  .trello-row-actions { justify-content: flex-start; }
  .trello-log-entry { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .trello-page .two-columns { grid-template-columns: minmax(0, 1fr); }
}
