:root {
    /* ── Black / grey palette ── */
    --void: #000000;
    --bg-dark: #121212;
    --bg-darker: #000000;
    --nebula-violet: #d4d4d8;
    --nebula-magenta: #a1a1aa;
    --nebula-cyan: #d4d4d8;

    --primary: #d4d4d8;
    --primary-glow: rgba(212, 212, 216, 0.3);
    --success: #e4e4e7;
    --danger: #ff5c5c;
    /* Semantic "online" indicator — intentionally kept green so it still
       pops against the black/grey theme. */
    --status-online-color: #22c55e;

    --glass-bg: #18181b;
    --glass-border: rgba(212, 212, 216, 0.16);
    --text-main: #e4e4e7;
    --text-muted: #9a9aa1;
    --nav-bg: rgba(9, 9, 11, 0.92);
    --accent-bg: #3f3f46;
    --accent-text: #f4f4f5;
    --input-bg: rgba(255, 255, 255, 0.05);
    --row-bg: rgba(255, 255, 255, 0.045);

    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Manrope', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* ── Role badge colors (fixed, not user-editable) ── */
    --role-color-developer: #ef4444;
    --role-color-premium: #d4af37;
    --role-color-user: #9ca3af;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-body);
}

h1, h2, h3, .logo h2 {
    font-family: var(--font-display);
    letter-spacing: -0.01em;
}

::selection {
    background: var(--nebula-violet);
    color: var(--accent-text);
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--nebula-violet), var(--nebula-magenta));
    border-radius: 8px;
}

body {
    background-color: var(--void);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-x: hidden;
}

.app-container {
    width: 100%;
    min-height: 100vh;
    position: relative;
    background: var(--void);
    box-shadow: 0 0 80px rgba(255, 255, 255, 0.12);
    overflow: hidden;
    isolation: isolate;
}

/* On tablet/desktop, present the app as a floating device frame instead
   of stretching edge-to-edge — much easier to read and scan. */
@media (min-width: 640px) {
    body {
        align-items: center;
        padding: 32px 20px;
    }

    .app-container {
        width: 420px;
        min-height: 780px;
        max-height: 900px;
        border-radius: 32px;
        border: 1px solid var(--glass-border);
        box-shadow:
            0 40px 100px rgba(0, 0, 0, 0.45),
            0 0 0 1px rgba(255, 255, 255, 0.04),
            0 0 90px rgba(255, 255, 255, 0.18);
    }
}

/* Subtle ambient wash — soft light vignette instead of a colorful nebula */
.app-container::before {
    content: "";
    position: absolute;
    inset: -15%;
    background:
        radial-gradient(ellipse 55% 40% at 12% -5%, rgba(255, 255, 255, 0.09), transparent 60%),
        radial-gradient(ellipse 50% 45% at 108% 18%, rgba(255, 255, 255, 0.06), transparent 60%),
        radial-gradient(ellipse 45% 38% at 25% 115%, rgba(255, 255, 255, 0.05), transparent 60%),
        radial-gradient(ellipse 40% 35% at 90% 100%, rgba(255, 255, 255, 0.04), transparent 60%);
    filter: blur(60px);
    animation: nebula-drift 60s ease-in-out infinite alternate;
    z-index: 0;
    pointer-events: none;
}

/* Faint starfield / grain */
.app-container::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1.2px 1.2px at 20px 30px, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 90px 80px, rgba(255,255,255,0.4), transparent),
        radial-gradient(1.6px 1.6px at 150px 20px, rgba(255,255,255,0.45), transparent),
        radial-gradient(1px 1px at 190px 140px, rgba(255,255,255,0.35), transparent),
        radial-gradient(1px 1px at 55px 160px, rgba(255,255,255,0.3), transparent),
        radial-gradient(1.6px 1.6px at 235px 95px, rgba(255,255,255,0.4), transparent),
        radial-gradient(1px 1px at 270px 40px, rgba(255,255,255,0.3), transparent);
    background-repeat: repeat;
    background-size: 300px 220px;
    opacity: 0.22;
    z-index: 0;
    pointer-events: none;
}

