/* ═══════════════════════════════════════════════════════════════════════════
   DevFix — app-webhook.css
   Webhook Tester — layout e lista
═══════════════════════════════════════════════════════════════════════════ */

.wh-status-badge {
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tags-section--codeblock .wh-container {
    margin-top: 0;
}

.wh-container {
    margin-top: 24px;
    display: grid;
    gap: 20px;
    grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
    align-items: stretch;
}

@media (max-width: 900px) {
    .wh-container {
        grid-template-columns: 1fr;
    }
}

.wh-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.wh-panel-inbox {
    gap: 0;
}

.wh-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wh-section + .wh-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.wh-section-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.45;
}

.wh-btn-primary {
    width: 100%;
    margin-top: 4px;
}

.wh-url-box {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wh-field-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.wh-url-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: stretch;
}

/* URL legível: fundo claro (tema) + texto escuro — evita “caixa preta” com indigo invisível */
.wh-url-input {
    flex: 1 1 220px;
    min-width: 0;
    width: 100%;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 10px 12px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.4;
}

.wh-btn-copy {
    flex: 0 0 auto;
    min-width: 100px;
    margin-top: 0;
    /* cor vem de .btn-primary (tokens) */
}

.wh-url-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
}

.wh-inbox-head {
    margin-bottom: 8px;
}

.wh-inbox-section .wh-section-title {
    margin-bottom: 0;
}

.wh-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: min(420px, 55vh);
    overflow-y: auto;
    min-height: 120px;
}

.wh-list-empty {
    padding: 20px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.45;
    border: 1px dashed var(--border);
    border-radius: var(--r-sm);
    background: var(--bg-raised);
}

.wh-list-empty.wh-token-mismatch {
    text-align: left;
    color: var(--text-primary);
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.06);
}

.wh-mismatch-text {
    margin: 10px 0 0;
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--text-secondary);
    font-weight: 400;
}

.wh-list-item {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: var(--bg-raised);
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    text-align: left;
    width: 100%;
    font: inherit;
}

.wh-list-item:hover,
.wh-list-item:focus-visible {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.25);
}

.wh-list-item.active {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.08);
}

.wh-list-item-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.wh-list-item-main {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.wh-list-item-ip {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wh-panel-detail {
    min-height: 320px;
}

.wh-empty-state {
    height: 100%;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    flex-direction: column;
    gap: 12px;
    text-align: center;
    padding: 24px 16px;
}

.wh-empty-state p {
    margin: 0;
    max-width: 320px;
    font-size: 0.9rem;
    line-height: 1.45;
}

.wh-detail-box {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 280px;
}

.wh-detail-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.wh-detail-meta-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.wh-method-badge {
    flex-shrink: 0;
}

.wh-detail-ip {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wh-detail-time {
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.wh-code-wrap {
    margin-top: 0;
    border-top-left-radius: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.wh-code-pre {
    min-height: 220px;
    max-height: min(480px, 45vh);
    margin: 0;
    overflow: auto;
    flex: 1;
}

.wh-item-method {
    font-size: 0.75rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    background: #1e1e24;
    flex-shrink: 0;
}

.wh-item-method.get { color: #3b82f6; }
.wh-item-method.post { color: #10b981; }
.wh-item-method.put { color: #f59e0b; }
.wh-item-method.patch { color: #8AC0AF; }
.wh-item-method.delete { color: #ef4444; }

.wh-item-time {
    font-size: 0.8rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.tags-badge.wh-badge-wait {
    color: var(--accent-warn);
    border-color: rgba(234, 179, 8, 0.35);
}

.tags-badge.wh-badge-live {
    color: var(--accent);
    border-color: rgba(var(--accent-rgb), 0.35);
}

.tags-badge.wh-badge-count {
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.35);
}

.tags-badge.wh-badge-err {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.35);
}

/* ── Hub devtools (sem app.css): badges, títulos, blocos de código ─────────── */
.tags-badge {
    display: inline-flex;
    align-items: center;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-family: var(--font-mono);
    padding: 3px 10px;
    border-radius: var(--r-sm);
}

.wh-tool-root .wh-container {
    margin-top: 0;
}

.wh-tool-root .wh-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.wh-tool-root .wh-page-header .tags-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.wh-section-title {
    margin: 0 0 4px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.wh-tool-root .code-editor-wrap {
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.wh-tool-root pre.code-editor {
    background: var(--bg-code);
    color: var(--text-code);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    line-height: 1.8;
    padding: 24px;
    overflow-x: auto;
    overflow-y: auto;
    white-space: pre;
    min-height: 200px;
    margin: 0;
    outline: none;
    display: block;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
}
