/* ============================================
   TWIZADMIN DASHBOARD v2.0
   Custom Admin Panel Stylesheet
   ============================================ */

/* === VARIABLES & RESET === */
:root {
    --primary: #a855f7;
    --primary-light: #c084fc;
    --primary-dark: #7c3aed;
    --primary-glow: rgba(168, 85, 247, 0.4);

    --bg: #0a0a0a;
    --bg-elevated: #111111;
    --bg-card: #141414;
    --surface: #141414;
    --surface-hover: #1a1a1a;
    --surface-active: #1f1f1f;

    --text: #fafaf9;
    --text-secondary: #a8a29e;
    --text-muted: #78716c;
    --text-dim: #57534e;

    --border: rgba(168, 85, 247, 0.12);
    --border-hover: rgba(168, 85, 247, 0.25);
    --border-light: rgba(168, 85, 247, 0.06);
    --glow: rgba(168, 85, 247, 0.15);

    --success: #57f287;
    --warning: #f0b232;
    --danger: #f23f43;
    --info: #58b9ff;
    --discord: #5865f2;

    --font-display: "Outfit", system-ui, sans-serif;
    --font-body: "Inter", system-ui, sans-serif;
    --font-mono: "JetBrains Mono", "Consolas", monospace;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 25px 60px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 10px 40px var(--glow);

    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: var(--primary);
    color: var(--bg);
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-dark);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

::-webkit-scrollbar-corner {
    background: var(--bg);
}

/* === TYPOGRAPHY === */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: rgba(168, 85, 247, 0.08);
    padding: 0.2em 0.5em;
    border-radius: 4px;
    color: var(--primary-light);
    border: 1px solid var(--border);
}

/* === UTILITIES === */
.hidden {
    display: none !important;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

/* === LOGIN OVERLAY === */
.overlay {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(
            ellipse at 50% 0%,
            rgba(168, 85, 247, 0.08) 0%,
            transparent 50%
        ),
        rgba(12, 10, 9, 0.96);
    backdrop-filter: blur(24px) saturate(180%);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 1;
    visibility: visible;
    transition:
        opacity 0.5s ease,
        visibility 0.5s ease;
}

.overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.login-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    width: 100%;
    max-width: 440px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: fadeSlideUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.login-box::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(
        90deg,
        var(--primary),
        var(--primary-dark),
        var(--primary)
    );
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.login-box h2 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.login-box h2::before {
    content: "T";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--bg);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 800;
}

.login-box > p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.8rem;
}

.input-group {
    margin-bottom: 1rem;
    position: relative;
}

.input-group input {
    width: 100%;
    padding: 0.95rem 1.1rem;
    background: var(--bg-elevated);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: all var(--transition-base);
    outline: none;
}

.input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
    background: var(--surface);
    transform: translateY(-1px);
}

.input-group input#login-key {
    font-family: var(--font-mono);
    text-align: center;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.error-text {
    color: var(--danger);
    font-size: 0.82rem;
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-6px);
    }
    75% {
        transform: translateX(6px);
    }
}

/* === BUTTONS === */
.btn-primary {
    padding: 0.85rem 1.8rem;
    background: var(--primary);
    color: var(--bg);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.92rem;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-base);
    box-shadow: 0 4px 16px rgba(168, 85, 247, 0.25);
    width: 100%;
}

.btn-primary::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.25),
        transparent
    );
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.btn-primary:hover::after {
    transform: translateX(100%);
}

.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow:
        var(--shadow-glow),
        0 0 0 3px rgba(168, 85, 247, 0.1);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-secondary {
    padding: 0.85rem 1.8rem;
    background: transparent;
    color: var(--text);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.92rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all var(--transition-base);
    backdrop-filter: blur(10px);
    width: 100%;
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(168, 85, 247, 0.05);
    transform: translateY(-2px);
}

.btn-glass {
    padding: 0.6rem 1.2rem;
    background: rgba(168, 85, 247, 0.08);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.82rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-base);
    backdrop-filter: blur(12px);
}

.btn-glass:hover {
    background: rgba(168, 85, 247, 0.15);
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.btn-glass.active {
    background: var(--primary);
    color: var(--bg);
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.btn-red {
    padding: 0.6rem 1.2rem;
    background: rgba(242, 63, 67, 0.1);
    border: 1px solid rgba(242, 63, 67, 0.3);
    color: var(--danger);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.82rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-base);
}

.btn-red:hover {
    background: rgba(242, 63, 67, 0.2);
    border-color: var(--danger);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(242, 63, 67, 0.2);
}

.btn-icon-square {
    width: 36px;
    height: 36px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
    font-size: 0.85rem;
}

.btn-icon-square:hover {
    background: var(--primary);
    color: var(--bg);
    border-color: var(--primary);
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--shadow-glow);
}

.btn-sm {
    padding: 0.4rem 0.9rem;
    font-size: 0.78rem;
}

.btn-large {
    padding: 1rem 2.5rem;
    font-size: 1rem;
}

/* === LAYOUT === */
#main-content {
    display: flex;
    min-height: 100vh;
    opacity: 1;
    transition: opacity 0.4s ease;
}

#main-content.hidden {
    display: none;
}

.desktop-view img.control-active {
    cursor: crosshair;
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

#control-status {
    animation: pulse-primary 2s infinite;
}

@keyframes pulse-primary {
    0% { opacity: 0.8; box-shadow: 0 0 0 0 var(--primary-glow); }
    70% { opacity: 1; box-shadow: 0 0 0 10px transparent; }
    100% { opacity: 0.8; box-shadow: 0 0 0 0 transparent; }
}

.desktop-view {
    position: relative;
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    margin-top: 1rem;
}

.desktop-controls {
    position: absolute;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 10;
    flex-wrap: wrap;
}

#desktop-stream {
    width: 100%;
    height: auto;
    display: block;
}

/* === SIDEBAR === */
.sidebar {
    width: 270px;
    background: var(--bg-elevated);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--bg);
    box-shadow: 0 4px 12px var(--glow);
}