@keyframes nebula-drift {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(-3%, 3%) scale(1.06); }
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(20px);
    display: flex;
    flex-direction: column;
    z-index: 1;
}

.screen.active {
    opacity: 1;
    pointer-events: all;
    transform: translateX(0);
}

/* Glassmorphism utility */
.glass-card {
    position: relative;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    padding: 22px;
    overflow: hidden;
    box-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
    transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.glass-card:hover {
    border-color: var(--glass-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

/* ── "Bot Config" is a real button that navigates to its own page ── */
.config-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    text-align: left;
    cursor: pointer;
    color: var(--text-main);
    font-family: var(--font-body);
}

.config-toggle-btn-text h3,
.config-toggle-btn-text .subtitle {
    margin: 0;
}

.config-toggle-btn-text .subtitle {
    margin-top: 6px;
}

.config-toggle-btn > i {
    flex-shrink: 0;
    color: var(--text-muted);
}

.config-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0;
    transition: color 0.15s ease;
}

.config-back-btn:hover {
    color: var(--text-main);
}

.glass-card h3 {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 2px;
}

/* Soft hairline along the top of every card */
.glass-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--glass-border), transparent);
    opacity: 0.9;
}

/* Auth Screen */
#auth-screen {
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.auth-card {
    width: 100%;
    max-width: 450px;
}

.logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    font-size: 2.1rem;
    color: var(--accent-text);
    background: var(--accent-bg);
    box-shadow: 0 0 40px var(--primary-glow), 0 0 90px rgba(255, 255, 255, 0.22);
    margin-bottom: 14px;
}

.logo h2 {
    font-weight: 600;
    background: linear-gradient(90deg, var(--text-main), var(--nebula-violet) 130%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tabs {
    display: flex;
    background: var(--input-bg);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 24px;
    border: 1px solid var(--glass-border);
}

.mode-tabs {
    margin-bottom: 0;
}

/* Multi active-session tabs (dashboard) */
.session-tabs-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.session-tabs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.session-tabs-counter {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    padding: 3px 10px;
}

.session-select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: var(--input-bg);
    color: var(--text-main);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239a9aa1' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
}

.session-select option.online {
    color: #22c55e;
}

.session-limit-note {
    margin: 0;
    text-align: center;
}

.tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    font-family: var(--font-display);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab.active {
    background: var(--accent-bg);
    color: var(--accent-text);
    box-shadow: 0 4px 16px var(--primary-glow);
}

.input-group {
    position: relative;
    margin-bottom: 16px;
}

.input-group i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.input-group input {
    width: 100%;
    padding: 14px 16px 14px 45px;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.input-group input:focus {
    border-color: var(--nebula-violet);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18);
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--accent-bg);
    color: var(--accent-text);
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-display);
    cursor: pointer;
    box-shadow: 0 6px 20px var(--primary-glow);
    transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    margin-top: 10px;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-primary:active {
    transform: scale(0.98);
}

.error-msg {
    color: var(--danger);
    text-align: center;
    margin-top: 15px;
    font-size: 0.9rem;
    min-height: 20px;
}

/* Divider between the username/password form and Google Sign-In */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 18px;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--glass-border);
}

/* Google renders its own <iframe> button inside this div; we just center it
   and give it a consistent max width matching the rest of the form. */
.google-signin-container {
    display: flex;
    justify-content: center;
    min-height: 44px;
}

/* Dashboard */
.topbar {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 110;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--accent-bg);
    color: var(--accent-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 0 18px var(--primary-glow);
    overflow: hidden;
}

/* Foto profil (kalau user sudah upload) mengisi penuh bulatan avatar,
   ikon WhatsApp default cuma ditampilkan kalau belum ada foto (lihat .hidden
   yang di-toggle lewat JS di app.js) */
