* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
    animation: fadeIn 0.5s ease-in-out;
}

/* Login Overlay */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    height: calc(100vh - 40px);
}

.login-box {
    background: white;
    padding: 50px 40px;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 420px;
    text-align: center;
    animation: fadeIn 0.5s ease-in-out;
}

.login-logo {
    margin-bottom: 30px;
}

.login-logo i {
    font-size: 3.5rem;
    color: #3498db;
    margin-bottom: 10px;
}

.login-logo h2 {
    color: #2c3e50;
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.login-logo p {
    color: #7f8c8d;
    font-size: 0.9rem;
}

#loginForm {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group i {
    position: absolute;
    left: 15px;
    color: #95a5a6;
    font-size: 1.1rem;
}

.input-group input {
    width: 100%;
    padding: 15px 15px 15px 45px;
    border: 1px solid #dfe6e9;
    border-radius: 10px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    color: #2c3e50;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.login-btn {
    width: 100%;
    justify-content: center;
    padding: 15px;
    font-size: 1.1rem;
    margin-top: 10px;
}

.login-error {
    color: #e74c3c;
    font-size: 0.9rem;
    margin-top: 10px;
    min-height: 20px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Header */
.header {
    background: linear-gradient(135deg, #2c3e50 0%, #1a1a2e 100%);
    color: white;
    padding: 25px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

    .logo i {
        font-size: 2.5rem;
        color: #00d2ff;
    }

.status {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.1);
    padding: 10px 20px;
    border-radius: 50px;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff4757;
    animation: pulse 2s infinite;
}

    .status-indicator.online {
        background: #2ed573;
    }

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

/* Stats Cards */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    padding: 30px;
    background: #f8f9fa;
}

.stat-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    cursor: pointer;
}

    .stat-card:hover {
        transform: translateY(-5px);
    }

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.8rem;
}

.stat-info h3 {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 5px;
}

.stat-info p {
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Controls */
.controls {
    padding: 20px 30px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-success {
    background: #2ecc71;
    color: white;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn:active {
    transform: translateY(0);
}

/* Table */
.table-container {
    padding: 30px;
}

    .table-container h2 {
        color: #2c3e50;
        margin-bottom: 20px;
        display: flex;
        align-items: center;
        gap: 10px;
    }

.table-responsive {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.sessions-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1000px;
}

    .sessions-table thead {
        background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
        color: white;
    }

    .sessions-table th {
        padding: 18px 15px;
        text-align: left;
        font-weight: 500;
        font-size: 1rem;
    }

    .sessions-table tbody tr {
        border-bottom: 1px solid #eee;
        transition: background 0.3s ease;
    }

        .sessions-table tbody tr:hover {
            background: #f8f9fa;
        }

    .sessions-table td {
        padding: 15px;
        color: #2c3e50;
    }

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-connected {
    background: #d4edda;
    color: #155724;
}

.status-disconnected {
    background: #f8d7da;
    color: #721c24;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.action-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 120px;
}

    .action-btn.small {
        padding: 5px 10px;
        min-width: auto;
        font-size: 0.8rem;
    }

    .action-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    }

.action-clean {
    background: #e74c3c;
    color: white;
}

.action-restart {
    background: #f39c12;
    color: white;
}

.action-qr {
    background: #3498db;
    color: white;
}

.action-logout {
    background: #9b59b6;
    color: white;
}

/* Logs Section */
.logs-container {
    padding: 30px;
    background: #1a1a2e;
    color: white;
    border-radius: 0 0 20px 20px;
}

    .logs-container h2 {
        margin-bottom: 20px;
        color: #00d2ff;
    }

.logs {
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 20px;
    max-height: 200px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.log-item {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    color: #7fdbff;
}

    .log-item:last-child {
        border-bottom: none;
    }

    .log-item.success {
        color: #2ecc71;
    }

    .log-item.error {
        color: #ff6b6b;
    }

    .log-item.warning {
        color: #feca57;
    }

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    cursor: pointer;
    color: #7f8c8d;
}

.modal-actions {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Loading */
.loading {
    text-align: center;
    padding: 50px;
    color: #7f8c8d;
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    .stats-container {
        grid-template-columns: 1fr;
    }

    .controls {
        justify-content: center;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
    }
}