.logo-text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
    display: block;
    line-height: 1.2;
}

.logo-version {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.nav-label {
    padding: 1.2rem 1.5rem 0.6rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.nav-links {
    list-style: none;
    padding: 0 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    overflow-y: auto;
}

.nav-links li {
    padding: 0.7rem 0.9rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.nav-links li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: linear-gradient(180deg, var(--primary), var(--primary-dark));
    border-radius: 0 2px 2px 0;
    transition: height var(--transition-base);
}

.nav-links li:hover {
    background: rgba(168, 85, 247, 0.05);
    color: var(--text);
}

.nav-links li:hover::before {
    height: 40%;
}

.nav-links li.active {
    background: rgba(168, 85, 247, 0.1);
    color: var(--primary);
    font-weight: 600;
}

.nav-links li.active::before {
    height: 70%;
}

.nav-links li i {
    font-size: 0.9rem;
    width: 20px;
    text-align: center;
    transition: transform var(--transition-fast);
}

.nav-links li:hover i {
    transform: scale(1.1);
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.footer-btns {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.footer-link-item {
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-fast);
}

.footer-link-item:hover {
    color: var(--text);
    background: rgba(168, 85, 247, 0.05);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--success);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.telegram-link {
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--info);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-fast);
    font-family: var(--font-mono);
}

.telegram-link:hover {
    background: rgba(88, 185, 255, 0.08);
    color: var(--info);
}

.telegram-link::before {
    content: "\f2c6";
    font-family: "Font Awesome 6 Brands";
}

/* === CONTENT AREA === */
.content-area {
    flex: 1;
    margin-left: 270px;
    padding: 1.5rem 2rem;
    min-height: 100vh;
    background: var(--bg);
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.header-title h2 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-title h2::before {
    content: "";
    display: block;
    width: 4px;
    height: 24px;
    background: linear-gradient(180deg, var(--primary), var(--primary-dark));
    border-radius: 2px;
}

.header-title p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.badge-live {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.9rem;
    background: rgba(87, 242, 135, 0.1);
    border: 1px solid rgba(87, 242, 135, 0.2);
    color: var(--success);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-radius: 20px;
    font-family: var(--font-mono);
}

.badge-live::before {
    content: "";
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--success);
    animation: livePulse 2s infinite;
}

body.api-offline .badge-live {
    background: rgba(242, 63, 67, 0.1) !important;
    border-color: rgba(242, 63, 67, 0.2) !important;
    color: var(--danger) !important;
}

body.api-offline .badge-live::before {
    background: var(--danger) !important;
    box-shadow: 0 0 8px var(--danger) !important;
}

@keyframes livePulse {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(0.8);
    }
}

/* === SECTIONS === */
.section {
    animation: fadeSlideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === STATS GRID === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-slow);
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-icon {
    width: 48px;
    height: 48px;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.2rem;
    transition: all var(--transition-base);
    flex-shrink: 0;
}

.stat-card:hover .stat-icon {
    background: var(--primary);
    color: var(--bg);
    border-color: var(--primary);
    transform: scale(1.1) rotate(-5deg);
    box-shadow: var(--shadow-glow);
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-label span {
    color: var(--text-secondary);
}

/* === WIDGETS GRID === */
.widgets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.25rem;
}

.widget {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-base);
}

.widget:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.widget-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-secondary);
}

.widget-header i {
    color: var(--primary);
    font-size: 0.85rem;
}

.widget-body {
    padding: 1.25rem;
    min-height: 200px;
}

/* ============================================
   LOGS SECTION - NEW DESIGN
   ============================================ */

.logs-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.logs-title-group h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 0.3rem;
    color: var(--text);
}

.logs-title-group p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.logs-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.btn-sound {
    padding: 0.6rem 1.2rem;
    background: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-base);
}

.btn-sound:hover {
    background: var(--primary);
    color: var(--bg);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn-sound.active {
    background: var(--primary);
    color: var(--bg);
    box-shadow: var(--shadow-glow);
}

.btn-sound.active i {
    animation: soundWave 1s infinite;
}

@keyframes soundWave {
    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.7;
    }
}

.btn-refresh {
    padding: 0.6rem 1.2rem;
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-base);
}

.btn-refresh:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(168, 85, 247, 0.05);
}

.btn-refresh.spinning i {
    animation: spin 0.8s linear infinite;
}

/* Search Bar */
.logs-search-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.search-input-wrapper {
    flex: 1;
    min-width: 300px;
    position: relative;
}

.search-input-wrapper i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.search-input-wrapper input {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.5rem;
    background: var(--bg-elevated);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: all var(--transition-base);
    outline: none;
}

.search-input-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.1);
}

.search-input-wrapper input::placeholder {
    color: var(--text-muted);
}

/* Filter Tabs */
.logs-filter-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text-muted);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.82rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-fast);
}

.filter-tab:hover {
    border-color: var(--border-hover);
    color: var(--text-secondary);
    background: rgba(168, 85, 247, 0.03);
}

.filter-tab.active {
    background: var(--text);
    border-color: var(--text);
    color: var(--bg);
}

.filter-tab i {
    font-size: 0.75rem;
}

/* Logs Table Container */
.logs-table-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-base);
}

.logs-table-container:hover {
    border-color: var(--border-hover);
}

/* Table Styles */
.logs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.logs-table thead {
    background: var(--bg-elevated);
}