.avatar img,
.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.avatar-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: -4px;
}

.btn-sm {
    margin: 0;
    padding: 6px 12px;
    font-size: 0.72rem;
}

.btn-ghost.danger {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.35);
}

.btn-ghost.danger:hover {
    color: #ef4444;
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

#display-username {
    font-family: var(--font-display);
    font-weight: 600;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.hamburger-wrap {
    position: relative;
}

/* ── Animated hamburger icon: bars morph into an X ── */
.hamburger-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.hamburger-btn:hover,
.hamburger-btn.open {
    background: var(--glass-bg);
}

.hamburger-icon {
    position: relative;
    width: 20px;
    height: 15px;
    display: inline-block;
}

.hamburger-icon span {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--nebula-violet), var(--nebula-cyan));
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, top 0.35s cubic-bezier(0.4, 0, 0.2, 1), width 0.35s ease;
}

.hamburger-icon span:nth-child(1) { top: 0; }
.hamburger-icon span:nth-child(2) { top: 6.5px; }
.hamburger-icon span:nth-child(3) { top: 13px; }

.hamburger-btn.open .hamburger-icon span:nth-child(1) {
    top: 6.5px;
    transform: rotate(45deg);
}

.hamburger-btn.open .hamburger-icon span:nth-child(2) {
    opacity: 0;
    width: 0;
    left: 50%;
}

.hamburger-btn.open .hamburger-icon span:nth-child(3) {
    top: 6.5px;
    transform: rotate(-45deg);
}

.hamburger-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 220px;
    background: var(--nav-bg);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35), 0 0 40px var(--primary-glow);
    padding: 8px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 2px;
    transform-origin: top right;
    animation: hamburger-pop 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes hamburger-pop {
    from { opacity: 0; transform: scale(0.85) translateY(-8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.hamburger-menu.hidden {
    display: none;
}

.hamburger-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.15s ease;
    animation: hamburger-item-in 0.32s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: calc(var(--i, 0) * 0.05s);
}

@keyframes hamburger-item-in {
    from { opacity: 0; transform: translateX(10px); }
    to   { opacity: 1; transform: translateX(0); }
}

.hamburger-menu a i {
    width: 16px;
    text-align: center;
    color: var(--nebula-cyan);
}

.hamburger-menu a:hover {
    background: var(--glass-bg);
}

.hamburger-menu a.danger {
    color: var(--danger);
}

.hamburger-menu a.danger i {
    color: var(--danger);
}

.hamburger-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 6px 4px;
}

.hamburger-backdrop {
    position: fixed;
    inset: 0;
    z-index: 90;
    background: transparent;
}

.hamburger-backdrop.hidden {
    display: none;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-overlay.hidden {
    display: none;
}

.modal-card {
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.modal-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: background 0.3s, color 0.3s;
}

.btn-icon:hover {
    background: var(--glass-bg);
    color: var(--nebula-cyan);
}

.dashboard-content {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
    padding-bottom: 32px;
    max-width: 720px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
}

.dashboard-content > * {
    flex-shrink: 0;
}

/* Small eyebrow-style heading used to group related cards together, so a
   long stack of cards reads as a few clear sections instead of one flat,
   busy list. Sits tight against the group it introduces, with extra room
   above to separate it from the previous group. */
.section-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 22px;
    margin-bottom: 2px;
    padding: 0 4px;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.section-label::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--glass-border);
}

.dashboard-content > .section-label:first-child {
    margin-top: 0;
}

/* Utility/secondary cards (config link, terminal) read a notch quieter than
   the primary connection/status cards, reinforcing the grouping above. */
.card-quiet {
    background: rgba(24, 24, 27, 0.55);
}

.status-card {
    margin-bottom: 0;
}

/* Stacked dashboard: Terminal, Bot Config, Active Bot, Bot Status —
   in that order, one full-width card per row instead of a 2x2 grid. */
.dashboard-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dashboard-stack .stack-item {
    width: 100%;
    min-width: 0;
    padding: 14px;
    display: flex;
    flex-direction: column;
}

