/* ==========================================================================
   ADMIN VIEW — the hidden "potipus" control panel
   ========================================================================== */

.admin-list {
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
}
.admin-row {
    padding: 12px 0;
    border-top: 1px solid #2a2a2a;
}
.admin-row:first-child {
    border-top: none;
}
.admin-row-head {
    display: flex;
    align-items: center;
    gap: 8px;
}
.admin-row-compact {
    display: flex;
    align-items: center;
    gap: 8px;
}
.admin-name {
    font-weight: 600;
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.admin-play-title {
    flex: 1;
    min-width: 0;
    font-size: 0.9rem;
    color: #cfcfcf;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.admin-dim {
    color: #8d8d8d;
    font-size: 0.8rem;
    font-weight: 400;
    margin-left: auto;
    flex-shrink: 0;
}
.admin-sub {
    margin-top: 4px;
    font-size: 0.82rem;
    color: #b3b3b3;
    line-height: 1.45;
}
.admin-sub .admin-dim {
    margin-left: 0;
}

/* Green dot for a profile seen in the last few minutes. */
.admin-status {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #4a4a4a;
    flex-shrink: 0;
}
.admin-status.online {
    background: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.2);
}

.admin-owner-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}
.admin-owner-row .admin-dim {
    margin-left: 0;
}
.admin-owner-select {
    flex: 1;
    min-width: 0;
    background: #2a2a2a;
    color: #ffffff;
    border: 1px solid #3e3e3e;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.9rem;
    min-height: 44px;
}

/* Per-profile delete, tucked at the end of the row head after "last seen".
   Sized for a finger rather than a cursor — this panel gets used on a phone. */
.admin-delete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    margin-left: 4px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: #8d8d8d;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.admin-delete-btn:hover {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}
.admin-delete-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

/* ---------- Vibe profiling ---------- */
.admin-vibe-summary {
    margin: 14px 0 8px;
    font-size: 0.95rem;
    font-weight: 600;
}
.admin-vibe-bar {
    height: 6px;
    border-radius: 3px;
    background: #2a2a2a;
    overflow: hidden;
}
.admin-vibe-bar > span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.4s ease;
}
.admin-vibe-detail {
    margin: 8px 0 0;
    /* Hold the line's height even when empty, so the button below it doesn't
       hop up and down as the status text comes and goes. */
    min-height: 1.2em;
    font-size: 0.82rem;
    color: #b3b3b3;
    line-height: 1.45;
}
.admin-vibe-error {
    color: #f87171;
}
#admin-vibe-run {
    margin-top: 16px;
}
#admin-vibe-run:disabled {
    opacity: 0.5;
    cursor: default;
}

/* ---------- Send a message ---------- */
.admin-message-input {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 12px;
    background: #2a2a2a;
    color: #ffffff;
    border: 1px solid #3e3e3e;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.45;
    /* Vertical only: dragging it wider would break out of the card. */
    resize: vertical;
    min-height: 84px;
}
.admin-message-input:focus {
    outline: none;
    border-color: var(--accent);
}
.admin-message-status {
    margin: 10px 0 0;
    /* Reserve the line so the Send button doesn't jump when a result appears. */
    min-height: 1.2em;
    font-size: 0.82rem;
    color: #b3b3b3;
}
.admin-message-status.admin-message-failed {
    color: #f87171;
}
#admin-message-send {
    margin-top: 12px;
}
#admin-message-send:disabled {
    opacity: 0.5;
    cursor: default;
}

/* Jumps to the compose box with this profile already chosen. */
.admin-msg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    margin-left: 4px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: #8d8d8d;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.admin-msg-btn:hover {
    background: rgba(var(--accent-rgb), 0.14);
    color: var(--accent);
}
/* Sits in the per-profile sub-line to say a note hasn't been picked up yet. */
.admin-pending-msg {
    color: var(--accent);
    font-weight: 600;
}

/* ---------- Invites ---------- */
.admin-invite-result {
    margin-top: 14px;
    padding: 12px;
    background: rgba(var(--accent-rgb), 0.08);
    border: 1px solid rgba(var(--accent-rgb), 0.35);
    border-radius: 10px;
}
.admin-invite-result.hidden {
    display: none;
}
.admin-invite-note {
    margin: 0 0 8px;
    font-size: 0.78rem;
    color: var(--accent);
}
/* A link is long and gets read off a screen, so let it wrap rather than
   disappear off the side of a phone. */
.admin-invite-link {
    display: block;
    margin-bottom: 10px;
    padding: 8px;
    background: #1a1a1a;
    border-radius: 6px;
    font-size: 0.75rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
    user-select: all;
}
#admin-invite-create {
    margin-top: 10px;
}

/* ---------- Blocked profiles ---------- */
.admin-block-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: #8d8d8d;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.admin-block-btn:hover {
    background: rgba(250, 204, 21, 0.14);
    color: #facc15;
}
.admin-block-btn:disabled {
    opacity: 0.4;
    cursor: default;
}
/* Dimmed rather than hidden: they are still here, and still undoable. */
.admin-row-blocked .admin-name,
.admin-row-blocked .admin-sub {
    opacity: 0.55;
}
.admin-blocked-tag {
    color: #facc15;
    font-weight: 600;
}

@media (min-width: 769px) {
    #view-admin {
        max-width: 640px;
        margin: 0 auto;
    }
}