.logs-table th {
    padding: 0.9rem 1.25rem;
    text-align: left;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.logs-table th i {
    margin-right: 0.4rem;
    font-size: 0.7rem;
}

.logs-table td {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
    vertical-align: middle;
}

.logs-table tbody tr {
    transition: all var(--transition-fast);
}

.logs-table tbody tr { cursor: pointer; }
.logs-table tbody tr.expanded { background: rgba(124,58,237,0.04); }

.log-details td {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    background: linear-gradient(90deg, rgba(0,0,0,0.02), rgba(0,0,0,0));
}
.log-details .details-panel {
    padding: 1rem;
    border-radius: 8px;
    background: rgba(0,0,0,0.03);
}
.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    grid-auto-rows: minmax(40px, auto);
}
.details-grid .muted { color: var(--text-muted); margin-top: 0.35rem; font-size: 0.92rem; }
.badges-inline { display:inline-flex; align-items:center; gap:0.35rem; }
.badges-inline img { width: 22px; height: 22px; border-radius: 4px; display:block; }
.download-link.small { padding: 0.25rem 0.5rem; font-size: 0.78rem; border-radius: 6px; background: rgba(124,58,237,0.08); border: 1px solid rgba(124,58,237,0.18); color: var(--primary); text-decoration: none; }

/* Details slide animation - use sibling selector so the main row controls visibility */
.log-details { background: transparent; }
.details-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.36s var(--transition-fast), opacity 0.28s ease, transform 0.36s var(--transition-fast);
    opacity: 0;
    transform: translateY(-6px);
}
/* When the preceding row has .expanded, reveal the details panel */
table.logs-table tbody tr.expanded + tr.log-details .details-panel {
    max-height: 1200px;
    opacity: 1;
    transform: translateY(0);
}

/* Make sure details text can wrap and not overflow */
.details-grid .muted { white-space: normal; word-break: break-word; }

/* Table cell padding and alignment to avoid overlap */
.logs-table td { padding: 0.9rem 1rem; vertical-align: middle; }
.log-details td { padding: 0; }
.log-details .details-panel { padding: 1.25rem; }

/* Payment methods layout: wrap badges and text */
.payment-cell .payment-method,
.payment-cell .payment-none { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.28rem 0.5rem; border-radius: 8px; background: rgba(124,58,237,0.06); border: 1px solid rgba(124,58,237,0.12); color: var(--primary-light); margin-right: 0.5rem; margin-bottom: 0.35rem; }
.payment-cell { display:flex; flex-wrap:wrap; align-items:center; gap:0.25rem; }

/* Badges cell ensure centered and not overlapping */
.badges-cell { display:flex; align-items:center; gap:0.4rem; }

/* Ensure download link small spacing */
.download-link.small { display:inline-block; margin-top:0.2rem; }

/* Responsive: on narrow screens stack details vertically */
@media (max-width: 900px) {
    .details-grid { grid-template-columns: 1fr; }
    .user-avatar { width:40px; height:40px; }
}

/* Action toggle button */
.actions-cell { display:flex; align-items:center; gap:0.5rem; }
.btn-toggle-details {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}
.btn-toggle-details:hover { background: rgba(168,85,247,0.06); color: var(--primary); }
.btn-toggle-details .fa-chevron-down { display:inline-block; transition: transform var(--transition-fast) ease; }
/* Rotate chevron when expanded */
table.logs-table tbody tr.expanded .btn-toggle-details .fa-chevron-down { transform: rotate(180deg); color: var(--primary); }



.logs-table tbody tr:last-child td {
    border-bottom: none;
}

.logs-table tbody tr:hover {
    background: rgba(168, 85, 247, 0.03);
}

/* User Cell */
.user-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.98rem;
    color: var(--bg);
    flex-shrink: 0;
    overflow: hidden;
}

.user-avatar img,
.user-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
    display: block;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.user-name {
    font-weight: 600;
    color: var(--text);
    font-size: 0.88rem;
}

.user-id {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Token Cell */
.token-cell {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--primary-light);
    background: rgba(168, 85, 247, 0.06);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Location Cell */
.location-cell {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.location-cell i {
    color: var(--danger);
    font-size: 0.8rem;
}

/* Badges Cell */
.badges-cell {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.badge-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
}

/* Payment Methods Cell */
.payment-cell {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.payment-method {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    background: rgba(88, 185, 255, 0.1);
    border: 1px solid rgba(88, 185, 255, 0.2);
    color: var(--info);
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 4px;
    font-family: var(--font-mono);
}

/* Wallet Cell */
.wallet-cell {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Archive Cell */
.archive-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.archive-cell i {
    color: var(--primary);
    font-size: 0.9rem;
}

/* Time Cell */
.time-cell {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Empty State */
.logs-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
    text-align: center;
    gap: 0.75rem;
}

.logs-empty-state i {
    font-size: 2.5rem;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
}

.logs-empty-state p {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* === BADGES === */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: var(--font-mono);
}

.badge-red {
    background: rgba(242, 63, 67, 0.1);
    border: 1px solid rgba(242, 63, 67, 0.2);
    color: var(--danger);
}

.badge-blue {
    background: rgba(88, 185, 255, 0.1);
    border: 1px solid rgba(88, 185, 255, 0.2);
    color: var(--info);
}

.badge-green {
    background: rgba(87, 242, 135, 0.1);
    border: 1px solid rgba(87, 242, 135, 0.2);
    color: var(--success);
}

.badge-purple {
    background: rgba(168, 130, 255, 0.1);
    border: 1px solid rgba(168, 130, 255, 0.2);
    color: #a882ff;
}

/* === FORMS === */
select,
textarea {
    padding: 0.7rem 1rem;
    background: var(--bg-elevated);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.9rem;
    outline: none;
    transition: all var(--transition-base);
    cursor: pointer;
}

select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.1);
}

select option {
    background: var(--surface);
    color: var(--text);
}

/* === EMPTY STATE === */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-muted);
    text-align: center;
    gap: 0.75rem;
}

.empty-state i {
    font-size: 2.5rem;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
}

.empty-state h3 {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.empty-state p {
    font-size: 0.9rem;
    max-width: 300px;
}

/* === MODAL === */
#modal-container .login-box {
    max-width: 400px;
    text-align: center;
}

#modal-container .login-box h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

#modal-container .login-box p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
}

.modal-actions button {
    flex: 1;
}

/* === INTERACTION MODAL === */
#interaction-modal {
    z-index: 10000;
}

.interaction-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 1100px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: fadeSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.interaction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-elevated);
}

.bot-info-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.bot-info-header h3 {
    font-size: 1.1rem;
    margin-bottom: 0.15rem;
}