.dashboard-stack .stack-item h3 {
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-stack .terminal-card .terminal-header h3 {
    white-space: normal;
}

.dashboard-stack .config-toggle-btn-text .subtitle,
.dashboard-stack .session-limit-note {
    font-size: 0.72rem;
}

.dashboard-stack .config-toggle-btn {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
}

.dashboard-stack .config-toggle-btn-text {
    width: 100%;
}

.dashboard-stack .terminal-body {
    max-height: 220px;
}

.dashboard-stack .session-select {
    padding: 10px 12px;
    font-size: 0.85rem;
}

.status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.status-header h3 { font-family: var(--font-display); }

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-mono);
    letter-spacing: 0.02em;
}

.status-badge.offline { background: rgba(255, 255, 255, 0.08); color: var(--text-muted); }
.status-badge.online { background: rgba(34, 197, 94, 0.16); color: var(--status-online-color); }

/* ── Profile modal ── */
#profile-modal .glass-card.modal-card,
#view-user-modal .glass-card.modal-card {
    position: relative;
}

.modal-inner-layer {
    position: relative;
    z-index: 1;
}

.profile-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 14px 0 8px;
    text-align: center;
}

.profile-body #profile-username,
.profile-body #view-user-username {
    margin-top: 4px;
}

.profile-avatar {
    width: 76px;
    height: 76px;
    border-radius: 20px;
    background: var(--accent-bg);
    color: var(--accent-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 0 24px var(--primary-glow);
    margin-bottom: 6px;
}

#profile-username {
    font-family: var(--font-display);
    font-weight: 600;
}

.profile-divider {
    height: 1px;
    background: var(--border-color, rgba(255, 255, 255, 0.1));
    margin: 22px 0;
}

.profile-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 12px;
    color: var(--text-primary);
}

/* ── Accordion (Ganti Username / Ganti Password) ── */
.accordion-toggle {
    width: 100%;
    justify-content: space-between;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}

.accordion-toggle .accordion-chevron {
    font-size: 0.85rem;
    color: var(--text-secondary, rgba(255, 255, 255, 0.5));
    transition: transform 0.2s ease;
}

.accordion.open .accordion-toggle .accordion-chevron {
    transform: rotate(180deg);
}

.accordion-body {
    overflow: hidden;
    animation: accordion-open 0.2s ease;
}

.accordion-body.hidden {
    display: none;
}

@keyframes accordion-open {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    font-family: var(--font-mono);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.role-badge-sm {
    padding: 3px 10px;
    font-size: 0.68rem;
    gap: 4px;
}

/* Container for showing several role badges together (a user can now hold
   more than one role at once). */
.role-badge-group {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
}

.role-badge.role-developer {
    background: color-mix(in srgb, var(--role-color-developer) 15%, transparent);
    color: var(--role-color-developer);
    border: 1px solid color-mix(in srgb, var(--role-color-developer) 40%, transparent);
}

.role-badge.role-premium {
    background: color-mix(in srgb, var(--role-color-premium) 15%, transparent);
    color: var(--role-color-premium);
    border: 1px solid color-mix(in srgb, var(--role-color-premium) 45%, transparent);
}

.role-badge.role-user {
    background: color-mix(in srgb, var(--role-color-user) 15%, transparent);
    color: var(--role-color-user);
    border: 1px solid color-mix(in srgb, var(--role-color-user) 35%, transparent);
}

/* ── Pride / LGBT role — animated rainbow badge ── */
@keyframes rainbow-shift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes rainbow-pop {
    0%   { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.role-badge.role-lgbt {
    color: #ffffff;
    border: 1px solid transparent;
    background: linear-gradient(90deg,
        #ff0018, #ffa52c, #ffff41, #008018, #0000f9, #86007d, #ff0018);
    background-size: 300% 100%;
    animation: rainbow-shift 6s linear infinite, rainbow-pop 0.35s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.15);
}

/* ── Developer Admin Panel ── */
.admin-hero-card h3 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-users-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.admin-user-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--row-bg);
    border: 1px solid var(--glass-border);
    transition: border-color 0.15s ease;
}

.admin-user-row:hover {
    border-color: var(--glass-border);
    background: color-mix(in srgb, var(--row-bg) 100%, var(--text-main) 3%);
}

.admin-user-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-user-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.admin-user-name {
    font-weight: 600;
}

.admin-user-role-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.admin-user-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.admin-verify-btn {
    color: var(--text-muted);
}

.admin-verify-btn.active {
    color: #3b82f6;
    filter: drop-shadow(0 0 4px rgba(59, 130, 246, 0.5));
}

.admin-delete-btn {
    color: var(--text-muted);
}

.admin-delete-btn:hover {
    color: #ef4444;
    filter: drop-shadow(0 0 4px rgba(239, 68, 68, 0.5));
}

.admin-session-delete-inactive-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    margin-top: 12px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: transparent;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
    flex-shrink: 0;
}

