/* WhatsApp / Leafox settings — loaded globally (scoped CSS is not linked in this app) */

.wa-shell {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 1.25rem;
    align-items: start;
    width: 100%;
}

.wa-status,
.wa-meta,
.wa-qr-panel {
    border-radius: var(--ibs-card-radius, 12px);
    border: 1px solid var(--default-border, #e8ecf3);
    background: #fff;
    box-shadow: var(--ibs-shadow-sm, 0 1px 3px rgba(15, 23, 42, 0.06));
}

.wa-status {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
    padding: 1.35rem 1.4rem;
}

.wa-status.ok {
    border-color: rgba(37, 211, 102, 0.28);
    background: linear-gradient(160deg, rgba(37, 211, 102, 0.12) 0%, #fff 42%);
}

.wa-status.pending {
    border-color: rgba(245, 158, 11, 0.3);
    background: linear-gradient(160deg, rgba(245, 158, 11, 0.12) 0%, #fff 42%);
}

.wa-status.warn {
    border-color: rgba(239, 68, 68, 0.22);
    background: linear-gradient(160deg, rgba(239, 68, 68, 0.08) 0%, #fff 42%);
}

.wa-status.bad {
    border-color: rgba(217, 119, 6, 0.28);
    background: linear-gradient(160deg, rgba(217, 119, 6, 0.1) 0%, #fff 42%);
}

.wa-status-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.wa-status-main {
    display: flex;
    align-items: flex-start;
    gap: 0.95rem;
    min-width: 0;
}

.wa-status-icon {
    flex-shrink: 0;
    width: 3.1rem;
    height: 3.1rem;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 1.45rem;
}

.wa-status.ok .wa-status-icon {
    background: rgba(37, 211, 102, 0.16);
    color: #128c7e;
}

.wa-status.pending .wa-status-icon {
    background: rgba(245, 158, 11, 0.16);
    color: #b45309;
}

.wa-status.warn .wa-status-icon {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

.wa-status.bad .wa-status-icon {
    background: rgba(217, 119, 6, 0.14);
    color: #b45309;
}

.wa-status-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.4rem;
}

.wa-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.5;
    border: 1px solid transparent;
}

.wa-chip.ok {
    color: #047857;
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.2);
}

.wa-chip.pending {
    color: #b45309;
    background: rgba(245, 158, 11, 0.14);
    border-color: rgba(245, 158, 11, 0.22);
}

.wa-chip.warn {
    color: #b91c1c;
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.18);
}

.wa-chip.bad {
    color: #92400e;
    background: rgba(217, 119, 6, 0.12);
    border-color: rgba(217, 119, 6, 0.2);
}

.wa-chip.muted {
    color: #64748b;
    background: #f1f5f9;
    border-color: #e2e8f0;
}

.wa-status-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
}

.wa-status-desc {
    margin: 0.35rem 0 0;
    color: #64748b;
    font-size: 0.925rem;
    line-height: 1.55;
}

.wa-status-actions {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-shrink: 0;
}

.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    background: #25d366 !important;
    border: 1px solid #1ebe57 !important;
    color: #fff !important;
    font-weight: 600;
    border-radius: var(--ibs-input-radius, 8px);
    padding: 0.55rem 1rem;
    box-shadow: 0 1px 2px rgba(16, 185, 129, 0.2);
}

.btn-whatsapp:hover:not(:disabled),
.btn-whatsapp:focus:not(:disabled) {
    background: #1ebe57 !important;
    border-color: #18a84d !important;
    color: #fff !important;
}

.btn-wa-refresh {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    display: grid;
    place-items: center;
    border-radius: var(--ibs-input-radius, 8px);
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
}

.btn-wa-refresh:hover:not(:disabled) {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}

.wa-qr-panel {
    padding: 1.15rem 1.25rem 1.25rem;
    text-align: center;
    background: #fbfdff;
}

.wa-qr-panel-title {
    margin: 0 0 0.35rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
}

.wa-qr-panel-hint {
    margin: 0 0 1rem;
    font-size: 0.8rem;
    color: #94a3b8;
}

.wa-qr-frame {
    display: inline-flex;
    padding: 0.85rem;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: var(--ibs-shadow-sm, 0 1px 3px rgba(15, 23, 42, 0.06));
}

.wa-qr-frame img,
.qr-image {
    width: 220px;
    max-width: 100%;
    height: auto;
    display: block;
}

.wa-qr-loading {
    padding: 2rem 0.5rem;
    color: #64748b;
}

.wa-qr-loading p {
    margin: 0.75rem 0 0;
}

.wa-meta {
    padding: 1.25rem 1.35rem 1.4rem;
    grid-column: 1 / -1;
}

.wa-meta-head {
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid #f1f5f9;
}

.wa-meta-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
}

.wa-meta-sub {
    margin: 0.25rem 0 0;
    font-size: 0.8125rem;
    color: #94a3b8;
}

.wa-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
}

.wa-meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.85rem 0.9rem;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #eef2f7;
    min-height: 4.4rem;
}

.wa-meta-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
}

.wa-meta-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.4;
    word-break: break-word;
}

.wa-meta-value.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.875rem;
    direction: ltr;
    unicode-bidi: plaintext;
}

.wa-pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 0.12rem 0.55rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.wa-pill.ok {
    color: #047857;
    background: rgba(16, 185, 129, 0.12);
}

.wa-pill.pending {
    color: #b45309;
    background: rgba(245, 158, 11, 0.14);
}

.wa-pill.warn {
    color: #b45309;
    background: rgba(245, 158, 11, 0.12);
}

.wa-pill.bad {
    color: #b91c1c;
    background: rgba(239, 68, 68, 0.1);
}

.wa-pill.muted {
    color: #64748b;
    background: #e2e8f0;
}

.wa-spin {
    display: inline-block;
    animation: wa-spin 1s linear infinite;
}

@keyframes wa-spin {
    to { transform: rotate(360deg); }
}

.wa-qr-modal .modal-title {
    font-weight: 700;
}

.wa-qr-steps {
    margin: 0 auto 1.1rem;
    padding: 0;
    list-style: none;
    max-width: 18rem;
    text-align: start;
    color: #64748b;
    font-size: 0.875rem;
    counter-reset: step;
}

.wa-qr-steps li {
    position: relative;
    padding-block: 0.2rem;
    padding-inline: 1.7rem 0;
}

.wa-qr-steps li::before {
    content: counter(step);
    counter-increment: step;
    position: absolute;
    inset-inline-start: 0;
    top: 0.15rem;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 999px;
    background: rgba(37, 211, 102, 0.14);
    color: #128c7e;
    font-size: 0.7rem;
    font-weight: 700;
    display: grid;
    place-items: center;
}

.wa-qr-hint {
    margin: 0.85rem 0 0;
    font-size: 0.8rem;
    color: #94a3b8;
}

@media (max-width: 991.98px) {
    .wa-shell {
        grid-template-columns: 1fr;
    }

    .wa-meta-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .wa-status-top {
        flex-direction: column;
    }

    .wa-status-actions {
        width: 100%;
    }

    .wa-status-actions .btn-whatsapp {
        flex: 1;
    }

    .wa-meta-grid {
        grid-template-columns: 1fr;
    }
}