.bot-info-header p {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

.interaction-tabs {
    display: flex;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-elevated);
    overflow-x: auto;
    scrollbar-width: none;
}

.interaction-tabs::-webkit-scrollbar {
    display: none;
}

.tab-item {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-fast);
    white-space: nowrap;
    border: 1px solid transparent;
}

.tab-item:hover {
    color: var(--text);
    background: rgba(168, 85, 247, 0.05);
}

.tab-item.active {
    background: rgba(168, 85, 247, 0.1);
    color: var(--primary);
    border-color: var(--border);
}

.btn-toggle-details i {
    transition: transform var(--transition-fast);
}

.btn-toggle-details i.rotated {
    transform: rotate(180deg);
}

.tab-item i {
    font-size: 0.8rem;
}

.interaction-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    min-height: 400px;
}

.interact-tab {
    animation: fadeSlideUp 0.3s ease;
}

.interact-tab.hidden {
    display: none;
}

/* Desktop Stream */
.desktop-view {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.desktop-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

#desktop-stream {
    width: 100%;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg);
    aspect-ratio: 16/9;
    object-fit: cover;
}

/* Chat */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 500px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.chat-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-elevated);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: var(--bg);
}

.message-bubble {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    line-height: 1.5;
    animation: fadeSlideUp 0.3s ease;
}

.message-bubble.system {
    background: rgba(168, 85, 247, 0.08);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    align-self: center;
    font-size: 0.8rem;
    font-style: italic;
}

.message-bubble.client {
    background: var(--surface-hover);
    border: 1px solid var(--border);
    color: var(--text);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.message-bubble.admin {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--bg);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    font-weight: 500;
}

.chat-input-area {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    border-top: 1px solid var(--border);
    background: var(--bg-elevated);
}

.chat-input-area input {
    flex: 1;
    padding: 0.7rem 1rem;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.9rem;
    outline: none;
    transition: all var(--transition-fast);
}

.chat-input-area input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

.chat-input-area button {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-md);
    color: var(--bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.chat-input-area button:hover {
    background: var(--primary-light);
    transform: scale(1.05);
}

/* BSOD */
.bsod-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.bsod-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 3rem;
    text-align: center;
    max-width: 450px;
    transition: all var(--transition-base);
}

.bsod-card:hover {
    border-color: rgba(242, 63, 67, 0.3);
    box-shadow: 0 20px 50px rgba(242, 63, 67, 0.1);
}

.bsod-card > i {
    font-size: 3rem;
    color: var(--danger);
    margin-bottom: 1rem;
    display: block;
}

.bsod-card h3 {
    margin-bottom: 0.5rem;
    color: var(--danger);
}

.bsod-card p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.7;
}

/* Shell Tab */
.shell-container {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    min-height: 400px;
    overflow-y: auto;
}

.shell-line {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.shell-prompt {
    color: var(--success);
    margin-right: 0.5rem;
}

.shell-input-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.shell-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.shell-actions .btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}

.shell-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
}

.shell-header .shell-line {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-secondary);
}

.shell-header-text {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Keep the action buttons compact on the right */
#shell-actions-top {
    display: flex;
    gap: 0.5rem;
}

.shell-input-line input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    outline: none;
}

/* Manager Tab */
.manager-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.manager-path {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    color: var(--text);
    font-size: 0.9rem;
}

.manager-path-box {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    width: 100%;
}

.manager-path-box input {
    flex: 1;
    min-width: 0;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    color: var(--text);
}

.manager-path-box button {
    white-space: nowrap;
}

.manager-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@media (min-width: 760px) {
    .manager-toolbar {
        grid-template-columns: auto 1fr auto;
        align-items: center;
    }
}

.manager-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.manager-item {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.manager-item:hover {
    border-color: var(--border-hover);
    background: var(--surface-hover);
}

.manager-actions {
    margin-left: auto;
    display: flex;
    gap: 0.3rem;
}

.manager-actions .btn-icon {
    width: 1.75rem;
    height: 1.75rem;
    min-width: 1.75rem;
    min-height: 1.75rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-color: rgba(255,255,255,0.06);
    font-size: 0.85rem;
}

.manager-item .btn-icon-ghost {
    color: var(--text-muted);
    background: rgba(255,255,255,0.02);
}

.manager-item .btn-icon-ghost:hover {
    color: var(--text);
    background: rgba(255,255,255,0.08);
}

.manager-item i {
    color: var(--primary);
    font-size: 1.2rem;
}

.manager-item-info {
    display: flex;
    flex-direction: column;
}

.manager-item-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}

.manager-item-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Keys Tab */
.keys-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.key-record {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    transition: all var(--transition-fast);
}

.key-record:hover {
    border-color: var(--border-hover);
}

.key-record-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* === TOAST NOTIFICATIONS === */
.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.toast {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    min-width: 300px;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-lg);
    animation: toastSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: all;
    position: relative;
    overflow: hidden;
}

.toast::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
}

.toast.success::before {
    background: var(--success);
}
.toast.error::before {
    background: var(--danger);
}
.toast.info::before {
    background: var(--info);
}
.toast.warning::before {
    background: var(--warning);
}

.toast.removing {
    animation: toastSlideOut 0.3s ease forwards;
}

.toast-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    background: rgba(87, 242, 135, 0.1);
    color: var(--success);
}

.toast.error .toast-icon {
    background: rgba(242, 63, 67, 0.1);
    color: var(--danger);
}

.toast.info .toast-icon {
    background: rgba(88, 185, 255, 0.1);
    color: var(--info);
}

.toast.warning .toast-icon {
    background: rgba(240, 178, 50, 0.1);
    color: var(--warning);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.15rem;
    color: var(--text);
}

.toast-message {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    transition: color var(--transition-fast);
}