.admin-session-delete-inactive-btn:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
}

.admin-session-delete-inactive-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.admin-session-delete-inactive-btn.danger {
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
    background: rgba(239, 68, 68, 0.06);
}

.admin-session-delete-inactive-btn.danger:hover {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.16);
}

.admin-user-search-wrap {
    position: relative;
    margin: 12px 0 10px;
}

.admin-user-search-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 13px;
    pointer-events: none;
}

.admin-user-search-input {
    width: 100%;
    padding: 10px 14px 10px 34px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: var(--row-bg);
    color: var(--text-main);
    font-size: 13.5px;
    outline: none;
    transition: border-color 0.15s ease;
}

.admin-user-search-input:focus {
    border-color: var(--nebula-violet);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18);
}

.admin-user-search-input::placeholder {
    color: var(--text-muted);
}

/* Multi-select role pills — click to toggle a role on/off for a user. */
.admin-role-toggle-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.admin-max-sessions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--glass-border);
    font-size: 0.78rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.admin-max-sessions-input {
    display: flex;
    align-items: center;
    gap: 6px;
}

.admin-max-sessions-input input {
    width: 60px;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: var(--input-bg);
    color: var(--text-main);
    text-align: center;
}

.admin-max-sessions-input .btn-ghost {
    padding: 6px 12px;
    font-size: 0.72rem;
}

.role-session-limits-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.role-session-limit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
}

.role-toggle-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: var(--font-mono);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.role-toggle-chip:hover {
    transform: translateY(-1px);
}

.role-toggle-chip:active {
    transform: translateY(0);
}

.role-toggle-chip.active.role-developer {
    background: color-mix(in srgb, var(--role-color-developer) 18%, transparent);
    color: var(--role-color-developer);
    border-color: color-mix(in srgb, var(--role-color-developer) 55%, transparent);
}

.role-toggle-chip.active.role-premium {
    background: color-mix(in srgb, var(--role-color-premium) 18%, transparent);
    color: var(--role-color-premium);
    border-color: color-mix(in srgb, var(--role-color-premium) 55%, transparent);
}

.role-toggle-chip.active.role-user {
    background: color-mix(in srgb, var(--role-color-user) 18%, transparent);
    color: var(--role-color-user);
    border-color: color-mix(in srgb, var(--role-color-user) 45%, transparent);
}

.role-toggle-chip.active.role-lgbt {
    color: #ffffff;
    border-color: transparent;
    background: linear-gradient(90deg,
        #ff0018, #ffa52c, #ffff41, #008018, #0000f9, #86007d, #ff0018);
    background-size: 300% 100%;
    animation: rainbow-shift 4s linear infinite;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.user-breakdown {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.user-breakdown-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 14px;
    background: var(--row-bg);
    border: 1px solid var(--glass-border);
}

.user-breakdown-count {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.1rem;
}

.user-breakdown-total {
    margin-top: 14px;
    text-align: right;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.user-breakdown-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.user-name-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 4px;
}

.user-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
}

.user-name-chip {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    border-radius: 12px;
    background: var(--row-bg);
    border: 1px solid var(--glass-border);
    font-size: 0.82rem;
    color: var(--text-main);
    flex-wrap: wrap;
}

.user-name-chip-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.user-name-chip-roles {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px;
}

.user-name-chip-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--accent-bg);
    color: var(--accent-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    overflow: hidden;
}

