/* ReverseLookup custom UI polish */
.role-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
}
.role-badge--admin { color: #25d366; border-color: rgba(37,211,102,.35); background: rgba(37,211,102,.1); }
.role-badge--manager { color: #60a5fa; border-color: rgba(96,165,250,.35); background: rgba(96,165,250,.1); }
.role-badge--operator { color: #fbbf24; border-color: rgba(251,191,36,.35); background: rgba(251,191,36,.1); }
.role-badge--platform { color: #c084fc; border-color: rgba(192,132,252,.35); background: rgba(192,132,252,.1); }
.role-badge--header { margin-left: auto; }

.rl-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.rl-header-sub {
    margin: 0.15rem 0 0;
    font-size: 0.85rem;
    color: var(--muted);
}
.sidebar-user-block {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    margin-bottom: 0.35rem;
}
.sidebar-org {
    display: block;
    font-size: 0.78rem;
    margin-bottom: 0.5rem;
}
.flash--info {
    border-color: rgba(96, 165, 250, 0.4);
    background: rgba(96, 165, 250, 0.1);
}
.flash--warning {
    border-color: rgba(251, 191, 36, 0.4);
    background: rgba(251, 191, 36, 0.1);
}
.sidebar-link--logout { font-size: 0.85rem; }

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}
.table-compact td, .table-compact th { padding: 0.45rem 0.65rem; font-size: 0.88rem; }

.badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}
.badge--success { background: rgba(37,211,102,.15); color: #25d366; }
.badge--danger { background: rgba(248,113,113,.15); color: #f87171; }
.badge--warning { background: rgba(251,191,36,.15); color: #fbbf24; }
.badge--muted { background: var(--surface); color: var(--muted); }

.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain li { padding: 0.25rem 0; }

.code-block {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.82rem;
}

.webhook-info {
    background: var(--surface);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    word-break: break-all;
}

/* ——— Auth (login / forgot / reset) ——— */
.app--auth {
    overflow-x: hidden;
}
.auth-shell {
    align-items: center;
}
.auth-shell > .auth-card {
    max-width: 440px;
    margin: 0 auto;
    width: 100%;
}
.auth-shell-flash {
    max-width: 440px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}
.auth-field-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.45rem;
}
.auth-field-row label {
    margin-bottom: 0;
}
.auth-field-link {
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}
.auth-field-link:hover {
    text-decoration: underline;
}

/* Campaign demo — simplified animation loop */
.rl-auth-demo .auth-bot-demo-chat {
    height: 200px;
}
.rl-auth-demo .auth-bot-msg--1 { top: 0.65rem; }
.rl-auth-demo .auth-bot-msg--2 { top: 3.1rem; }
.rl-auth-demo .auth-bot-msg--3 {
    top: auto;
    bottom: 2.35rem;
    left: 0.7rem;
    right: 0.7rem;
}
.rl-auth-demo .auth-bot-msg--4 {
    top: auto;
    bottom: 0.65rem;
    left: 0.7rem;
    right: 0.7rem;
}
.rl-auth-demo .auth-bot-msg--1 { animation: rlAuthDemo1 16s ease infinite; }
.rl-auth-demo .auth-bot-msg--2 { animation: rlAuthDemo2 16s ease infinite; }
.rl-auth-demo .auth-bot-msg--3 { animation: rlAuthDemo3 16s ease infinite; }
.rl-auth-demo .auth-bot-msg--4 { animation: rlAuthDemo4 16s ease infinite; }
@keyframes rlAuthDemo1 {
    0%, 5% { opacity: 0; transform: translateY(6px); }
    8%, 28% { opacity: 1; transform: translateY(0); }
    32%, 100% { opacity: 0; transform: translateY(-3px); }
}
@keyframes rlAuthDemo2 {
    0%, 28% { opacity: 0; transform: translateY(6px); }
    32%, 52% { opacity: 1; transform: translateY(0); }
    56%, 100% { opacity: 0; transform: translateY(-3px); }
}
@keyframes rlAuthDemo3 {
    0%, 52% { opacity: 0; transform: translateY(4px); }
    56%, 72% { opacity: 1; transform: translateY(0); }
    76%, 100% { opacity: 0; transform: translateY(-3px); }
}
@keyframes rlAuthDemo4 {
    0%, 72% { opacity: 0; transform: translateY(6px); }
    76%, 94% { opacity: 1; transform: translateY(0); }
    98%, 100% { opacity: 0; transform: translateY(-3px); }
}

@media (max-width: 960px) {
    .auth-shell {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
        padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
        min-height: 100dvh;
        justify-content: center;
    }
    .auth-shell-top {
        max-width: 440px;
        margin-left: auto;
        margin-right: auto;
    }
    .auth-card {
        padding: 1.65rem 1.35rem 1.5rem;
    }
    .auth-card input,
    .auth-card select {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .auth-card h1 {
        font-size: 1.45rem;
    }
    .auth-login-trust {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rl-auth-demo .auth-bot-msg {
        animation: none !important;
        opacity: 1;
        transform: none;
        position: relative;
        left: auto;
        right: auto;
        top: auto !important;
        bottom: auto !important;
        margin-bottom: 0.45rem;
    }
    .rl-auth-demo .auth-bot-demo-chat {
        height: auto;
        min-height: 140px;
    }
}