.toast-close:hover {
    color: var(--text);
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* === ANIMATIONS === */
.anim-fade {
    animation: fadeSlideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.delay-1 {
    animation-delay: 0.1s;
}
.delay-2 {
    animation-delay: 0.2s;
}
.delay-3 {
    animation-delay: 0.3s;
}
.delay-4 {
    animation-delay: 0.4s;
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .widgets-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .content-area {
        margin-left: 0;
        padding: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .interaction-container {
        width: 95%;
        max-height: 95vh;
    }

    .interaction-tabs {
        padding: 0.5rem;
    }

    .tab-item {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
    }

    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    /* Logs responsive */
    .logs-header {
        flex-direction: column;
        gap: 1rem;
    }

    .logs-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .logs-search-bar {
        flex-direction: column;
    }

    .search-input-wrapper {
        min-width: 100%;
    }

    .logs-filter-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.5rem;
    }

    .filter-tab {
        white-space: nowrap;
    }

    .logs-table-container {
        overflow-x: auto;
    }

    .logs-table {
        min-width: 900px;
    }

    th,
    td {
        padding: 0.7rem 0.75rem;
        font-size: 0.82rem;
    }

    .toast-container {
        left: 1rem;
        right: 1rem;
        top: auto;
        bottom: 1rem;
    }

    .toast {
        min-width: unset;
        max-width: unset;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .login-box {
        padding: 1.5rem;
    }

    .desktop-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .modal-actions {
        flex-direction: column;
    }
}

/* === MOBILE MENU TOGGLE === */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 101;
    width: 40px;
    height: 40px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
}

/* === LOADING SPINNER === */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(12, 10, 9, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: inherit;
}

/* === THEME TOGGLE === */
body.light-theme {
    --bg: #fafaf9;
    --bg-elevated: #111111;
    --bg-card: #ffffff;
    --surface: #ffffff;
    --surface-hover: #111111;
    --surface-active: #1a1a1a;
    --text: #1c1917;
    --text-secondary: #57534e;
    --text-muted: #78716c;
    --text-dim: #a8a29e;
    --border: rgba(168, 85, 247, 0.2);
    --border-hover: rgba(168, 85, 247, 0.35);
    --border-light: rgba(168, 85, 247, 0.1);
    --glow: rgba(168, 85, 247, 0.2);
}

body.light-theme .nav-links li:hover {
    background: rgba(168, 85, 247, 0.08);
}

body.light-theme tbody tr:hover {
    background: rgba(168, 85, 247, 0.04);
}

body.light-theme .message-bubble.client {
    background: #111111;
    color: var(--text);
}

body.light-theme .shell-container {
    background: #111111;
}

body.light-theme .logs-table-container {
    background: #ffffff;
    border-color: rgba(168, 85, 247, 0.2);
}

body.light-theme .logs-table thead {
    background: #111111;
}

body.light-theme .filter-tab.active {
    background: #1c1917;
    border-color: #1c1917;
    color: #fafaf9;
}

/* === TOOLTIP & COPY BUTTON === */
.tooltip-wrap {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
}

.tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) scale(0);
    transform-origin: bottom center;
    transition:
        transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity 0.15s;
    opacity: 0;
    pointer-events: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.7rem;
    font-size: 0.75rem;
    color: var(--text);
    white-space: nowrap;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.tooltip-wrap:hover .tooltip {
    transform: translateX(-50%) scale(1);
    opacity: 1;
}

.btn-copy {
    width: 28px;
    height: 28px;
    background: rgba(168, 85, 247, 0.08);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.75rem;
    margin-left: 0.5rem;
    flex-shrink: 0;
}

.btn-copy:hover {
    background: var(--primary);
    color: var(--bg);
    border-color: var(--primary);
    transform: scale(1.1);
}

.btn-copy.copied {
    background: var(--success);
    border-color: var(--success);
    color: var(--bg);
}

/* === RELOG BUTTON === */
.btn-relog {
    padding: 0.35rem 0.7rem;
    background: rgba(88, 185, 255, 0.08);
    border: 1px solid rgba(88, 185, 255, 0.2);
    color: var(--info);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.72rem;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all var(--transition-fast);
}

.btn-relog:hover {
    background: rgba(88, 185, 255, 0.15);
    border-color: var(--info);
    transform: translateY(-1px);
}

.btn-relog i {
    font-size: 0.7rem;
}

/* === BADGE IMAGES === */
.badge-img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    transition: transform var(--transition-fast);
}

.badge-img:hover {
    transform: scale(1.3);
}

.badges-cell {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
    align-items: center;
}

/* === PAYMENT METHODS === */
.payment-cell {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    align-items: center;
}

.payment-method {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    font-family: var(--font-mono);
}

.payment-paypal {
    background: rgba(0, 156, 222, 0.1);
    border: 1px solid rgba(0, 156, 222, 0.25);
    color: #009cde;
}

.payment-card {
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.25);
    color: var(--primary);
}

.payment-none {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-style: italic;
}

/* === DOWNLOAD LINK === */
.download-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.download-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem;
    background: rgba(87, 242, 135, 0.08);
    border: 1px solid rgba(87, 242, 135, 0.2);
    color: var(--success);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    transition: all var(--transition-fast);
    font-family: var(--font-mono);
}

.download-link:hover {
    background: rgba(87, 242, 135, 0.15);
    border-color: var(--success);
    transform: translateY(-1px);
}

.download-link i {
    font-size: 0.8rem;
}