.user-name-chip-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.user-name-chip-role {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    opacity: 1;
}

.user-name-chip-role.role-developer {
    background: color-mix(in srgb, var(--role-color-developer) 15%, transparent);
    color: var(--role-color-developer);
    border: 1px solid color-mix(in srgb, var(--role-color-developer) 40%, transparent);
}

.user-name-chip-role.role-premium {
    background: color-mix(in srgb, var(--role-color-premium) 15%, transparent);
    color: var(--role-color-premium);
    border: 1px solid color-mix(in srgb, var(--role-color-premium) 45%, transparent);
}

.user-name-chip-role.role-user {
    background: color-mix(in srgb, var(--role-color-user) 15%, transparent);
    color: var(--role-color-user);
    border: 1px solid color-mix(in srgb, var(--role-color-user) 35%, transparent);
}

.user-name-chip-role.role-lgbt {
    color: #ffffff;
    border: 1px solid transparent;
    background: linear-gradient(90deg,
        #ff0018, #ffa52c, #ffff41, #008018, #0000f9, #86007d, #ff0018);
    background-size: 300% 100%;
    animation: rainbow-shift 4s linear infinite;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.user-name-chip-clickable {
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.user-name-chip-clickable:hover {
    background: var(--glass-border);
    transform: translateY(-1px);
}

.user-name-chip-clickable:active {
    transform: translateY(0);
}

.user-name-empty {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-style: italic;
    padding: 0 4px;
}

/* ── Verified badge (centang biru) ── */
.verified-badge {
    color: #3b82f6;
    margin-left: 4px;
    filter: drop-shadow(0 0 4px rgba(59, 130, 246, 0.5));
}

/* ── Device status mockup ── */
.device-mockup {
    background:
        radial-gradient(circle at center, rgba(255, 255, 255, 0.08), transparent 70%),
        rgba(0, 0, 0, 0.35);
    border-radius: 16px;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--glass-border);
    transition: border-color 0.5s, box-shadow 0.5s;
}

.device-mockup.online {
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: inset 0 0 50px rgba(255, 255, 255, 0.12);
}

.screen-content {
    text-align: center;
    color: var(--text-muted);
}

.screen-content i {
    margin-bottom: 10px;
    transition: color 0.3s;
}

#bot-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--bg-darker);
    z-index: 1;
}

#bot-icon::after {
    content: "";
    position: absolute;
    inset: -9px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, var(--nebula-violet), var(--nebula-magenta), var(--nebula-cyan), var(--nebula-violet));
    z-index: -1;
    opacity: 0.32;
    filter: blur(2px);
    animation: spin-slow 14s linear infinite;
    transition: opacity 0.5s;
}

.device-mockup.online #bot-icon {
    background: radial-gradient(circle, rgba(255, 255, 255, 0.25), var(--bg-darker) 72%);
}

.device-mockup.online #bot-icon::after {
    opacity: 0.95;
    filter: blur(3px);
    animation-duration: 4s;
    box-shadow: 0 0 24px rgba(255, 255, 255, 0.5);
}

@keyframes spin-slow { to { transform: rotate(360deg); } }

.action-card {
    text-align: center;
    margin-bottom: 0;
}

.action-card h3, .pairing-card h3 { font-family: var(--font-display); }

.subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 8px 0 20px;
}

.phone-input {
    display: flex;
    gap: 10px;
}

.phone-input .country-code {
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0 15px;
    display: flex;
    align-items: center;
    font-weight: 600;
    font-family: var(--font-mono);
}

.phone-input input {
    padding-left: 16px;
    font-family: var(--font-mono);
}

.pairing-card {
    text-align: center;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.08));
    border: 1px solid rgba(255, 255, 255, 0.35);
}

.pairing-code {
    font-family: var(--font-mono);
    font-size: 2.3rem;
    font-weight: 600;
    letter-spacing: 6px;
    margin: 20px 0;
    background: linear-gradient(90deg, var(--nebula-violet), var(--nebula-magenta), var(--nebula-cyan));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 18px rgba(255, 255, 255, 0.35));
}

.instruction {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.loader {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--nebula-violet);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto 0;
}

.qr-code-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    margin: 16px 0;
}

.qr-code-wrap img {
    width: 220px;
    height: 220px;
    border-radius: 12px;
    background: #fff;
    padding: 10px;
}

@keyframes spin { 100% { transform: rotate(360deg); } }

.hidden { display: none !important; }

.session-info {
    margin: 15px 0;
}

.session-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--glass-border);
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.session-row:last-child {
    border-bottom: none;
}

.status-online { color: var(--status-online-color); }
.status-offline { color: var(--text-muted); }

.btn-danger {
    background: rgba(255, 92, 92, 0.15);
    color: var(--danger);
    border: 1px solid rgba(255, 92, 92, 0.35);
    padding: 12px;
    border-radius: 12px;
    font-weight: 600;
    font-family: var(--font-display);
    cursor: pointer;
    transition: background 0.3s, opacity 0.3s;
}

.btn-danger:hover {
    background: rgba(255, 92, 92, 0.25);
}

.full-width { width: 100%; }

/* Bottom Nav */
.bottom-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--nav-bg);
    backdrop-filter: blur(15px);
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-around;
    padding: 12px 0;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 10;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    transition: color 0.3s, text-shadow 0.3s;
}

.nav-item i { font-size: 1.2rem; }
.nav-item.active {
    color: var(--nebula-violet);
    text-shadow: 0 0 14px var(--primary-glow);
}

/* Config Editor */
.form-row {
    display: grid;
    grid-template-columns: 1fr 96px;
    gap: 12px;
}

.form-row-even {
    grid-template-columns: 1fr 1fr;
}

.cfg-persession-divider {
    display: flex;
    align-items: center;
    margin: 18px 0 6px;
    padding-top: 14px;
    border-top: 1px solid var(--glass-border);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.cfg-persession-session-name {
    text-transform: none;
    font-weight: 500;
    color: var(--nebula-violet, var(--text-muted));
    margin-left: 4px;
}

.form-group-narrow input {
    text-align: center;
    font-family: var(--font-mono);
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.cfg-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: var(--input-bg);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.cfg-input:focus {
    border-color: var(--nebula-violet);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18);
}

select.cfg-input {
    appearance: none;
}

.cfg-group-label {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--nebula-cyan);
    margin: 18px 0 4px;
}

.cfg-group-label:first-child {
    margin-top: 4px;
}

.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.9rem;
}

.toggle-row:last-child {
    border-bottom: none;
}

.cfg-allowedgroup-list {
    max-height: 360px;
    overflow-y: auto;
    margin: 10px 0;
}

.cfg-allowedgroup-row span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 12px;
}

.cfg-allowedgroup-row.hidden {
    display: none;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch .slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.12);
    transition: 0.3s;
    border-radius: 24px;
}

.switch .slider::before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    transition: 0.3s;
    border-radius: 50%;
}

.switch input:checked + .slider {
    background: var(--accent-bg);
    border: 1px solid var(--glass-border);
}

.switch input:checked + .slider::before {
    transform: translateX(20px);
}

.config-advanced-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cfg-json-editor {
    width: 100%;
    min-height: 320px;
    margin-top: 10px;
    padding: 14px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.35);
    color: #d4d4d4;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.5;
    resize: vertical;
    outline: none;
    white-space: pre;
}