/* === API TOGGLE (Admin) === */
.api-toggle-wrap {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.api-toggle-wrap:hover {
    background: rgba(168, 85, 247, 0.05);
}

.api-toggle-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.toggle-switch {
    position: relative;
    width: 36px;
    height: 20px;
    background: var(--text-dim);
    border-radius: 20px;
    transition: background var(--transition-fast);
    cursor: pointer;
    flex-shrink: 0;
}

.toggle-switch.active {
    background: var(--success);
}

.toggle-switch::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: var(--text);
    border-radius: 50%;
    transition: transform var(--transition-fast);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.toggle-switch.active::after {
    transform: translateX(16px);
}

/* === TOKEN CELL WITH COPY === */
.token-cell-wrap {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.token-cell {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--primary-light);
    background: rgba(168, 85, 247, 0.06);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* === ADMIN ONLY VISIBILITY === */
.admin-only {
    display: none !important;
}

body.is-admin .admin-only {
    display: flex !important;
}

/* === KEYS SECTION IMPROVEMENTS === */
.controls-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.controls-header {
    padding: 1rem 1.5rem;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.controls-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.controls-header i {
    color: var(--primary);
    font-size: 1rem;
}

.controls-body {
    padding: 1.5rem;
}

.input-group-inline {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.select-wrapper {
    position: relative;
    min-width: 180px;
}

.select-wrapper select {
    width: 100%;
    padding: 0.75rem 1.25rem;
    background: var(--bg-elevated);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
    appearance: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.select-wrapper select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
    outline: none;
}

.select-icon {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Plan Badges */
.badge-plan {
    padding: 0.35rem 0.8rem;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.plan-lifetime { background: rgba(168, 85, 247, 0.15); color: var(--primary); border: 1px solid var(--primary); }
.plan-monthly { background: rgba(167, 139, 250, 0.15); color: #a78bfa; border: 1px solid rgba(167, 139, 250, 0.3); }
.plan-weekly { background: rgba(52, 211, 153, 0.15); color: #34d399; border: 1px solid rgba(52, 211, 153, 0.3); }
.plan-3day { background: rgba(244, 63, 94, 0.15); color: #f43f5e; border: 1px solid rgba(244, 63, 94, 0.3); }

/* Status Badges */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
}

.status-active { background: rgba(87, 242, 135, 0.1); color: var(--success); }
.status-used { background: rgba(242, 63, 67, 0.1); color: var(--danger); }

.key-code {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--primary-light);
    background: rgba(168, 85, 247, 0.08);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    letter-spacing: 1px;
}

/* ============================================
   ACCOUNT SECTION
   ============================================ */

.account-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

.account-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-base);
}

.account-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.account-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
}

.account-card-header > i {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg);
    font-size: 1rem;
    flex-shrink: 0;
}

.account-expiry-card .account-card-header > i {
    background: linear-gradient(135deg, #58b9ff, #3b82f6);
}

.account-card-header h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    color: var(--text);
}

.account-card-header p {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 0;
}

.account-card-body {
    padding: 1.5rem;
}

/* Plan row */
.account-plan-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 0.5rem;
}

/* Field rows */
.account-field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
}

.account-field-row:last-child {
    border-bottom: none;
}

.account-field-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

.account-field-label i {
    color: var(--primary);
    width: 14px;
    font-size: 0.75rem;
}

.account-field-value {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* Key display */
.account-key-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.account-key-text {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--primary-light);
    background: rgba(168, 85, 247, 0.08);
    border: 1px solid var(--border);
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    letter-spacing: 1px;
}

/* Lifetime banner */
.account-lifetime-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.12), rgba(168, 85, 247, 0.05));
    border: 1px solid rgba(168, 85, 247, 0.25);
    border-radius: var(--radius-md);
    color: var(--primary);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    margin: 0.5rem 0;
}

.account-lifetime-banner i {
    font-size: 1.5rem;
    animation: infinityPulse 3s ease-in-out infinite;
}

@keyframes infinityPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.15); }
}

/* Countdown timer */
.account-countdown {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.5rem 1rem;
    flex-wrap: wrap;
}

.countdown-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    min-width: 64px;
}

.countdown-num {
    font-family: var(--font-display);
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.75rem;
    min-width: 72px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: color 0.3s;
}

.countdown-num::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-dark), var(--primary));
}

/* Color the last unit (secs) with primary accent */
#cd-secs {
    color: var(--primary);
    border-color: rgba(168, 85, 247, 0.3);
    background: rgba(168, 85, 247, 0.06);
}

.countdown-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.countdown-sep {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-dim);
    padding-bottom: 1rem;
    align-self: center;
}

/* Responsive */
@media (max-width: 900px) {
    .account-layout {
        grid-template-columns: 1fr;
    }
    .countdown-num {
        font-size: 2rem;
        min-width: 56px;
    }
}

/* Copy button */
.btn-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(168, 85, 247, 0.08);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.btn-copy:hover {
    background: rgba(168, 85, 247, 0.15);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-copy.copied {
    background: rgba(87, 242, 135, 0.12);
    border-color: var(--success);
    color: var(--success);
}

/* ============================================
   BUILDER SECTION
   ============================================ */

.builder-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 1.5rem;
    align-items: start;
}

/* === Settings Panel === */
.builder-settings-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: sticky;
    top: 1.5rem;
}

.builder-settings-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
}

.builder-settings-header > i {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg);
    font-size: 1rem;
    flex-shrink: 0;
}

.builder-settings-header h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    color: var(--text);
}

.builder-settings-header p {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 0;
}

.builder-info-grid {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.builder-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1.5rem;
    transition: background var(--transition-fast);
}

.builder-info-row:hover {
    background: rgba(168, 85, 247, 0.03);
}

.builder-info-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.builder-info-label i {
    width: 14px;
    color: var(--primary);
    font-size: 0.75rem;
}

.builder-info-value {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    max-width: 160px;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.builder-desc-val {
    font-family: var(--font-body);
    font-size: 0.78rem;
    opacity: 0.8;
}

/* === Action Buttons === */
.builder-actions {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.builder-action-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
    width: 100%;
    text-align: left;
}

.builder-action-btn > i:first-child {
    width: 20px;
    text-align: center;
    color: var(--primary);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.builder-action-btn > span {
    flex: 1;
}

.builder-btn-arrow {
    font-size: 0.7rem;
    color: var(--text-dim);
    transition: transform var(--transition-fast);
}

.builder-action-btn:hover {
    background: rgba(168, 85, 247, 0.06);
    border-color: var(--border-hover);
    color: var(--text);
    transform: translateX(3px);
}

.builder-action-btn:hover .builder-btn-arrow {
    transform: translateX(3px);
    color: var(--primary);
}

.builder-start-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-color: var(--primary);
    color: var(--bg) !important;
    margin-top: 0.25rem;
    box-shadow: 0 4px 16px rgba(168, 85, 247, 0.3);
}

.builder-start-btn > i:first-child {
    color: var(--bg) !important;
}

.builder-start-btn .builder-btn-arrow {
    color: rgba(12, 10, 9, 0.6) !important;
}

.builder-start-btn:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 24px rgba(168, 85, 247, 0.4) !important;
}