.cfg-json-editor:focus {
    border-color: var(--nebula-violet);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18);
}

.config-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 5px;
}

.cfg-advanced-actions {
    margin-top: 4px;
    padding: 0;
}

.cfg-status {
    text-align: center;
    font-size: 0.85rem;
    font-family: var(--font-mono);
    padding: 10px 5px 20px;
}

.cfg-status.success { color: var(--nebula-cyan); }
.cfg-status.error { color: var(--danger); }

/* Ghost / secondary action button */
.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 12px auto 0;
    padding: 9px 18px;
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    border-radius: 10px;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    cursor: pointer;
    transition: border-color 0.25s, color 0.25s, background 0.25s;
}

.btn-ghost:hover {
    border-color: var(--nebula-cyan);
    color: var(--nebula-cyan);
    background: rgba(255, 255, 255, 0.08);
}

/* Feature search box */
.cfg-search-group {
    margin: 14px 0 4px;
}

.cfg-search-group input {
    padding: 11px 14px 11px 42px;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-main);
    width: 100%;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.cfg-search-group input:focus {
    border-color: var(--nebula-violet);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18);
}

/* ── Toast notifications ── */
#toast-stack {
    position: fixed;
    left: 50%;
    bottom: 90px;
    transform: translateX(-50%);
    z-index: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: calc(100% - 40px);
    max-width: 380px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 12px;
    background: var(--nav-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    font-size: 0.85rem;
    color: var(--text-main);
    animation: toast-in 0.3s cubic-bezier(0.16, 1, 0.3, 1), toast-out 0.3s ease forwards 2.7s;
}

.toast i { color: var(--nebula-cyan); }
.toast.toast-error i { color: var(--danger); }
.toast.toast-error { border-color: rgba(255, 92, 92, 0.35); }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(12px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-out {
    to { opacity: 0; transform: translateY(-8px) scale(0.95); }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .app-container::before,
    #bot-icon::after,
    .loader,
    .hamburger-menu,
    .hamburger-menu a,
    .toast,
    .role-badge.role-lgbt,
    .user-name-chip-role.role-lgbt {
        animation: none !important;
        background-position: 0% 50% !important;
    }

    .glass-card:hover {
        transform: none;
    }
}

/* About screen */
.about-hero h3 { margin-bottom: 2px; }

.about-desc {
    margin-top: 15px;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.version-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 22px;
    padding: 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--nebula-violet);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-top: 0;
}

.stat-card {
    text-align: center;
    padding: 20px 14px;
    border-radius: 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.stat-card i {
    font-size: 1.5rem;
    color: var(--nebula-cyan);
    margin-bottom: 10px;
}

.stat-card h4 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    margin-bottom: 2px;
}

.stat-card span {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Settings screen */
.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
}

.setting-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Per-session Terminal panel (dashboard, below Bot Config) */
.terminal-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 18px;
}

.terminal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.terminal-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.terminal-session-name {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    padding: 2px 10px;
}

.terminal-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.terminal-header-actions .btn-icon {
    width: 32px;
    height: 32px;
    font-size: 0.95rem;
}

.terminal-live-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--text-muted);
    margin-right: 4px;
    flex-shrink: 0;
    transition: background 0.3s, box-shadow 0.3s;
}

.terminal-live-dot.live {
    background: var(--status-online-color);
    box-shadow: 0 0 6px var(--status-online-color);
}

.terminal-body {
    max-height: 260px;
    overflow-y: auto;
    background: #0a0a0b;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 10px 12px;
}

.terminal-output {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    line-height: 1.55;
    color: #d4d4d8;
    white-space: pre-wrap;
    word-break: break-word;
}

.terminal-line {
    display: block;
}

.terminal-line .terminal-time {
    color: var(--text-muted);
}

.terminal-line.level-error { color: #ff8080; }
.terminal-line.level-warn { color: #facc15; }
.terminal-line.level-success { color: var(--status-online-color); }