.builder-start-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* === Output Panel === */
.builder-output-panel {
    display: flex;
    flex-direction: column;
}

.build-state-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    min-height: 420px;
    justify-content: center;
    transition: all var(--transition-base);
}

.build-state-card h3 {
    font-size: 1.3rem;
    color: var(--text);
}

.build-state-card > p {
    font-size: 0.9rem;
    color: var(--text-muted);
    max-width: 360px;
    line-height: 1.7;
}

.build-state-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    background: rgba(168, 85, 247, 0.1);
    border: 2px solid rgba(168, 85, 247, 0.2);
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.build-state-icon.building {
    background: rgba(88, 185, 255, 0.1);
    border-color: rgba(88, 185, 255, 0.25);
    color: var(--info);
    animation: iconGlow 2s ease-in-out infinite;
}

.build-state-icon.success {
    background: rgba(87, 242, 135, 0.1);
    border-color: rgba(87, 242, 135, 0.25);
    color: var(--success);
}

.build-state-icon.error {
    background: rgba(242, 63, 67, 0.1);
    border-color: rgba(242, 63, 67, 0.25);
    color: var(--danger);
}

@keyframes iconGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(88, 185, 255, 0); }
    50% { box-shadow: 0 0 20px rgba(88, 185, 255, 0.25); }
}

/* Feature list (idle state) */
.build-feature-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 1.5rem;
    margin-top: 0.5rem;
}

.build-feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.build-feature i {
    color: var(--success);
    font-size: 0.75rem;
}

/* Progress bar */
.build-progress-bar-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    max-width: 420px;
}

.build-progress-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 99px;
    overflow: hidden;
}

.build-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-dark), var(--primary), var(--primary-light));
    border-radius: 99px;
    transition: width 0.5s ease;
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.5);
    background-size: 200% 100%;
    animation: progressShimmer 2s linear infinite;
}

@keyframes progressShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

#build-progress-pct {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--primary);
    min-width: 36px;
    text-align: right;
}

/* Build log output */
.build-log-output {
    width: 100%;
    max-width: 460px;
    max-height: 200px;
    overflow-y: auto;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    text-align: left;
    font-family: var(--font-mono);
    font-size: 0.78rem;
}

.build-log-line {
    padding: 0.15rem 0;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
    display: flex;
    gap: 0.5rem;
}

.build-log-line:last-child {
    border-bottom: none;
    color: var(--primary-light);
}

.log-ts {
    color: var(--text-dim);
    flex-shrink: 0;
    font-size: 0.72rem;
}

/* Result meta */
.build-result-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.build-result-meta span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.build-result-meta i {
    color: var(--primary);
}

/* Download button */
.btn-build-download {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.9rem 2rem;
    background: linear-gradient(135deg, var(--success), #34d399);
    color: var(--bg);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all var(--transition-base);
    box-shadow: 0 6px 20px rgba(87, 242, 135, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-build-download::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.btn-build-download:hover::after {
    transform: translateX(100%);
}

.btn-build-download:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(87, 242, 135, 0.4);
}

/* Error log */
.build-error-log {
    width: 100%;
    max-width: 460px;
    max-height: 160px;
    overflow-y: auto;
    background: rgba(242, 63, 67, 0.05);
    border: 1px solid rgba(242, 63, 67, 0.2);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    text-align: left;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--danger);
    white-space: pre-wrap;
    word-break: break-all;
}

/* Responsive */
@media (max-width: 1024px) {
    .builder-layout {
        grid-template-columns: 1fr;
    }
    .builder-settings-panel {
        position: static;
    }
}

/* Remote Control Styles */
#desktop-stream {
    max-width: 100%;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    cursor: default;
    transition: box-shadow var(--transition-base);
}

#desktop-stream.control-active {
    cursor: crosshair;
    box-shadow: 0 0 0 2px var(--primary), var(--shadow-glow);
}

.btn-glass.active {
    background: var(--primary);
    color: var(--bg);
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

/* ============================================
   BOTS / CLIENTS TABLE REDESIGN
   ============================================ */

.table-container {
    background: #080707 !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 40px var(--border-light) !important;
    overflow: hidden;
    margin-top: 1.5rem;
}

.table-container .widget-header {
    background: #080707 !important;
    border-bottom: 1px solid var(--border) !important;
    padding: 1.1rem 1.25rem !important;
}

#bots-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    background: #080707;
}

#bots-table th {
    padding: 1.1rem 1.25rem;
    text-align: left;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    opacity: 0.6;
    border-bottom: 1px solid var(--border);
}

#bots-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

#bots-table tbody tr {
    transition: all var(--transition-fast);
}

#bots-table tbody tr:hover {
    background: rgba(168, 85, 247, 0.02);
}

/* Bot Identity */
.bot-identity-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.bot-avatar-box {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(168, 85, 247, 0.04);
    border: 1px solid var(--border-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 0.95rem;
    transition: all var(--transition-base);
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.05);
}

.bot-avatar-box i {
    filter: drop-shadow(0 0 3px var(--primary-glow));
}

.bot-identity-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.bot-username {
    font-family: var(--font-body);
    font-weight: 700;
    color: #fafaf9;
    font-size: 0.88rem;
}

.bot-hostname {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* OS / Platform */
.bot-os-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    color: #58b9ff;
}

.bot-os-cell i {
    color: #38bdf8;
    font-size: 0.85rem;
    filter: drop-shadow(0 0 4px rgba(88, 185, 255, 0.3));
}

/* IP & HWID */
.bot-ip-cell {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-muted);
}

.bot-hwid-cell {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Status Pill */
.bot-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: #22c55e;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-radius: 12px;
    font-family: var(--font-mono);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.05);
}

.bot-status-pill::before {
    content: "●";
    color: #22c55e;
    font-size: 0.6rem;
    animation: livePulse 2s infinite;
}

.bot-status-pill.offline {
    background: rgba(242, 63, 67, 0.08);
    border: 1px solid rgba(242, 63, 67, 0.2);
    color: var(--danger);
}

.bot-status-pill.offline::before {
    color: var(--danger);
}

/* Interact Button */
.bot-interact-btn {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.78rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-base);
    backdrop-filter: blur(8px);
}

.bot-interact-btn:hover {
    background: rgba(168, 85, 247, 0.08);
    border-color: var(--primary);
    color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--glow);
}

.bot-interact-btn i {
    font-size: 0.75rem;
}

#clients-section .table-container {
    margin-top: 2.5rem !important;
}



/* ============================================
   INFO TAB - BOT DETAILS GRID
   ============================================ */

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 1rem 0;
}

.info-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    transition: all var(--transition-fast);
}

.info-card:hover {
    border-color: var(--border-hover);
    background: var(--surface-hover);
}

.info-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-dim);
    margin-bottom: 14px;
    font-family: var(--font-display);
}

.info-value {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    word-break: break-all;
    font-family: var(--font-mono);
    letter-spacing: 0.3px;
}

.info-value.status-online {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--success);
    font-weight: 700;
    font-size: 14px;
}

.info-value.status-offline {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--danger);
    font-weight: 700;
    font-size: 14px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 10px rgba(87, 242, 135, 0.5);
    animation: pulse-dot 2s infinite;
}

.status-dot.offline {
    background: var(--danger);
    box-shadow: 0 0 10px rgba(242, 63, 67, 0.5);
    animation: none;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.9); }
}

.key-masked {
    letter-spacing: 4px;
    font-size: 18px;
    color: var(--text-muted);
}

/* ============================================
   SHELL TAB - TERMINAL + ACTION BUTTONS
   ============================================ */

.shell-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 12px;
}

.shell-top-actions {
    display: flex;
    gap: 12px;
    padding: 0 4px;
}

.btn-freeze {
    flex: 1;
    padding: 12px 20px;
    background: linear-gradient(135deg, #dc2626, #991b1b);
    color: #fff;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.9rem;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all var(--transition-base);
    box-shadow: 0 4px 16px rgba(220, 38, 38, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-freeze:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(220, 38, 38, 0.4);
}

.btn-freeze:active {
    transform: translateY(0) scale(0.98);
}

.btn-fake-update {
    flex: 1;
    padding: 12px 20px;
    background: linear-gradient(135deg, #1e40af, #1e3a8a);
    color: #fff;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.9rem;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all var(--transition-base);
    box-shadow: 0 4px 16px rgba(30, 64, 175, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-fake-update:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(30, 64, 175, 0.4);
}

.btn-fake-update:active {
    transform: translateY(0) scale(0.98);
}

.shell-container {
    flex: 1;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 300px;
}

.shell-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    background: rgba(168, 85, 247, 0.03);
}

.shell-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
}

.shell-title i {
    color: var(--primary);
    font-size: 1rem;
}

.shell-output {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.shell-line {
    margin-bottom: 6px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.shell-line.init-line {
    color: var(--success);
}

.shell-status {
    color: var(--success);
    font-weight: 700;
}

.shell-init-text {
    color: var(--success);
    font-weight: 500;
}

.shell-prompt {
    color: var(--primary);
    font-weight: 700;
    white-space: nowrap;
}

.shell-command {
    color: var(--text);
}

.shell-response {
    color: var(--text-secondary);
    padding-left: 20px;
    white-space: pre-wrap;
    word-break: break-word;
}

.shell-error {
    color: var(--danger);
    padding-left: 20px;
}

.shell-input-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-top: auto;
}

.shell-prompt-path {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 600;
    white-space: nowrap;
}

.shell-input-bar input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    padding: 4px 0;
}

.shell-input-bar input::placeholder {
    color: var(--text-dim);
}

.btn-shell-send {
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: var(--bg);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.btn-shell-send:hover {
    background: var(--primary-light);
    transform: scale(1.05);
}

.btn-shell-send:active {
    transform: scale(0.95);
}

/* Responsive */
@media (max-width: 768px) {
    .info-grid {
        grid-template-columns: 1fr;
    }

    .shell-top-actions {
        flex-direction: column;
    }
}


/* ============================================
   DESKTOP / HVNC STREAM
   ============================================ */

.stream-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 12px;
}

.stream-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    padding: 0 4px;
}

.btn-stream-start {
    padding: 10px 18px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.85rem;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-base);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.btn-stream-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

.btn-stream-start:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-stream-stop {
    padding: 10px 18px;
    background: linear-gradient(135deg, #dc2626, #991b1b);
    color: #fff;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.85rem;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-base);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.btn-stream-stop:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
}

.btn-stream-single {
    padding: 10px 18px;
    background: var(--surface);
    color: var(--text);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-base);
}

.btn-stream-single:hover {
    background: var(--surface-hover);
    border-color: var(--primary);
}

.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.8rem;
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: var(--radius-md);
    letter-spacing: 1px;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
    animation: pulse-dot 1.5s infinite;
}

.stream-container {
    flex: 1;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 400px;
}

.stream-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    background: rgba(168, 85, 247, 0.03);
}

.stream-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
}

.stream-title i {
    color: var(--primary);
    font-size: 1rem;
}

.stream-viewport {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    position: relative;
    overflow: hidden;
}

.stream-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.stream-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-dim);
}

.stream-placeholder i {
    font-size: 3rem;
    color: var(--text-muted);
    opacity: 0.5;
}

.stream-placeholder p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 640px) {
    .stream-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-stream-start,
    .btn-stream-stop,
    .btn-stream-single {
        width: 100%;
        justify-content: center;
    }
}